Skip to content

Commit

Permalink
Merge branch 'development-project-configurator' of github.com:EyeSeeT…
Browse files Browse the repository at this point in the history
…ea/dataset-configuration into feature/dataset-actions
  • Loading branch information
eperedo committed Dec 12, 2024
2 parents ab35c51 + 2679969 commit 75a7b3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/webapp/components/dataset-table/DataSetTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export type DataSetColumns = DataSetAttrs & { permissionDescription: string };
const DataSetTable_: React.FC = React.memo(() => {
const [refreshTable, setRefreshTable] = React.useState(0);
const [tableAction, setTableAction] = React.useState<TableAction>();
const { goToCreateDataSet } = useDataSetsRoutes();
const tableConfig = useTableConfig({ onAction: setTableAction, refreshTable });
const { goToCreateDataSet } = useDataSetsRoutes();

const refreshDataSets = React.useCallback((isCancelAction: boolean) => {
setTableAction(undefined);
Expand Down
7 changes: 5 additions & 2 deletions src/webapp/components/projects/ProjectTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { parseSortField } from "$/utils/parse-sort-field";
import { useNavigateTo } from "$/webapp/routes";
import { DataSetActions, TableAction } from "$/webapp/components/dataset-table/DataSetActions";
import { getCommonActions } from "$/webapp/components/dataset-table/DataSetTableConfig";
import { useDataSetsRoutes } from "$/webapp/hooks/useDataSets";

type ProjectColumns = ProjectAttrs & { orgUnits: string; coreCompetencies: string };

Expand All @@ -25,6 +26,7 @@ export const ProjectTable = React.memo(() => {
const [refreshTable, setRefreshTable] = React.useState(0);
const [tableAction, setTableAction] = React.useState<TableAction>();
const [isLoading, setLoading] = React.useState(false);
const { goToCreateDataSet } = useDataSetsRoutes();

const tableConfig = useObjectsTable<ProjectColumns>(
React.useMemo(() => {
Expand Down Expand Up @@ -97,8 +99,9 @@ export const ProjectTable = React.memo(() => {
paginationOptions: { pageSizeInitialValue: 50, pageSizeOptions: [50, 100, 200] },
searchBoxLabel: i18n.t("Search"),
childrenKeys: ["dataSets"],
onActionButtonClick: goToCreateDataSet,
};
}, [navigateTo]),
}, [goToCreateDataSet, navigateTo]),
React.useCallback(
(search, pagination, sorting) => {
console.debug(refreshTable);
Expand Down Expand Up @@ -151,7 +154,7 @@ export const ProjectTable = React.memo(() => {

return (
<>
<ObjectsTable {...tableConfig} loading={isLoading} />;
<ObjectsTable {...tableConfig} loading={isLoading} />
<DataSetActions tableAction={tableAction} onChangeAction={reloadProjects} />
</>
);
Expand Down

0 comments on commit 75a7b3f

Please sign in to comment.