@dative-gpi/foundation-core-services 0.0.229 → 0.1.68
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/composables/app/index.ts +2 -1
- package/composables/app/useEntityId.ts +19 -0
- package/composables/index.ts +2 -1
- package/composables/services/index.ts +1 -1
- package/composables/services/useActions.ts +3 -4
- package/composables/services/useAlerts.ts +1 -1
- package/composables/services/useArticles.ts +4 -5
- package/composables/services/useChartCategories.ts +1 -2
- package/composables/services/useChartOrganisationTypes.ts +10 -12
- package/composables/services/useChartOrganisations.ts +10 -12
- package/composables/services/useCharts.ts +1 -3
- package/composables/services/useComments.ts +2 -3
- package/composables/services/useConnectivityAlerts.ts +33 -34
- package/composables/services/useConnectivityScenarios.ts +1 -2
- package/composables/services/useCustomProperties.ts +3 -4
- package/composables/services/useCustomPropertyValues.ts +3 -3
- package/composables/services/useDashboardOrganisationTypes.ts +25 -28
- package/composables/services/useDashboardOrganisations.ts +20 -22
- package/composables/services/useDashboardShallows.ts +15 -17
- package/composables/services/useDashboards.ts +2 -4
- package/composables/services/useDataCategories.ts +4 -5
- package/composables/services/useDataDefinitions.ts +4 -5
- package/composables/services/useDataTables.ts +10 -6
- package/composables/services/useDeviceConnectivities.ts +15 -16
- package/composables/services/useDeviceOrganisations.ts +23 -26
- package/composables/services/useDeviceStatuses.ts +14 -15
- package/composables/services/useFolders.ts +10 -13
- package/composables/services/useGroups.ts +1 -2
- package/composables/services/useLocations.ts +1 -1
- package/composables/services/useManufacturers.ts +4 -5
- package/composables/services/useModels.ts +3 -3
- package/composables/services/useOrganisationTypes.ts +4 -5
- package/composables/services/useOrganisations.ts +9 -10
- package/composables/services/usePermissionCategories.ts +3 -4
- package/composables/services/useRoleOrganisationTypes.ts +4 -5
- package/composables/services/useRoleOrganisations.ts +1 -2
- package/composables/services/useScenarioDeviceOrganisations.ts +9 -3
- package/composables/services/useScenarioOrganisationTypes.ts +21 -22
- package/composables/services/useScenarioOrganisations.ts +11 -13
- package/composables/services/useServiceAccountOrganisationAuthTokens.ts +8 -13
- package/composables/services/useServiceAccountOrganisations.ts +2 -3
- package/composables/services/useServiceAccountRoleOrganisations.ts +13 -0
- package/composables/services/useUserOrganisationTables.ts +4 -6
- package/composables/services/useUserOrganisations.ts +25 -25
- package/composables/services/useWidgetTemplates.ts +4 -5
- package/composables/useRouteOrganisation.ts +24 -0
- package/config/literals/index.ts +1 -3
- package/config/urls/index.ts +1 -1
- package/config/urls/serviceAccountOrganisationAuthTokens.ts +3 -4
- package/config/urls/serviceAccountRoleOrganisations.ts +4 -0
- package/package.json +3 -3
- package/composables/services/useNotifications.ts +0 -48
- package/config/literals/hubs.ts +0 -16
- package/config/urls/notifications.ts +0 -6
package/composables/app/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./useAppOrganisationId";
|
|
1
|
+
export * from "./useAppOrganisationId";
|
|
2
|
+
export * from "./useEntityId";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
import { useRouter } from "vue-router";
|
|
3
|
+
|
|
4
|
+
import { ENTITY_ID } from "../../config";
|
|
5
|
+
|
|
6
|
+
export const useEntityId = () => {
|
|
7
|
+
const entityId = ref<string | null>(null);
|
|
8
|
+
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
|
|
11
|
+
watch(router.currentRoute, () => {
|
|
12
|
+
const id = router.currentRoute.value.params[ENTITY_ID] as string | null;
|
|
13
|
+
if(id) {
|
|
14
|
+
entityId.value = id;
|
|
15
|
+
}
|
|
16
|
+
}, { immediate: true })
|
|
17
|
+
|
|
18
|
+
return { entityId }
|
|
19
|
+
}
|
package/composables/index.ts
CHANGED
|
@@ -25,7 +25,6 @@ export * from "./useGroups";
|
|
|
25
25
|
export * from "./useLocations";
|
|
26
26
|
export * from "./useManufacturers";
|
|
27
27
|
export * from "./useModels";
|
|
28
|
-
export * from "./useNotifications";
|
|
29
28
|
export * from "./useOrganisations";
|
|
30
29
|
export * from "./useOrganisationTypes";
|
|
31
30
|
export * from "./usePermissionCategories";
|
|
@@ -36,6 +35,7 @@ export * from "./useScenarioOrganisations";
|
|
|
36
35
|
export * from "./useScenarioOrganisationTypes";
|
|
37
36
|
export * from "./useServiceAccountOrganisationAuthTokens";
|
|
38
37
|
export * from "./useServiceAccountOrganisations";
|
|
38
|
+
export * from "./useServiceAccountRoleOrganisations";
|
|
39
39
|
export * from "./useUserOrganisations";
|
|
40
40
|
export * from "./useUserOrganisationTables";
|
|
41
41
|
export * from "./useWidgetTemplates";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { ActionDetails, ActionInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ActionDetails, type ActionDetailsDTO, type ActionFilters, ActionInfos, type ActionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
4
3
|
|
|
5
4
|
import { ACTIONS_URL } from "../../config/urls";
|
|
6
5
|
|
|
7
6
|
const ActionServiceFactory = new ServiceFactory<ActionDetailsDTO, ActionDetails>("action", ActionDetails).create(factory => factory.build(
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
factory.addGetMany<ActionInfosDTO, ActionInfos, ActionFilters>(ACTIONS_URL, ActionInfos),
|
|
8
|
+
factory.addNotify()
|
|
10
9
|
));
|
|
11
10
|
|
|
12
11
|
export const useActions = ComposableFactory.getMany(ActionServiceFactory);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AlertDetails, type AlertDetailsDTO, type AlertFilters, AlertInfos, type AlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
2
|
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
3
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
|
+
import { HUBS } from "@dative-gpi/foundation-shared-services/config";
|
|
4
5
|
|
|
5
6
|
import { ALERTS_HUB_URL, ALERTS_URL, ALERT_URL } from "../../config/urls";
|
|
6
|
-
import { HUBS } from "../../config/literals";
|
|
7
7
|
|
|
8
8
|
const AlertServiceFactory = new ServiceFactory<AlertDetailsDTO, AlertDetails>("alert", AlertDetails).create(factory => factory.build(
|
|
9
9
|
factory.addGet(ALERT_URL),
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { ArticleDetails, ArticleInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ArticleDetails, type ArticleDetailsDTO, type ArticleFilters, ArticleInfos, type ArticleInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { ARTICLES_URL, ARTICLE_URL } from "../../config/urls";
|
|
6
5
|
|
|
7
6
|
const ArticleServiceFactory = new ServiceFactory<ArticleDetailsDTO, ArticleDetails>("article", ArticleDetails).create(factory => factory.build(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
factory.addGet(ARTICLE_URL),
|
|
8
|
+
factory.addGetMany<ArticleInfosDTO, ArticleInfos, ArticleFilters>(ARTICLES_URL, ArticleInfos),
|
|
9
|
+
factory.addNotify()
|
|
11
10
|
));
|
|
12
11
|
|
|
13
12
|
export const useArticle = ComposableFactory.get(ArticleServiceFactory);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ChartCategoryDetails, ChartCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ChartCategoryDetails, type ChartCategoryDetailsDTO, type ChartCategoryFilters, ChartCategoryInfos, type ChartCategoryInfosDTO, type CreateChartCategoryDTO, type UpdateChartCategoryDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { CHART_CATEGORIES_URL, CHART_CATEGORY_URL } from "../../config/urls";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { ChartOrganisationTypeDetails, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ChartOrganisationTypeDetails, type ChartOrganisationTypeDetailsDTO, type ChartOrganisationTypeFilters, ChartOrganisationTypeInfos, type ChartOrganisationTypeInfosDTO, type CreateChartOrganisationTypeDTO, type UpdateChartOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { CHART_ORGANISATION_TYPE_URL, CHART_ORGANISATION_TYPES_URL } from "../../config/urls";
|
|
@@ -7,16 +6,15 @@ import { CHART_ORGANISATION_TYPE_URL, CHART_ORGANISATION_TYPES_URL } from "../..
|
|
|
7
6
|
const ChartOrganisationTypeServiceFactory = new ServiceFactory<ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeDetails>("chartOrganisationType", ChartOrganisationTypeDetails)
|
|
8
7
|
.createComplete<ChartOrganisationTypeInfos, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO, ChartOrganisationTypeFilters>(CHART_ORGANISATION_TYPES_URL, CHART_ORGANISATION_TYPE_URL, ChartOrganisationTypeInfos);
|
|
9
8
|
|
|
10
|
-
const ChartOrganisationTypeServiceFactoryIncomplete = new ServiceFactory("chartOrganisationType", ChartOrganisationTypeDetails)
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
));
|
|
9
|
+
const ChartOrganisationTypeServiceFactoryIncomplete = new ServiceFactory("chartOrganisationType", ChartOrganisationTypeDetails).create(factory => factory.build(
|
|
10
|
+
factory.addNotify(notifyService => ({
|
|
11
|
+
...ServiceFactory.addCustom("duplicate", (axios, charOrganisationTypeId: string) => axios.patch(CHART_ORGANISATION_TYPE_URL(charOrganisationTypeId)), (dto: ChartOrganisationTypeDetailsDTO) => {
|
|
12
|
+
const result = new ChartOrganisationTypeDetails(dto);
|
|
13
|
+
notifyService.notify("update", result);
|
|
14
|
+
return result;
|
|
15
|
+
})
|
|
16
|
+
}))
|
|
17
|
+
));
|
|
20
18
|
|
|
21
19
|
export const useChartOrganisationType = ComposableFactory.get(ChartOrganisationTypeServiceFactory);
|
|
22
20
|
export const useChartOrganisationTypes = ComposableFactory.getMany(ChartOrganisationTypeServiceFactory);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { ChartOrganisationDetails, ChartOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ChartOrganisationDetails, type ChartOrganisationDetailsDTO, type ChartOrganisationFilters, ChartOrganisationInfos, type ChartOrganisationInfosDTO, type CreateChartOrganisationDTO, type UpdateChartOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { CHART_ORGANISATION_URL, CHART_ORGANISATIONS_URL } from "../../config/urls";
|
|
@@ -7,16 +6,15 @@ import { CHART_ORGANISATION_URL, CHART_ORGANISATIONS_URL } from "../../config/ur
|
|
|
7
6
|
const ChartOrganisationServiceFactory = new ServiceFactory<ChartOrganisationDetailsDTO, ChartOrganisationDetails>("chartOrganisation", ChartOrganisationDetails)
|
|
8
7
|
.createComplete<ChartOrganisationInfos, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO, ChartOrganisationFilters>(CHART_ORGANISATIONS_URL, CHART_ORGANISATION_URL, ChartOrganisationInfos);
|
|
9
8
|
|
|
10
|
-
const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisation", ChartOrganisationDetails)
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
));
|
|
9
|
+
const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisation", ChartOrganisationDetails).create(factory => factory.build(
|
|
10
|
+
factory.addNotify(notifyService => ({
|
|
11
|
+
...ServiceFactory.addCustom("duplicate", (axios, chartOrganisationId: string) => axios.patch(CHART_ORGANISATION_URL(chartOrganisationId)), (dto: ChartOrganisationDetailsDTO) => {
|
|
12
|
+
const result = new ChartOrganisationDetails(dto);
|
|
13
|
+
notifyService.notify("update", result);
|
|
14
|
+
return result;
|
|
15
|
+
})
|
|
16
|
+
}))
|
|
17
|
+
));
|
|
20
18
|
|
|
21
19
|
export const useChartOrganisation = ComposableFactory.get(ChartOrganisationServiceFactory);
|
|
22
20
|
export const useChartOrganisations = ComposableFactory.getMany(ChartOrganisationServiceFactory);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
-
import { ChartDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ChartDetails, type ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
5
3
|
|
|
6
4
|
import { CHART_URL } from "../../config/urls";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CommentDetails, CommentInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { CommentDetails, type CommentDetailsDTO, type CommentFilters, CommentInfos, type CommentInfosDTO, type CreateCommentDTO, type UpdateCommentDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { COMMENTS_URL, COMMENT_URL } from "../../config/urls";
|
|
6
5
|
|
|
7
6
|
const CommentServiceFactory = new ServiceFactory<CommentDetailsDTO, CommentDetails>("comment", CommentDetails)
|
|
8
|
-
|
|
7
|
+
.createComplete<CommentInfos, CommentInfosDTO, CreateCommentDTO, UpdateCommentDTO, CommentFilters>(COMMENTS_URL, COMMENT_URL, CommentInfos);
|
|
9
8
|
|
|
10
9
|
export const useComment = ComposableFactory.get(CommentServiceFactory);
|
|
11
10
|
export const useComments = ComposableFactory.getMany(CommentServiceFactory);
|
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ConnectivityAlertDetailsDTO, ConnectivityAlertFilters, ConnectivityAlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
-
import { ConnectivityAlertDetails, ConnectivityAlertInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ConnectivityAlertDetails, type ConnectivityAlertDetailsDTO, type ConnectivityAlertFilters, ConnectivityAlertInfos, type ConnectivityAlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
2
|
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
3
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
|
+
import { HUBS } from "@dative-gpi/foundation-shared-services/config";
|
|
5
5
|
|
|
6
6
|
import { CONNECTIVITY_ALERTS_HUB_URL, CONNECTIVITY_ALERTS_URL, CONNECTIVITY_ALERT_URL } from "../../config/urls";
|
|
7
|
-
import { HUBS } from "../../config/literals";
|
|
8
7
|
|
|
9
8
|
const ConnectivityAlertServiceFactory = new ServiceFactory<ConnectivityAlertDetailsDTO, ConnectivityAlertDetails>("connectivityAlert", ConnectivityAlertDetails).create(factory => factory.build(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
factory.addGet(CONNECTIVITY_ALERT_URL),
|
|
10
|
+
factory.addGetMany<ConnectivityAlertInfosDTO, ConnectivityAlertInfos, ConnectivityAlertFilters>(CONNECTIVITY_ALERTS_URL, ConnectivityAlertInfos),
|
|
11
|
+
factory.addRemove(CONNECTIVITY_ALERT_URL),
|
|
12
|
+
factory.addNotify(notify => ({
|
|
13
|
+
notifyCreate: (connectivityAlert: ConnectivityAlertDetails) => notify.notify("add", connectivityAlert),
|
|
14
|
+
notifyUpdate: (connectivityAlert: ConnectivityAlertDetails) => notify.notify("update", connectivityAlert),
|
|
15
|
+
notifyRemove: (connectivityAlertId: string) => notify.notify("delete", connectivityAlertId),
|
|
16
|
+
}))
|
|
18
17
|
));
|
|
19
18
|
|
|
20
19
|
const useConnectivityAlertsHub = HubFactory.create(CONNECTIVITY_ALERTS_HUB_URL,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
(connection, { isWatched, hasWatchers }) => {
|
|
21
|
+
connection.on(HUBS.CREATE_CONNECTIVITY_ALERT, (connectivityAlertId: string) => hasWatchers()
|
|
22
|
+
? ConnectivityAlertServiceFactory.get(connectivityAlertId).then(ConnectivityAlertServiceFactory.notifyCreate)
|
|
23
|
+
: null);
|
|
24
|
+
connection.on(HUBS.UPDATE_CONNECTIVITY_ALERT, (connectivityAlertId: string) => isWatched(connectivityAlertId) || hasWatchers()
|
|
25
|
+
? ConnectivityAlertServiceFactory.get(connectivityAlertId).then(ConnectivityAlertServiceFactory.notifyCreate)
|
|
26
|
+
: null);
|
|
27
|
+
connection.on(HUBS.REMOVE_CONNECTIVITY_ALERT, (connectivityAlertId: string) => hasWatchers()
|
|
28
|
+
? ConnectivityAlertServiceFactory.notifyRemove(connectivityAlertId)
|
|
29
|
+
: null);
|
|
30
|
+
},
|
|
31
|
+
async (connection) => {
|
|
32
|
+
await connection.invoke(HUBS.SUBSCRIBE);
|
|
33
|
+
}
|
|
35
34
|
);
|
|
36
35
|
|
|
37
36
|
const useWatchConnectivityAlerts = HubFactory.createWatcher(useConnectivityAlertsHub);
|
|
38
37
|
|
|
39
38
|
export const useConnectivityAlert = ComposableFactory.get(ConnectivityAlertServiceFactory, () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const { watchOne } = useWatchConnectivityAlerts();
|
|
40
|
+
return (connectivityAlert) => {
|
|
41
|
+
watchOne(connectivityAlert.value.id)
|
|
42
|
+
}
|
|
44
43
|
});
|
|
45
44
|
|
|
46
45
|
export const useConnectivityAlerts = ComposableFactory.getMany(ConnectivityAlertServiceFactory, () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const { watchMany } = useWatchConnectivityAlerts();
|
|
47
|
+
return () => {
|
|
48
|
+
watchMany();
|
|
49
|
+
}
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
export const useRemoveConnectivityAlert = ComposableFactory.remove(ConnectivityAlertServiceFactory);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { ConnectivityScenarioDetails, type ConnectivityScenarioDetailsDTO, type ConnectivityScenarioFilters, ConnectivityScenarioInfos, type ConnectivityScenarioInfosDTO, type CreateConnectivityScenarioDTO, type UpdateConnectivityScenarioDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
1
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import type { CreateConnectivityScenarioDTO, ConnectivityScenarioDetailsDTO, ConnectivityScenarioFilters, ConnectivityScenarioInfosDTO, UpdateConnectivityScenarioDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
-
import { ConnectivityScenarioDetails, ConnectivityScenarioInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
3
|
|
|
5
4
|
import { CONNECTIVITY_SCENARIOS_URL, CONNECTIVITY_SCENARIO_URL } from "../../config";
|
|
6
5
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { CustomPropertyDetails, CustomPropertyInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { CustomPropertyDetails, type CustomPropertyDetailsDTO, type CustomPropertyFilters, CustomPropertyInfos, type CustomPropertyInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { CUSTOM_PROPERTIES_URL } from "../../config/urls";
|
|
6
5
|
|
|
7
6
|
const CustomPropertyServiceFactory = new ServiceFactory<CustomPropertyDetailsDTO, CustomPropertyDetails>("customProperty", CustomPropertyDetails).create(factory => factory.build(
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
factory.addGetMany<CustomPropertyInfosDTO, CustomPropertyInfos, CustomPropertyFilters>(CUSTOM_PROPERTIES_URL, CustomPropertyInfos),
|
|
8
|
+
factory.addNotify()
|
|
10
9
|
));
|
|
11
10
|
|
|
12
11
|
export const useCustomProperties = ComposableFactory.getMany(CustomPropertyServiceFactory);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { CustomPropertyValueInfos, type CustomPropertyValueInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { type PropertyEntity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
3
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
4
|
|
|
5
5
|
import { CUSTOM_PROPERTY_VALUES_URL } from "../../config/urls";
|
|
6
6
|
|
|
7
7
|
const CustomPropertyValueServiceFactory = {
|
|
8
|
-
|
|
8
|
+
...ServiceFactory.addCustom("getMany", (axios, entity: PropertyEntity, entityId: string, code: string) => axios.get(CUSTOM_PROPERTY_VALUES_URL(entity, entityId, code)), (dtos: CustomPropertyValueInfosDTO[]) => dtos.map((dto: CustomPropertyValueInfosDTO) => new CustomPropertyValueInfos(dto))),
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const useCustomPropertyValues = ComposableFactory.custom(CustomPropertyValueServiceFactory.getMany);
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { DashboardOrganisationTypeDetails, DashboardOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { DashboardOrganisationTypeDetails, type DashboardOrganisationTypeDetailsDTO, type DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfos, type DashboardOrganisationTypeInfosDTO, type LockDashboardOrganisationTypeDTO, type PublishDashboardOrganisationTypeDTO, type UpdateDashboardOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { DASHBOARD_ORGANISATION_TYPE_LOCK_URL, DASHBOARD_ORGANISATION_TYPE_URL, DASHBOARD_ORGANISATION_TYPES_URL } from "../../config";
|
|
6
5
|
|
|
7
|
-
const DashboardOrganisationTypeServiceFactory = new ServiceFactory<DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeDetails>("dashboardOrganisationType", DashboardOrganisationTypeDetails)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
));
|
|
6
|
+
const DashboardOrganisationTypeServiceFactory = new ServiceFactory<DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeDetails>("dashboardOrganisationType", DashboardOrganisationTypeDetails).create(factory => factory.build(
|
|
7
|
+
factory.addGet(DASHBOARD_ORGANISATION_TYPE_URL),
|
|
8
|
+
factory.addGetMany<DashboardOrganisationTypeInfosDTO, DashboardOrganisationTypeInfos, DashboardOrganisationTypeFilters>(DASHBOARD_ORGANISATION_TYPES_URL, DashboardOrganisationTypeInfos),
|
|
9
|
+
factory.addUpdate<UpdateDashboardOrganisationTypeDTO>(DASHBOARD_ORGANISATION_TYPE_URL),
|
|
10
|
+
factory.addRemove(DASHBOARD_ORGANISATION_TYPE_URL),
|
|
11
|
+
factory.addNotify(notifyService => ({
|
|
12
|
+
...ServiceFactory.addCustom("publish", (axios, payload: PublishDashboardOrganisationTypeDTO) => axios.post(DASHBOARD_ORGANISATION_TYPES_URL(), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
|
|
13
|
+
const result = new DashboardOrganisationTypeDetails(dto);
|
|
14
|
+
notifyService.notify("update", result);
|
|
15
|
+
return result;
|
|
16
|
+
}),
|
|
17
|
+
...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationTypeId: string) => axios.patch(DASHBOARD_ORGANISATION_TYPE_URL(dashboardOrganisationTypeId)), (dto: DashboardOrganisationTypeDetailsDTO) => {
|
|
18
|
+
const result = new DashboardOrganisationTypeDetails(dto);
|
|
19
|
+
notifyService.notify("update", result);
|
|
20
|
+
return result;
|
|
21
|
+
}),
|
|
22
|
+
...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationTypeId: string, payload: LockDashboardOrganisationTypeDTO) => axios.put(DASHBOARD_ORGANISATION_TYPE_LOCK_URL(dashboardOrganisationTypeId), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
|
|
23
|
+
const result = new DashboardOrganisationTypeDetails(dto);
|
|
24
|
+
notifyService.notify("update", result);
|
|
25
|
+
return result;
|
|
26
|
+
})
|
|
27
|
+
}))
|
|
28
|
+
));
|
|
31
29
|
|
|
32
30
|
export const useDashboardOrganisationType = ComposableFactory.get(DashboardOrganisationTypeServiceFactory);
|
|
33
31
|
export const useDashboardOrganisationTypes = ComposableFactory.getMany(DashboardOrganisationTypeServiceFactory);
|
|
@@ -35,5 +33,4 @@ export const useUpdateDashboardOrganisationType = ComposableFactory.update(Dashb
|
|
|
35
33
|
export const useRemoveDashboardOrganisationType = ComposableFactory.remove(DashboardOrganisationTypeServiceFactory);
|
|
36
34
|
export const usePublishDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.publish);
|
|
37
35
|
export const useDuplicateDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.duplicate);
|
|
38
|
-
export const useLockDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.lock);
|
|
39
|
-
|
|
36
|
+
export const useLockDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.lock);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { DashboardOrganisationDetails, DashboardOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { type ChangeDashboardOrganisationFolderDTO, type CreateDashboardOrganisationDTO, DashboardOrganisationDetails, type DashboardOrganisationDetailsDTO, type DashboardOrganisationFilters, DashboardOrganisationInfos, type DashboardOrganisationInfosDTO, type LockDashboardOrganisationDTO, type UpdateDashboardOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { DASHBOARD_ORGANISATION_FOLDER_URL, DASHBOARD_ORGANISATION_LOCK_URL, DASHBOARD_ORGANISATION_URL, DASHBOARD_ORGANISATIONS_URL } from "../../config/urls";
|
|
@@ -7,26 +6,25 @@ import { DASHBOARD_ORGANISATION_FOLDER_URL, DASHBOARD_ORGANISATION_LOCK_URL, DAS
|
|
|
7
6
|
const DashboardOrganisationServiceFactory = new ServiceFactory<DashboardOrganisationDetailsDTO, DashboardOrganisationDetails>("dashboardOrganisation", DashboardOrganisationDetails)
|
|
8
7
|
.createComplete<DashboardOrganisationInfos, DashboardOrganisationInfosDTO, CreateDashboardOrganisationDTO, UpdateDashboardOrganisationDTO, DashboardOrganisationFilters>(DASHBOARD_ORGANISATIONS_URL, DASHBOARD_ORGANISATION_URL, DashboardOrganisationInfos);
|
|
9
8
|
|
|
10
|
-
const DashboardOrganisationServiceFactoryIncomplete = new ServiceFactory("dashboardOrganisation", DashboardOrganisationDetails)
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
));
|
|
9
|
+
const DashboardOrganisationServiceFactoryIncomplete = new ServiceFactory("dashboardOrganisation", DashboardOrganisationDetails).create(factory => factory.build(
|
|
10
|
+
factory.addNotify(notifyService => ({
|
|
11
|
+
...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationId: string) => axios.patch(DASHBOARD_ORGANISATION_URL(dashboardOrganisationId)), (dto: DashboardOrganisationDetailsDTO) => {
|
|
12
|
+
const result = new DashboardOrganisationDetails(dto);
|
|
13
|
+
notifyService.notify("update", result);
|
|
14
|
+
return result;
|
|
15
|
+
}),
|
|
16
|
+
...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationId: string, payload: LockDashboardOrganisationDTO) => axios.put(DASHBOARD_ORGANISATION_LOCK_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
|
|
17
|
+
const result = new DashboardOrganisationDetails(dto);
|
|
18
|
+
notifyService.notify("update", result);
|
|
19
|
+
return result;
|
|
20
|
+
}),
|
|
21
|
+
...ServiceFactory.addCustom("changeFolder", (axios, dashboardOrganisationId: string, payload: ChangeDashboardOrganisationFolderDTO) => axios.put(DASHBOARD_ORGANISATION_FOLDER_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
|
|
22
|
+
const result = new DashboardOrganisationDetails(dto);
|
|
23
|
+
notifyService.notify("update", result);
|
|
24
|
+
return result;
|
|
25
|
+
})
|
|
26
|
+
}))
|
|
27
|
+
));
|
|
30
28
|
|
|
31
29
|
export const useDashboardOrganisation = ComposableFactory.get(DashboardOrganisationServiceFactory);
|
|
32
30
|
export const useDashboardOrganisations = ComposableFactory.getMany(DashboardOrganisationServiceFactory);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { DashboardShallowDetails, DashboardShallowInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { type ChangeDashboardShallowFolderDTO, type CreateDashboardShallowDTO, DashboardShallowDetails, type DashboardShallowDetailsDTO, type DashboardShallowFilters, DashboardShallowInfos, type DashboardShallowInfosDTO, type UpdateDashboardShallowDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { DASHBOARD_SHALLOW_FOLDER_URL, DASHBOARD_SHALLOW_URL, DASHBOARD_SHALLOWS_URL } from "../../config/urls/dashboardShallows";
|
|
@@ -7,21 +6,20 @@ import { DASHBOARD_SHALLOW_FOLDER_URL, DASHBOARD_SHALLOW_URL, DASHBOARD_SHALLOWS
|
|
|
7
6
|
const DashboardShallowServiceFactory = new ServiceFactory<DashboardShallowDetailsDTO, DashboardShallowDetails>("dashboardShallow", DashboardShallowDetails)
|
|
8
7
|
.createComplete<DashboardShallowInfos, DashboardShallowInfosDTO, CreateDashboardShallowDTO, UpdateDashboardShallowDTO, DashboardShallowFilters>(DASHBOARD_SHALLOWS_URL, DASHBOARD_SHALLOW_URL, DashboardShallowInfos);
|
|
9
8
|
|
|
10
|
-
const DashboardShallowServiceFactoryIncomplete = new ServiceFactory("dashboardShallow", DashboardShallowDetails)
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
));
|
|
9
|
+
const DashboardShallowServiceFactoryIncomplete = new ServiceFactory("dashboardShallow", DashboardShallowDetails).create(factory => factory.build(
|
|
10
|
+
factory.addNotify(notifyService => ({
|
|
11
|
+
...ServiceFactory.addCustom("duplicate", (axios, dashboardShallowId: string) => axios.patch(DASHBOARD_SHALLOW_URL(dashboardShallowId)), (dto: DashboardShallowDetailsDTO) => {
|
|
12
|
+
const result = new DashboardShallowDetails(dto);
|
|
13
|
+
notifyService.notify("update", result);
|
|
14
|
+
return result;
|
|
15
|
+
}),
|
|
16
|
+
...ServiceFactory.addCustom("changeFolder", (axios, dashboardShallowId: string, payload: ChangeDashboardShallowFolderDTO) => axios.put(DASHBOARD_SHALLOW_FOLDER_URL(dashboardShallowId), payload), (dto: DashboardShallowDetailsDTO) => {
|
|
17
|
+
const result = new DashboardShallowDetails(dto);
|
|
18
|
+
notifyService.notify("update", result);
|
|
19
|
+
return result;
|
|
20
|
+
})
|
|
21
|
+
}))
|
|
22
|
+
));
|
|
25
23
|
|
|
26
24
|
export const useDashboardShallow = ComposableFactory.get(DashboardShallowServiceFactory);
|
|
27
25
|
export const useDashboardShallows = ComposableFactory.getMany(DashboardShallowServiceFactory);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import { DashboardDetails, type DashboardDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
1
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
3
|
|
|
3
|
-
import type { DashboardDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
-
import { DashboardDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
5
|
-
|
|
6
4
|
import { DASHBOARD_CURRENT_URL } from "../../config";
|
|
7
5
|
|
|
8
6
|
const DashboardServiceFactory = new ServiceFactory<DashboardDetailsDTO, DashboardDetails>("dashboard", DashboardDetails).create(factory => factory.build(
|
|
9
|
-
|
|
7
|
+
ServiceFactory.addCustom("getCurrent", (axios) => axios.get(DASHBOARD_CURRENT_URL()), (dto: DashboardDetailsDTO) => new DashboardDetails(dto))
|
|
10
8
|
));
|
|
11
9
|
|
|
12
10
|
export const useCurrentDashboard = ComposableFactory.custom(DashboardServiceFactory.getCurrent);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { DataCategoryDetails, DataCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { DataCategoryDetails, type DataCategoryDetailsDTO, type DataCategoryFilters, DataCategoryInfos, type DataCategoryInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { DATA_CATEGORIES_URL, DATA_CATEGORY_URL } from "../../config/urls";
|
|
6
5
|
|
|
7
6
|
const DataCategoryServiceFactory = new ServiceFactory<DataCategoryDetailsDTO, DataCategoryDetails>("dataCategory", DataCategoryDetails).create(factory => factory.build(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
factory.addGet(DATA_CATEGORY_URL),
|
|
8
|
+
factory.addGetMany<DataCategoryInfosDTO, DataCategoryInfos, DataCategoryFilters>(DATA_CATEGORIES_URL, DataCategoryInfos),
|
|
9
|
+
factory.addNotify()
|
|
11
10
|
));
|
|
12
11
|
|
|
13
12
|
export const useDataCategory = ComposableFactory.get(DataCategoryServiceFactory);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { DataDefinitionDetails, DataDefinitionInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { DataDefinitionDetails, type DataDefinitionDetailsDTO, type DataDefinitionFilters, DataDefinitionInfos, type DataDefinitionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
3
|
|
|
5
4
|
import { DATA_DEFINITIONS_URL, DATA_DEFINITION_URL } from "../../config/urls";
|
|
6
5
|
|
|
7
6
|
const DataDefinitionServiceFactory = new ServiceFactory<DataDefinitionDetailsDTO, DataDefinitionDetails>("dataDefinition", DataDefinitionDetails).create(factory => factory.build(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
factory.addGet(DATA_DEFINITION_URL),
|
|
8
|
+
factory.addGetMany<DataDefinitionInfosDTO, DataDefinitionInfos, DataDefinitionFilters>(DATA_DEFINITIONS_URL, DataDefinitionInfos),
|
|
9
|
+
factory.addNotify()
|
|
11
10
|
));
|
|
12
11
|
|
|
13
12
|
export const useDataDefinition = ComposableFactory.get(DataDefinitionServiceFactory);
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { ref, type Ref } from "vue";
|
|
2
2
|
|
|
3
3
|
import { type UpdateUserOrganisationTableDTO, type UserOrganisationTableDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
-
import { type FSDataTable } from "@dative-gpi/foundation-shared-components/models";
|
|
4
|
+
import { type FSDataTable, type FSDataTableColumn } from "@dative-gpi/foundation-shared-components/models";
|
|
5
5
|
|
|
6
6
|
export const useDataTables = () => {
|
|
7
7
|
const initialized = ref(false);
|
|
8
8
|
|
|
9
9
|
const table = ref<FSDataTable>({
|
|
10
10
|
headers: [],
|
|
11
|
-
mode: "
|
|
11
|
+
mode: "iterator",
|
|
12
12
|
sortBy: null,
|
|
13
13
|
rowsPerPage: 10,
|
|
14
14
|
filters: {},
|
|
15
15
|
page: 1
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const computeTable = ((
|
|
18
|
+
const computeTable = ((headersOptions: { [key: string]: Partial<FSDataTableColumn> }) => ({
|
|
19
19
|
...table.value,
|
|
20
20
|
headers: table.value.headers.map(header => ({
|
|
21
21
|
...header,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
fixedFilters: (header.value && headersOptions[header.value] && headersOptions[header.value].fixedFilters) || null,
|
|
23
|
+
methodFilter: (header.value && headersOptions[header.value] && headersOptions[header.value].methodFilter) || null,
|
|
24
|
+
methodFilterRaw: (header.value && headersOptions[header.value] && headersOptions[header.value].methodFilterRaw) || null,
|
|
25
|
+
sort: (header.value && headersOptions[header.value] && headersOptions[header.value].sort) || null,
|
|
26
|
+
sortRaw: (header.value && headersOptions[header.value] && headersOptions[header.value].sortRaw) || null ,
|
|
27
|
+
innerValue: (header.value && headersOptions[header.value] && headersOptions[header.value].innerValue) || null
|
|
24
28
|
}))
|
|
25
29
|
}));
|
|
26
30
|
|
|
@@ -87,4 +91,4 @@ export const useDataTables = () => {
|
|
|
87
91
|
computeTable,
|
|
88
92
|
updateTable
|
|
89
93
|
};
|
|
90
|
-
};
|
|
94
|
+
};
|