@followupus/common 0.10.24 → 0.10.26
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/shared/shared.d.ts +23 -0
- package/dist/shared/shared.js +42 -0
- package/package.json +1 -1
package/dist/shared/shared.d.ts
CHANGED
|
@@ -24,6 +24,28 @@ export declare const COLUMN_TYPES: {
|
|
|
24
24
|
CREATED_BY: string;
|
|
25
25
|
CREATED_AT: string;
|
|
26
26
|
};
|
|
27
|
+
export declare const ACTION_TYPE: {
|
|
28
|
+
CREATE: string;
|
|
29
|
+
UPDATE: string;
|
|
30
|
+
DELETE: string;
|
|
31
|
+
DUPLICATE: string;
|
|
32
|
+
MOVE: string;
|
|
33
|
+
RESOLVE: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const OBJECT_TYPE: {
|
|
36
|
+
WORKSPACE: string;
|
|
37
|
+
APP: string;
|
|
38
|
+
FOLDER: string;
|
|
39
|
+
BOARD: string;
|
|
40
|
+
VIEW: string;
|
|
41
|
+
DOC: string;
|
|
42
|
+
GROUP: string;
|
|
43
|
+
HEADER: string;
|
|
44
|
+
ITEM: string;
|
|
45
|
+
DROPDOWN: string;
|
|
46
|
+
MEMBER: string;
|
|
47
|
+
ACTION: string;
|
|
48
|
+
};
|
|
27
49
|
export declare const NAME_COLUMN = "name";
|
|
28
50
|
export declare const OP_TYPES: {
|
|
29
51
|
CONTAINS: string;
|
|
@@ -81,6 +103,7 @@ export declare const getColumnValueType: (columnType: string) => "string" | "num
|
|
|
81
103
|
export declare const getFilterDateGroupKeys: (dateStr: string) => string[] | null;
|
|
82
104
|
export declare const getDateGroupKey: (dateStr: string) => string | null;
|
|
83
105
|
export declare const extractDomain: (url?: string) => string | undefined;
|
|
106
|
+
export declare const hasDynamicCondition: (filter: IFilter, headers?: IBaseCustomColumn[]) => boolean;
|
|
84
107
|
export declare const getValidConditions: (filter: IFilter, headers?: IBaseCustomColumn[], currentUserId?: string, escapeHeaderCheck?: boolean) => IFilterCondition[];
|
|
85
108
|
export declare const isDateMatchConditionValue: (dateVal: string, conditionValue: string | {
|
|
86
109
|
start: string;
|
package/dist/shared/shared.js
CHANGED
|
@@ -27,6 +27,31 @@ export const COLUMN_TYPES = {
|
|
|
27
27
|
CREATED_BY: "created_by",
|
|
28
28
|
CREATED_AT: "created_at",
|
|
29
29
|
};
|
|
30
|
+
// the key order is used for Add Column Menu order, keep it
|
|
31
|
+
//One-to-One Matching UI.
|
|
32
|
+
export const ACTION_TYPE = {
|
|
33
|
+
CREATE: "CREATE",
|
|
34
|
+
UPDATE: "UPDATE",
|
|
35
|
+
DELETE: "DELETE",
|
|
36
|
+
DUPLICATE: "DUPLICATE",
|
|
37
|
+
MOVE: "MOVE",
|
|
38
|
+
RESOLVE: "RESOLVE",
|
|
39
|
+
};
|
|
40
|
+
// One-to-One Matching UI.
|
|
41
|
+
export const OBJECT_TYPE = {
|
|
42
|
+
WORKSPACE: "workspace",
|
|
43
|
+
APP: "app",
|
|
44
|
+
FOLDER: "folder",
|
|
45
|
+
BOARD: "board",
|
|
46
|
+
VIEW: "view",
|
|
47
|
+
DOC: "doc",
|
|
48
|
+
GROUP: "group",
|
|
49
|
+
HEADER: "header",
|
|
50
|
+
ITEM: "item",
|
|
51
|
+
DROPDOWN: "dropdown",
|
|
52
|
+
MEMBER: "member",
|
|
53
|
+
ACTION: "action",
|
|
54
|
+
};
|
|
30
55
|
export const NAME_COLUMN = "name";
|
|
31
56
|
export const OP_TYPES = {
|
|
32
57
|
CONTAINS: "like",
|
|
@@ -337,6 +362,23 @@ export const extractDomain = (url) => {
|
|
|
337
362
|
//
|
|
338
363
|
// return domainParts.join(".");
|
|
339
364
|
// };
|
|
365
|
+
export const hasDynamicCondition = (filter, headers) => {
|
|
366
|
+
if (!filter?.criteria?.length || !headers?.length) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
return filter.criteria?.some(c => {
|
|
370
|
+
const validHeader = headers.find(h => h.columnId === c.columnId);
|
|
371
|
+
let checkHeader = validHeader;
|
|
372
|
+
if (isLinkedColumns(validHeader?.type)) {
|
|
373
|
+
checkHeader = validHeader?.linked;
|
|
374
|
+
}
|
|
375
|
+
if (checkHeader?.type === COLUMN_TYPES.PEOPLE ||
|
|
376
|
+
checkHeader?.type === COLUMN_TYPES.CREATED_BY) {
|
|
377
|
+
return c.value?.find(val => val === THEMSELVES);
|
|
378
|
+
}
|
|
379
|
+
return false;
|
|
380
|
+
});
|
|
381
|
+
};
|
|
340
382
|
export const getValidConditions = (filter, headers, currentUserId, escapeHeaderCheck) => {
|
|
341
383
|
const newFilter = _.cloneDeep(filter);
|
|
342
384
|
if (!newFilter?.criteria?.length || !headers?.length) {
|