diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 9f26e3e04e..dcd6332957 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -2,6 +2,7 @@ * [Get Started](get_started.md) * [Configuration](configuration/configuration.md) * [Tree case view](views/tree_case_view.md) +* [Default tabbed case view](views/default-tabbed-case-view.md) * Compodoc * [Components](https://components.netgrif.com/compodoc/components) * Typedoc diff --git a/docs/views/default-tabbed-case-view.md b/docs/views/default-tabbed-case-view.md new file mode 100644 index 0000000000..81b17cf6cb --- /dev/null +++ b/docs/views/default-tabbed-case-view.md @@ -0,0 +1,6 @@ +# Default Tabbed Case View +Default Tabbed Case View is used by the menu items. Case View shows cases by injected filter from process preference_item stored in database. + +## Configuration +**showCreateCaseButton** (boolean) field that decide whether to show the create case button. +The value comes from the preference_item case instance and is in the field with id *"show_create_case_button"*. diff --git a/projects/netgrif-components-core/src/lib/navigation/model/group-navigation-constants.ts b/projects/netgrif-components-core/src/lib/navigation/model/group-navigation-constants.ts index 0951504f31..c3264b8b0e 100644 --- a/projects/netgrif-components-core/src/lib/navigation/model/group-navigation-constants.ts +++ b/projects/netgrif-components-core/src/lib/navigation/model/group-navigation-constants.ts @@ -35,6 +35,11 @@ export enum GroupNavigationConstants { * */ ITEM_FIELD_ID_CREATE_CASE_BUTTON_ICON = 'create_case_button_icon', + /** + * Boolean field, that is true if the create case button is shown in case view + * */ + ITEM_FIELD_ID_SHOW_CREATE_CASE_BUTTON = "show_create_case_button", + /** * EnumerationMap field, that contains selected search type for case view * */ diff --git a/projects/netgrif-components-core/src/lib/side-menu/content-components/new-case/model/new-case-injection-data.ts b/projects/netgrif-components-core/src/lib/side-menu/content-components/new-case/model/new-case-injection-data.ts index c2f046671d..017ce6efa0 100644 --- a/projects/netgrif-components-core/src/lib/side-menu/content-components/new-case/model/new-case-injection-data.ts +++ b/projects/netgrif-components-core/src/lib/side-menu/content-components/new-case/model/new-case-injection-data.ts @@ -30,4 +30,6 @@ export interface NewCaseButtonConfiguration { createCaseButtonIcon?: string; + showCreateCaseButton?: boolean; + } diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts index e4ec4b90ef..0bbb46bf6a 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.spec.ts @@ -135,6 +135,10 @@ describe('DefaultTabViewComponent', () => { GroupNavigationConstants.ITEM_FIELD_ID_ADDITIONAL_FILTER_TASKREF, '',[],{visible: true} ), + new BooleanField( + GroupNavigationConstants.ITEM_FIELD_ID_SHOW_CREATE_CASE_BUTTON, + '',true,{visible: true} + ), ] }, { diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts index 450ccb1a64..cd204dd9e4 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.ts @@ -61,12 +61,14 @@ export class DefaultTabViewComponent { const createCaseButtonTitle: string = extractFieldValueFromData(this._navigationItemTaskData, GroupNavigationConstants.ITEM_FIELD_ID_CREATE_CASE_BUTTON_TITLE); const createCaseButtonIcon: string = extractFieldValueFromData(this._navigationItemTaskData, GroupNavigationConstants.ITEM_FIELD_ID_CREATE_CASE_BUTTON_ICON); const requireTitle: boolean = extractFieldValueFromData(this._navigationItemTaskData, GroupNavigationConstants.ITEM_FIELD_ID_CASE_TITLE_IN_CREATION); + const showCreateCaseButton: boolean = extractFieldValueFromData(this._navigationItemTaskData, GroupNavigationConstants.ITEM_FIELD_ID_SHOW_CREATE_CASE_BUTTON); const newCaseButtonConfig: NewCaseCreationConfigurationData = { enableCaseTitle: requireTitle, isCaseTitleRequired: requireTitle, newCaseButtonConfig: { createCaseButtonTitle, - createCaseButtonIcon + createCaseButtonIcon, + showCreateCaseButton: showCreateCaseButton, }, blockNets: blockNets }; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.html b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.html index 259595c6f8..e38f3e0137 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.html +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.html @@ -7,7 +7,7 @@ -
+
diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts index 5ed099d96d..ee536cf95e 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.ts @@ -78,6 +78,7 @@ export class DefaultTabbedCaseViewComponent extends AbstractTabbedCaseViewCompon initialSearchMode: SearchMode; showToggleButton: boolean; enableSearch: boolean; + showCreateCaseButton: boolean; showDeleteMenu: boolean; headersChangeable: boolean; headersMode: string[]; @@ -94,6 +95,7 @@ export class DefaultTabbedCaseViewComponent extends AbstractTabbedCaseViewCompon this.initialSearchMode = _injectedTabData.caseViewSearchTypeConfiguration.initialSearchMode; this.showToggleButton = _injectedTabData.caseViewSearchTypeConfiguration.showSearchToggleButton; this.enableSearch = _injectedTabData.caseViewSearchTypeConfiguration.initialSearchMode !== undefined; + this.showCreateCaseButton = _injectedTabData.newCaseButtonConfiguration?.newCaseButtonConfig?.showCreateCaseButton; this.showDeleteMenu = _injectedTabData.caseViewShowMoreMenu; this.headersChangeable = _injectedTabData.caseViewHeadersChangeable; this.headersMode = _injectedTabData.caseViewHeadersMode ? _injectedTabData.caseViewHeadersMode : [];