@followupus/common 0.10.25 → 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.
@@ -103,6 +103,7 @@ export declare const getColumnValueType: (columnType: string) => "string" | "num
103
103
  export declare const getFilterDateGroupKeys: (dateStr: string) => string[] | null;
104
104
  export declare const getDateGroupKey: (dateStr: string) => string | null;
105
105
  export declare const extractDomain: (url?: string) => string | undefined;
106
+ export declare const hasDynamicCondition: (filter: IFilter, headers?: IBaseCustomColumn[]) => boolean;
106
107
  export declare const getValidConditions: (filter: IFilter, headers?: IBaseCustomColumn[], currentUserId?: string, escapeHeaderCheck?: boolean) => IFilterCondition[];
107
108
  export declare const isDateMatchConditionValue: (dateVal: string, conditionValue: string | {
108
109
  start: string;
@@ -362,6 +362,23 @@ export const extractDomain = (url) => {
362
362
  //
363
363
  // return domainParts.join(".");
364
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
+ };
365
382
  export const getValidConditions = (filter, headers, currentUserId, escapeHeaderCheck) => {
366
383
  const newFilter = _.cloneDeep(filter);
367
384
  if (!newFilter?.criteria?.length || !headers?.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@followupus/common",
3
- "version": "0.10.25",
3
+ "version": "0.10.26",
4
4
  "description": "followup common utils npm package with TypeScript and VSCode",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",