@uxland/primary-shell 5.6.2 → 5.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +88 -68
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +11 -15
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/activity-history-filters.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/actions.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/bootstrapper.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/handler.d.ts +6 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/reducer.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/request.d.ts +9 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/reset/actions.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/reset/bootstrapper.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/reset/handler.d.ts +6 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/reset/reducer.d.ts +3 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/reset/request.d.ts +2 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/slice.d.ts +4 -4
- package/package.json +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/active-filters-badges.ts +11 -16
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/activity-history-filters.ts +11 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/template.ts +9 -9
- package/src/internal-plugins/activity-history/activity-history-item/filter/bootstrapper.ts +6 -6
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/actions.ts +3 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/bootstrapper.ts +14 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/handler.ts +13 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/reducer.ts +21 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-all-values/request.ts +9 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-value/reducer.ts +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/reset/actions.ts +3 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/reset/bootstrapper.ts +14 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/reset/handler.ts +14 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/reset/reducer.ts +28 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/reset/request.ts +1 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/slice.ts +4 -4
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/actions.d.ts +0 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/bootstrapper.d.ts +0 -4
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/handler.d.ts +0 -5
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/reducer.d.ts +0 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/request.d.ts +0 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/actions.d.ts +0 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/bootstrapper.d.ts +0 -4
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/handler.d.ts +0 -5
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/reducer.d.ts +0 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/request.d.ts +0 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/actions.ts +0 -3
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/bootstrapper.ts +0 -14
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/handler.ts +0 -12
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/reducer.ts +0 -11
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/reset-common-filter/request.ts +0 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/actions.ts +0 -3
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/bootstrapper.ts +0 -14
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/handler.ts +0 -8
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/reducer.ts +0 -11
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/reset-custom-filter/request.ts +0 -1
|
@@ -19,6 +19,7 @@ export declare class ActivityHistoryFilters extends LitElement {
|
|
|
19
19
|
_onChangeCommonFilterValue(filterId: string, value: boolean): void;
|
|
20
20
|
_onChangeCustomFilterGroupValue(filterGroupId: string, value: boolean): void;
|
|
21
21
|
_onChangeCustomFilterValue(filterGroupId: string, filterId: string, optionId: string, value: boolean): void;
|
|
22
|
+
_onChangeCustomFilterAllValues(filterGroupId: string, filterId: string, values: string[]): void;
|
|
22
23
|
_handleDiagnosticFilterChange(e: CustomEvent): void;
|
|
23
24
|
_handleUpFilterChange(e: CustomEvent): void;
|
|
24
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setCustomFilterAllValues: import('@reduxjs/toolkit').ActionCreatorWithPayload<import('./request').SetCustomFilterAllValuesPayload, "activity-history-filters/setCustomFilterAllValues">;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StoreBaseHandler } from '../../../../infrastructure/base-handlers';
|
|
2
|
+
import { SetCustomFilterAllValues } from './request';
|
|
3
|
+
|
|
4
|
+
export declare class SetCustomFilterAllValuesHandler extends StoreBaseHandler {
|
|
5
|
+
handle(request: SetCustomFilterAllValues): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SetCustomFilterAllValuesPayload {
|
|
2
|
+
filterGroupId: string;
|
|
3
|
+
filterId: string;
|
|
4
|
+
values: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare class SetCustomFilterAllValues {
|
|
7
|
+
payload: SetCustomFilterAllValuesPayload;
|
|
8
|
+
constructor(payload: SetCustomFilterAllValuesPayload);
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resetFilters: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"activity-history-filters/resetFilters">;
|
|
@@ -6,10 +6,10 @@ import { setCustomFilterValueReducer } from './custom-filters/set-custom-filter-
|
|
|
6
6
|
import { IActivityHistoryFilter } from './model';
|
|
7
7
|
import { addDiagnosticFiltersReducer } from './diagnostic-filters/add/reducer';
|
|
8
8
|
import { setDiagnosticFilterValuesReducer } from './diagnostic-filters/set/reducer';
|
|
9
|
-
import { resetCommonFilterValuesReducer } from './common-filters/reset-common-filter/reducer';
|
|
10
|
-
import { resetCustomFilterValuesReducer } from './custom-filters/reset-custom-filter/reducer';
|
|
11
9
|
import { addUpFiltersReducer } from './up-filters/add/reducer';
|
|
12
10
|
import { setUpFilterValuesReducer } from './up-filters/set/reducer';
|
|
11
|
+
import { resetFiltersReducer } from './reset/reducer';
|
|
12
|
+
import { setCustomFilterAllValuesReducer } from './custom-filters/set-custom-filter-all-values/reducer';
|
|
13
13
|
|
|
14
14
|
export declare const activityHistoryFiltersSlice: import('@reduxjs/toolkit').Slice<{
|
|
15
15
|
searchString: string;
|
|
@@ -17,15 +17,15 @@ export declare const activityHistoryFiltersSlice: import('@reduxjs/toolkit').Sli
|
|
|
17
17
|
}, {
|
|
18
18
|
setSearchString: typeof setSearchStringReducer;
|
|
19
19
|
setCommonFilterValue: typeof setCommonFilterValueReducer;
|
|
20
|
-
resetCommonFilterValues: typeof resetCommonFilterValuesReducer;
|
|
21
20
|
addCustomFilters: typeof addCustomFiltersReducer;
|
|
22
21
|
setCustomFilterGroupValue: typeof setCustomFilterGroupValueReducer;
|
|
23
22
|
setCustomFilterValue: typeof setCustomFilterValueReducer;
|
|
24
|
-
|
|
23
|
+
setCustomFilterAllValues: typeof setCustomFilterAllValuesReducer;
|
|
25
24
|
addDiagnosticFilters: typeof addDiagnosticFiltersReducer;
|
|
26
25
|
setDiagnosticFilterValues: typeof setDiagnosticFilterValuesReducer;
|
|
27
26
|
addUpFilters: typeof addUpFiltersReducer;
|
|
28
27
|
setUpFilterValues: typeof setUpFilterValuesReducer;
|
|
28
|
+
resetFilters: typeof resetFiltersReducer;
|
|
29
29
|
}, "activity-history-filters", "activity-history-filters", import('@reduxjs/toolkit').SliceSelectors<{
|
|
30
30
|
searchString: string;
|
|
31
31
|
filters: IActivityHistoryFilter[];
|
package/package.json
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { LitElement, css, html, unsafeCSS } from "lit";
|
|
2
2
|
import { customElement } from "lit/decorators.js";
|
|
3
|
-
import { connectedProperty } from "../../../../infrastructure/state/connected-property";
|
|
4
|
-
import { lazyInject } from "../../../../infrastructure/ioc/container";
|
|
5
3
|
import { PrimariaApi } from "../../../../../../api/api";
|
|
4
|
+
import { lazyInject } from "../../../../infrastructure/ioc/container";
|
|
6
5
|
import { TYPES } from "../../../../infrastructure/ioc/types";
|
|
7
|
-
import {
|
|
6
|
+
import { connectedProperty } from "../../../../infrastructure/state/connected-property";
|
|
8
7
|
import styles from "./styles.css?inline";
|
|
8
|
+
import { template } from "./template";
|
|
9
9
|
|
|
10
|
+
import { customFilterGroupsWithOptionsSelector } from "../../../selectors";
|
|
11
|
+
import { activityHistoryEnabledCommonFiltersSelector } from "../../common-filters/selectors";
|
|
12
|
+
import { SetCommonFilter } from "../../common-filters/set-common-filter/request";
|
|
10
13
|
import { SetCustomFilterValue } from "../../custom-filters/set-custom-filter-value/request";
|
|
14
|
+
import { diagnosticFilterSelector } from "../../diagnostic-filters/selectors";
|
|
15
|
+
import { SetDiagnosticFiltersCommand } from "../../diagnostic-filters/set/request";
|
|
11
16
|
import {
|
|
12
|
-
IActivityHistoryCustomFilter,
|
|
13
17
|
IActivityHistoryCustomFilterGroup,
|
|
14
18
|
IActivityHistoryDiagnosticsFilter,
|
|
15
19
|
IActivityHistoryFilter,
|
|
16
|
-
IActivityHistoryUpFilter
|
|
20
|
+
IActivityHistoryUpFilter
|
|
17
21
|
} from "../../model";
|
|
18
|
-
import {
|
|
19
|
-
import { SetCommonFilter } from "../../common-filters/set-common-filter/request";
|
|
20
|
-
import { diagnosticFilterSelector } from "../../diagnostic-filters/selectors";
|
|
21
|
-
import { SetDiagnosticFiltersCommand } from "../../diagnostic-filters/set/request";
|
|
22
|
-
import { ResetCommonFilter } from "../../common-filters/reset-common-filter/request";
|
|
23
|
-
import { ResetCustomFilter } from "../../custom-filters/reset-custom-filter/request";
|
|
22
|
+
import { ResetFiltersCommand } from "../../reset/request";
|
|
24
23
|
import { upFilterSelector } from "../../up-filters/selectors";
|
|
25
24
|
import { SetUpFiltersCommand } from "../../up-filters/set/request";
|
|
26
|
-
import { customFilterGroupsWithOptionsSelector } from "../../../selectors";
|
|
27
25
|
|
|
28
26
|
//@ts-ignore
|
|
29
27
|
@customElement("active-filters-badges")
|
|
@@ -79,9 +77,6 @@ export class ActiveFiltersBadges extends LitElement {
|
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
resetFilters() {
|
|
82
|
-
this.api.broker.send(new
|
|
83
|
-
this.api.broker.send(new SetUpFiltersCommand([]));
|
|
84
|
-
this.api.broker.send(new ResetCommonFilter());
|
|
85
|
-
this.api.broker.send(new ResetCustomFilter());
|
|
80
|
+
this.api.broker.send(new ResetFiltersCommand())
|
|
86
81
|
}
|
|
87
82
|
}
|
|
@@ -21,6 +21,7 @@ import { diagnosticFilterEnabledValuesSelector, diagnosticFilterSelector } from
|
|
|
21
21
|
import { SetDiagnosticFiltersCommand } from "../../diagnostic-filters/set/request";
|
|
22
22
|
import { upFilterEnabledValuesSelector, upFilterSelector } from "../../up-filters/selectors";
|
|
23
23
|
import { SetUpFiltersCommand } from "../../up-filters/set/request";
|
|
24
|
+
import { SetCustomFilterAllValues } from "../../custom-filters/set-custom-filter-all-values/request";
|
|
24
25
|
|
|
25
26
|
//@ts-ignore
|
|
26
27
|
@customElement("activity-history-filters")
|
|
@@ -89,6 +90,16 @@ export class ActivityHistoryFilters extends LitElement {
|
|
|
89
90
|
);
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
_onChangeCustomFilterAllValues(filterGroupId: string, filterId: string, values: string[]) {
|
|
94
|
+
this.api.broker.send(
|
|
95
|
+
new SetCustomFilterAllValues({
|
|
96
|
+
filterGroupId,
|
|
97
|
+
filterId,
|
|
98
|
+
values: values,
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
92
103
|
_handleDiagnosticFilterChange(e: CustomEvent) {
|
|
93
104
|
const selectedValues = e.detail.selectedValue;
|
|
94
105
|
this.api.broker.send(new SetDiagnosticFiltersCommand(selectedValues));
|
|
@@ -12,22 +12,22 @@ import { translate } from "../../../../localization";
|
|
|
12
12
|
|
|
13
13
|
const filterTemplates = {
|
|
14
14
|
[ActivityHistoryFilterType.Switch]: (id, title, handleChange, isSelected, isEnabled) => html`
|
|
15
|
-
<dss-input-switch size="sm"
|
|
16
|
-
<input slot="input" id="switch-${id}" aria-label=${title} type="checkbox"
|
|
15
|
+
<dss-input-switch size="sm" @onChangeValue=${handleChange} .checked=${isSelected}>
|
|
16
|
+
<input slot="input" id="switch-${id}" aria-label=${title} type="checkbox" ?disabled=${!isEnabled}>
|
|
17
17
|
<label slot="label" for="switch-${id}">${title || id}</label>
|
|
18
18
|
</dss-input-switch>`,
|
|
19
19
|
|
|
20
20
|
[ActivityHistoryFilterType.Checkbox]: (id, title, handleChange, isSelected, isEnabled) => html`
|
|
21
|
-
<dss-checkbox variant="default"
|
|
22
|
-
<input slot="input" id="checkboxStory-${id}" type="checkbox" ?disabled=${!isEnabled}>
|
|
21
|
+
<dss-checkbox variant="default" @onChange=${(e) => handleChange(e)}>
|
|
22
|
+
<input slot="input" id="checkboxStory-${id}" type="checkbox" .checked=${isSelected} ?disabled=${!isEnabled}>
|
|
23
23
|
<label slot="label" for="checkboxStory-${id}">${title || id}</label>
|
|
24
24
|
</dss-checkbox>`,
|
|
25
25
|
|
|
26
|
-
[ActivityHistoryFilterType.Dropdown]: (id, title, handleChange, isSelected, isEnabled) => html`
|
|
27
|
-
<dss-input-dropdown type="default"
|
|
28
|
-
<input slot="input" id="dropdownStory-${id}" type="text" ?disabled=${!isEnabled}>
|
|
26
|
+
/* [ActivityHistoryFilterType.Dropdown]: (id, title, handleChange, isSelected, isEnabled) => html`
|
|
27
|
+
<dss-input-dropdown type="default" @onChange=${(e) => handleChange(e)}>
|
|
28
|
+
<input slot="input" id="dropdownStory-${id}" type="text" .checked=${isSelected} ?disabled=${!isEnabled}>
|
|
29
29
|
<label slot="label" for="dropdownStory-${id}">${title || id}</label>
|
|
30
|
-
</dss-input-dropdown>`,
|
|
30
|
+
</dss-input-dropdown>`, */
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const getFilterTemplate = (
|
|
@@ -118,7 +118,7 @@ const customFilterTemplate = (
|
|
|
118
118
|
type="default"
|
|
119
119
|
.elements=${elements}
|
|
120
120
|
@onInputDropdownChange=${(e) =>
|
|
121
|
-
props.
|
|
121
|
+
props._onChangeCustomFilterAllValues(group.id, filter.id, e.detail.selectedValue)
|
|
122
122
|
}
|
|
123
123
|
.selectedValue=${filter.enabledValues}
|
|
124
124
|
selectorStyle="max-height: 450px"
|
|
@@ -12,22 +12,22 @@ import {
|
|
|
12
12
|
} from "./custom-filters/set-custom-filter-value/bootstrapper";
|
|
13
13
|
import { bootstrapAddDiagnosticFilter, teardownAddDiagnosticFilter } from "./diagnostic-filters/add/bootstrapper";
|
|
14
14
|
import { bootstrapSetDiagnosticFilter, teardownSetDiagnosticFilter } from "./diagnostic-filters/set/bootstrapper";
|
|
15
|
-
import { bootstrapResetCommonFilter, teardownResetCommonFilter } from "./common-filters/reset-common-filter/bootstrapper";
|
|
16
|
-
import { bootstrapResetCustomFilter, teardownResetCustomFilter } from "./custom-filters/reset-custom-filter/bootstrapper";
|
|
17
15
|
import { bootstrapAddUpFilter, teardownAddUpFilter } from "./up-filters/add/bootstrapper";
|
|
18
16
|
import { bootstrapSetUpFilter, teardownSetUpFilter } from "./up-filters/set/bootstrapper";
|
|
17
|
+
import { bootstrapResetFilters, teardownResetFilters } from "./reset/bootstrapper";
|
|
18
|
+
import { bootstrapSetCustomFilterAllValues, teardownSetCustomFilterAllValues } from "./custom-filters/set-custom-filter-all-values/bootstrapper";
|
|
19
19
|
|
|
20
20
|
export const bootstrapFilters = (broker: BrokerExtensions) => {
|
|
21
21
|
bootstrapSetCommonFilter(broker);
|
|
22
22
|
bootstrapAddCustomFilter(broker);
|
|
23
23
|
bootstrapSetCustomFilterGroup(broker);
|
|
24
24
|
bootstrapSetCustomFilterValue(broker);
|
|
25
|
+
bootstrapSetCustomFilterAllValues(broker);
|
|
25
26
|
bootstrapAddDiagnosticFilter(broker);
|
|
26
27
|
bootstrapSetDiagnosticFilter(broker);
|
|
27
|
-
bootstrapResetCommonFilter(broker);
|
|
28
|
-
bootstrapResetCustomFilter(broker);
|
|
29
28
|
bootstrapAddUpFilter(broker);
|
|
30
29
|
bootstrapSetUpFilter(broker);
|
|
30
|
+
bootstrapResetFilters(broker);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const teardownFilters = () => {
|
|
@@ -35,10 +35,10 @@ export const teardownFilters = () => {
|
|
|
35
35
|
teardownAddCustomFilter();
|
|
36
36
|
teardownSetCustomFilterGroup();
|
|
37
37
|
teardownSetCustomFilterValue();
|
|
38
|
+
teardownSetCustomFilterAllValues();
|
|
38
39
|
teardownAddDiagnosticFilter();
|
|
39
40
|
teardownSetDiagnosticFilter();
|
|
40
|
-
teardownResetCommonFilter();
|
|
41
|
-
teardownResetCustomFilter();
|
|
42
41
|
teardownAddUpFilter();
|
|
43
42
|
teardownSetUpFilter();
|
|
43
|
+
teardownResetFilters();
|
|
44
44
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BrokerExtensions } from "@primaria/plugins-core";
|
|
2
|
+
import { BrokerDisposableHandler } from "../../../../../../api/broker/primaria-broker";
|
|
3
|
+
import { SetCustomFilterAllValues } from "./request";
|
|
4
|
+
import { SetCustomFilterAllValuesHandler } from "./handler";
|
|
5
|
+
|
|
6
|
+
let request: BrokerDisposableHandler;
|
|
7
|
+
|
|
8
|
+
export const bootstrapSetCustomFilterAllValues = (broker: BrokerExtensions) => {
|
|
9
|
+
request = broker.registerRequest(SetCustomFilterAllValues, SetCustomFilterAllValuesHandler);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const teardownSetCustomFilterAllValues = () => {
|
|
13
|
+
request?.dispose();
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoreBaseHandler } from "../../../../infrastructure/base-handlers";
|
|
2
|
+
import { setCustomFilterAllValues } from "./actions";
|
|
3
|
+
import { SetCustomFilterAllValues } from "./request";
|
|
4
|
+
|
|
5
|
+
export class SetCustomFilterAllValuesHandler extends StoreBaseHandler {
|
|
6
|
+
async handle(request: SetCustomFilterAllValues) {
|
|
7
|
+
try {
|
|
8
|
+
this.store.dispatch(setCustomFilterAllValues(request.payload));
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.log(e.message);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { SetCustomFilterAllValuesPayload } from "./request";
|
|
3
|
+
|
|
4
|
+
export function setCustomFilterAllValuesReducer(
|
|
5
|
+
state,
|
|
6
|
+
action: PayloadAction<SetCustomFilterAllValuesPayload>,
|
|
7
|
+
) {
|
|
8
|
+
state.filters = state.filters.map((f) => {
|
|
9
|
+
if (f.id === action.payload.filterGroupId) {
|
|
10
|
+
return {
|
|
11
|
+
...f,
|
|
12
|
+
filters: f.filters.map((ff) =>
|
|
13
|
+
ff.id === action.payload.filterId
|
|
14
|
+
? { ...ff, enabledValues: action.payload.values }
|
|
15
|
+
: ff,
|
|
16
|
+
),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return f;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
import { SetCustomFilterValuePayload } from "./request";
|
|
3
|
-
import { IActivityHistoryCustomFilter
|
|
3
|
+
import { IActivityHistoryCustomFilter } from "../../model";
|
|
4
4
|
|
|
5
5
|
export function setCustomFilterValueReducer(
|
|
6
6
|
state,
|
package/src/internal-plugins/activity-history/activity-history-item/filter/reset/bootstrapper.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BrokerExtensions } from "@primaria/plugins-core";
|
|
2
|
+
import { ResetFiltersCommand } from "./request";
|
|
3
|
+
import { ResetFiltersHandler } from "./handler";
|
|
4
|
+
import { BrokerDisposableHandler } from "@uxland/primary-shell";
|
|
5
|
+
|
|
6
|
+
let request: BrokerDisposableHandler;
|
|
7
|
+
|
|
8
|
+
export const bootstrapResetFilters = (broker: BrokerExtensions) => {
|
|
9
|
+
request = broker.registerRequest(ResetFiltersCommand, ResetFiltersHandler);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const teardownResetFilters = () => {
|
|
13
|
+
request?.dispose();
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
import { StoreBaseHandler } from "../../../infrastructure/base-handlers";
|
|
3
|
+
import { resetFilters } from "./actions";
|
|
4
|
+
import { ResetFiltersCommand } from "./request";
|
|
5
|
+
|
|
6
|
+
export class ResetFiltersHandler extends StoreBaseHandler {
|
|
7
|
+
async handle(request: ResetFiltersCommand) {
|
|
8
|
+
try {
|
|
9
|
+
this.store.dispatch(resetFilters());
|
|
10
|
+
} catch (e) {
|
|
11
|
+
console.log(e.message);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { commonFilters } from "../common-filters/common-filters";
|
|
3
|
+
|
|
4
|
+
export function resetFiltersReducer(state, action: PayloadAction<void>) {
|
|
5
|
+
state.filters = state.filters.map((f) => {
|
|
6
|
+
if (f.id !== "common" && f.id !== "history-diagnostics" && f.id !== "history-up") {
|
|
7
|
+
return {
|
|
8
|
+
...f,
|
|
9
|
+
filters: f.filters.map((ff) => {
|
|
10
|
+
if(ff.singleOption)
|
|
11
|
+
return {...ff, enabled: false}
|
|
12
|
+
return {...ff, enabled: true, enabledValues: []}
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if(f.id === "history-diagnostics" || f.id === "history-up") {
|
|
18
|
+
return {
|
|
19
|
+
...f,
|
|
20
|
+
enabledValues: [],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if(f.id === "common") {
|
|
24
|
+
return commonFilters[0]
|
|
25
|
+
}
|
|
26
|
+
return f;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class ResetFiltersCommand {}
|
|
@@ -8,10 +8,10 @@ import { setCustomFilterValueReducer } from "./custom-filters/set-custom-filter-
|
|
|
8
8
|
import { IActivityHistoryFilter } from "./model";
|
|
9
9
|
import { addDiagnosticFiltersReducer } from "./diagnostic-filters/add/reducer";
|
|
10
10
|
import { setDiagnosticFilterValuesReducer } from "./diagnostic-filters/set/reducer";
|
|
11
|
-
import { resetCommonFilterValuesReducer } from "./common-filters/reset-common-filter/reducer";
|
|
12
|
-
import { resetCustomFilterValuesReducer } from "./custom-filters/reset-custom-filter/reducer";
|
|
13
11
|
import { addUpFiltersReducer } from "./up-filters/add/reducer";
|
|
14
12
|
import { setUpFilterValuesReducer } from "./up-filters/set/reducer";
|
|
13
|
+
import { resetFiltersReducer } from "./reset/reducer";
|
|
14
|
+
import { setCustomFilterAllValuesReducer } from "./custom-filters/set-custom-filter-all-values/reducer";
|
|
15
15
|
|
|
16
16
|
export const activityHistoryFiltersSlice = createSlice({
|
|
17
17
|
name: "activity-history-filters",
|
|
@@ -22,14 +22,14 @@ export const activityHistoryFiltersSlice = createSlice({
|
|
|
22
22
|
reducers: {
|
|
23
23
|
setSearchString: setSearchStringReducer,
|
|
24
24
|
setCommonFilterValue: setCommonFilterValueReducer,
|
|
25
|
-
resetCommonFilterValues: resetCommonFilterValuesReducer,
|
|
26
25
|
addCustomFilters: addCustomFiltersReducer,
|
|
27
26
|
setCustomFilterGroupValue: setCustomFilterGroupValueReducer,
|
|
28
27
|
setCustomFilterValue: setCustomFilterValueReducer,
|
|
29
|
-
|
|
28
|
+
setCustomFilterAllValues: setCustomFilterAllValuesReducer,
|
|
30
29
|
addDiagnosticFilters: addDiagnosticFiltersReducer,
|
|
31
30
|
setDiagnosticFilterValues: setDiagnosticFilterValuesReducer,
|
|
32
31
|
addUpFilters: addUpFiltersReducer,
|
|
33
32
|
setUpFilterValues: setUpFilterValuesReducer,
|
|
33
|
+
resetFilters: resetFiltersReducer
|
|
34
34
|
},
|
|
35
35
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const resetCommonFilterValues: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"activity-history-filters/resetCommonFilterValues">;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function resetCommonFilterValuesReducer(state: any): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const resetCustomFilterValues: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"activity-history-filters/resetCustomFilterValues">;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function resetCustomFilterValuesReducer(state: any): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BrokerExtensions } from "@primaria/plugins-core";
|
|
2
|
-
import { BrokerDisposableHandler } from "../../../../../../api/broker/primaria-broker";
|
|
3
|
-
import { ResetCommonFilter } from "./request";
|
|
4
|
-
import { ResetCommonFilterHandler } from "./handler";
|
|
5
|
-
|
|
6
|
-
let request: BrokerDisposableHandler;
|
|
7
|
-
|
|
8
|
-
export const bootstrapResetCommonFilter = (broker: BrokerExtensions) => {
|
|
9
|
-
request = broker.registerRequest(ResetCommonFilter, ResetCommonFilterHandler);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const teardownResetCommonFilter = () => {
|
|
13
|
-
request?.dispose();
|
|
14
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { StoreBaseHandler } from "../../../../infrastructure/base-handlers";
|
|
2
|
-
import { resetCommonFilterValues } from "./actions";
|
|
3
|
-
|
|
4
|
-
export class ResetCommonFilterHandler extends StoreBaseHandler {
|
|
5
|
-
async handle() {
|
|
6
|
-
try {
|
|
7
|
-
this.store.dispatch(resetCommonFilterValues());
|
|
8
|
-
} catch (e) {
|
|
9
|
-
console.log(e.message);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class ResetCommonFilter {}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BrokerExtensions } from "@primaria/plugins-core";
|
|
2
|
-
import { BrokerDisposableHandler } from "../../../../../../api/broker/primaria-broker";
|
|
3
|
-
import { ResetCustomFilter } from "./request";
|
|
4
|
-
import { ResetCustomFilterHandler } from "./handler";
|
|
5
|
-
|
|
6
|
-
let request: BrokerDisposableHandler;
|
|
7
|
-
|
|
8
|
-
export const bootstrapResetCustomFilter = (broker: BrokerExtensions) => {
|
|
9
|
-
request = broker.registerRequest(ResetCustomFilter, ResetCustomFilterHandler);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const teardownResetCustomFilter = () => {
|
|
13
|
-
request?.dispose();
|
|
14
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { StoreBaseHandler } from "../../../../infrastructure/base-handlers";
|
|
2
|
-
import { resetCustomFilterValues } from "./actions";
|
|
3
|
-
|
|
4
|
-
export class ResetCustomFilterHandler extends StoreBaseHandler {
|
|
5
|
-
async handle() {
|
|
6
|
-
await this.store.dispatch(resetCustomFilterValues());
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function resetCustomFilterValuesReducer(state) {
|
|
2
|
-
state.filters = state.filters.map((f) => {
|
|
3
|
-
if (f.id !== "common" && f.id !== "history-diagnostics" && f.id !== "history-up") {
|
|
4
|
-
return {
|
|
5
|
-
...f,
|
|
6
|
-
filters: f.filters.map((ff) => ({ ...ff, enabled: false, enabledValues: [] })),
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
return f;
|
|
10
|
-
});
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class ResetCustomFilter {}
|