@dative-gpi/foundation-shared-domain 0.0.103 → 0.0.105

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.
@@ -20,5 +20,5 @@ export class LanguageInfos {
20
20
  }
21
21
 
22
22
  export interface LanguageFilters {
23
- search: string | null;
23
+ search?: string | null;
24
24
  }
@@ -25,5 +25,5 @@ export interface OrganisationTypeInfosDTO {
25
25
  }
26
26
 
27
27
  export interface OrganisationTypeFilters {
28
- search: string | null;
28
+ search?: string | null;
29
29
  }
@@ -26,5 +26,5 @@ export interface OrganisationInfosDTO {
26
26
  }
27
27
 
28
28
  export interface OrganisationFilters {
29
- search: string | null;
29
+ search?: string | null;
30
30
  }
@@ -1,18 +1,18 @@
1
1
  export class TimeZoneInfos {
2
- id: string;
3
- offset: string;
2
+ id: string;
3
+ offset: string;
4
4
 
5
- constructor(params: TimeZoneInfosDTO) {
6
- this.id = params.id;
7
- this.offset = params.offset;
8
- }
5
+ constructor(params: TimeZoneInfosDTO) {
6
+ this.id = params.id;
7
+ this.offset = params.offset;
8
+ }
9
9
  }
10
10
 
11
11
  export interface TimeZoneInfosDTO {
12
- id: string;
13
- offset: string;
12
+ id: string;
13
+ offset: string;
14
14
  }
15
15
 
16
16
  export interface TimeZoneFilters {
17
- search: string | null;
17
+ search?: string | null;
18
18
  }
@@ -26,5 +26,5 @@ export class UserInfos {
26
26
  }
27
27
 
28
28
  export interface UserFilters {
29
- search: string | null;
29
+ search?: string | null;
30
30
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-domain",
3
3
  "sideEffects": false,
4
- "version": "0.0.103",
4
+ "version": "0.0.105",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -12,5 +12,5 @@
12
12
  "dependencies": {
13
13
  "date-fns": "^3.6.0"
14
14
  },
15
- "gitHead": "dd1b4c1e23a1826d70e02de27cb419205392fc5c"
15
+ "gitHead": "87c3913599bcfc96f33e3f2528e2be91a252726e"
16
16
  }
@@ -64,7 +64,7 @@ const fromExpression = (expression: string, variant: 'default' | 'before-after')
64
64
  return false;
65
65
  }
66
66
  return true;
67
- }
67
+ };
68
68
 
69
69
  export const isoTimeFormat = (timeZone: boolean = false): string => {
70
70
  return `yyyy-MM-dd'T'HH:mm:ss${timeZone ? "X" : ""}`;
package/tools/index.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from "./customPropertiesTools";
2
1
  export * from "./datesTools";
3
2
  export * from "./single";
@@ -1,49 +0,0 @@
1
- import _ from "lodash";
2
-
3
- import { CustomPropertyInfos, PropertyDataType } from "@dative-gpi/foundation-core-domain/models";
4
- import { FSGridItem } from "@dative-gpi/foundation-shared-components/models";
5
-
6
- export const CustomPropertyTools = {
7
- showCategory: (properties: CustomPropertyInfos[], category: string): boolean => {
8
- return properties.some(cp => cp.categoryLabel === category);
9
- },
10
- getExtraGridItems: (properties: CustomPropertyInfos[], category: string): FSGridItem[] => {
11
- return properties.filter(cp => cp.categoryLabel === category).map(cp => ({
12
- label: cp.label,
13
- code: `meta.${cp.code}`,
14
- value: "",
15
- hideDefault: cp.dataType === PropertyDataType.Boolean || cp.dataType === PropertyDataType.Icon
16
- }));
17
- },
18
- getExtraGrids: (properties: CustomPropertyInfos[], categories: string[]): { [key: string]: FSGridItem[] } => {
19
- const extraGrids: { [key: string]: FSGridItem[] } = {};
20
- const extraCategories = _.groupBy(properties.filter(cp => !categories.includes(cp.categoryLabel)), cp => cp.categoryLabel);
21
- for (const category in extraCategories) {
22
- extraGrids[category] = extraCategories[category].map(cp => ({
23
- label: cp.label,
24
- code: `meta.${cp.code}`,
25
- value: "",
26
- hideDefault: cp.dataType === PropertyDataType.Boolean || cp.dataType === PropertyDataType.Icon
27
- }));
28
- }
29
- return extraGrids;
30
- },
31
- getExtraFields: (properties: CustomPropertyInfos[], category: string): CustomPropertyInfos[] => {
32
- return properties.filter(cp => cp.categoryLabel === category && !cp.readOnlyCore);
33
- },
34
- getExtraCategories: (properties: CustomPropertyInfos[], categories: string[], sortFirst: string[]): { [key: string]: CustomPropertyInfos[] } => {
35
- const unordered = _.groupBy(properties.filter(cp => !categories.includes(cp.categoryLabel) && !cp.readOnlyCore), cp => cp.categoryLabel);
36
-
37
- return Object.keys(unordered).sort((a: string, b: string) => {
38
- const aIndex = sortFirst.indexOf(a);
39
- const bIndex = sortFirst.indexOf(b);
40
- if ((aIndex !== -1 && bIndex !== -1) || aIndex === bIndex) {
41
- return 0;
42
- }
43
- return bIndex - aIndex;
44
- }).reduce((obj: { [key: string]: any }, key: string) => {
45
- obj[key] = unordered[key];
46
- return obj
47
- }, {});
48
- }
49
- }