diff --git a/.github/workflows/misc.dependabot-automerge.yaml b/.github/workflows/misc.dependabot-automerge.yaml.skip similarity index 100% rename from .github/workflows/misc.dependabot-automerge.yaml rename to .github/workflows/misc.dependabot-automerge.yaml.skip diff --git a/CommonUI/src/Components/ModelFormModal/ModelFormModal.tsx b/CommonUI/src/Components/ModelFormModal/ModelFormModal.tsx index f574c00728..80cd72d948 100644 --- a/CommonUI/src/Components/ModelFormModal/ModelFormModal.tsx +++ b/CommonUI/src/Components/ModelFormModal/ModelFormModal.tsx @@ -14,17 +14,18 @@ import FormValues from '../Forms/Types/FormValues'; export interface ComponentProps { title: string; - modelType: { new (): TBaseModel }; + modelType: { new(): TBaseModel }; initialValues?: FormValues | undefined; onClose?: undefined | (() => void); submitButtonText?: undefined | string; onSuccess?: - | undefined - | ((data: TBaseModel | JSONObjectOrArray | Array) => void); + | undefined + | ((data: TBaseModel | JSONObjectOrArray | Array) => void); submitButtonStyleType?: undefined | ButtonStyleType; formProps: ModelFormComponentProps; modelIdToEdit?: ObjectID | undefined; onBeforeCreate?: ((item: TBaseModel) => Promise) | undefined; + footer?: ReactElement | undefined; } const ModelFormModal: Function = ( @@ -47,26 +48,30 @@ const ModelFormModal: Function = ( error={error} > {!error ? ( - - {...props.formProps} - modelType={props.modelType} - modelIdToEdit={props.modelIdToEdit} - hideSubmitButton={true} - onLoadingChange={(isFormLoading: boolean) => { - setIsFormLoading(isFormLoading); - }} - formRef={formRef} - initialValues={props.initialValues} - onSuccess={( - data: TBaseModel | JSONObjectOrArray | Array - ) => { - props.onSuccess && props.onSuccess(data); - }} - onError={(error: string) => { - setError(error); - }} - onBeforeCreate={props.onBeforeCreate} - /> + <> + + {...props.formProps} + modelType={props.modelType} + modelIdToEdit={props.modelIdToEdit} + hideSubmitButton={true} + onLoadingChange={(isFormLoading: boolean) => { + setIsFormLoading(isFormLoading); + }} + formRef={formRef} + initialValues={props.initialValues} + onSuccess={( + data: TBaseModel | JSONObjectOrArray | Array + ) => { + props.onSuccess && props.onSuccess(data); + }} + onError={(error: string) => { + setError(error); + }} + onBeforeCreate={props.onBeforeCreate} + /> + + {props.footer} + ) : ( <> )} diff --git a/CommonUI/src/Components/ModelTable/ModelTable.tsx b/CommonUI/src/Components/ModelTable/ModelTable.tsx index ea64c31917..60e1206cc1 100644 --- a/CommonUI/src/Components/ModelTable/ModelTable.tsx +++ b/CommonUI/src/Components/ModelTable/ModelTable.tsx @@ -340,6 +340,7 @@ const ModelTable: Function = ( }; const fetchItems: Function = async () => { + setError(''); setIsLoading(true); @@ -394,10 +395,6 @@ const ModelTable: Function = ( } }, [showTableFilter]); - useEffect(() => { - fetchItems(); - }, [props.refreshToggle]); - const getSelect: Function = (): Select => { const selectFields: Select = { _id: true, @@ -540,11 +537,7 @@ const ModelTable: Function = ( useEffect(() => { fetchItems(); - }, [currentPageNumber, sortBy, sortOrder, itemsOnPage, query]); - - useEffect(() => { - setHeaderButtons(); - }, [showTableFilter]); + }, [currentPageNumber, sortBy, sortOrder, itemsOnPage, query, props.refreshToggle]); const shouldDisableSort: Function = (columnName: string): boolean => { return model.isEntityColumn(columnName); diff --git a/Dashboard/src/Components/Header/ProjectPicker.tsx b/Dashboard/src/Components/Header/ProjectPicker.tsx index ec94e39753..c3f34dffe8 100644 --- a/Dashboard/src/Components/Header/ProjectPicker.tsx +++ b/Dashboard/src/Components/Header/ProjectPicker.tsx @@ -166,21 +166,6 @@ const DashboardProjectPicker: FunctionComponent = ( ), title: 'Please select a plan.', required: true, - footerElement: ( -
{ - setIsSubscriptionPlanYearly(false); - refreshFields(); - }} - > - {isSubsriptionPlanYearly ? ( - Switch to monthly pricing? - ) : ( - Switch to yearly pricing? - )} -
- ), }, ]; } @@ -230,6 +215,19 @@ const DashboardProjectPicker: FunctionComponent = ( fields: [...fields], formType: FormType.Create, }} + footer={
{ + setIsSubscriptionPlanYearly(!isSubsriptionPlanYearly); + refreshFields(); + }} + > + {isSubsriptionPlanYearly ? ( + Switch to monthly pricing? + ) : ( + Switch to yearly pricing? + )} +
} /> ) : ( <> diff --git a/Dashboard/src/Index.tsx b/Dashboard/src/Index.tsx index bcda0676c1..64fbf65f30 100644 --- a/Dashboard/src/Index.tsx +++ b/Dashboard/src/Index.tsx @@ -9,9 +9,7 @@ const root: any = ReactDOM.createRoot( ); root.render( - - );