@cellaware/utils 8.2.1 → 8.2.2
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.
|
@@ -116,7 +116,6 @@ export interface DatagridCondition {
|
|
|
116
116
|
}
|
|
117
117
|
export declare function initDatagridCondition(): DatagridCondition;
|
|
118
118
|
export declare function summarizeCondition(condition: DatagridCondition, localeMessageFn: (language: string, messageId: string) => Promise<string>): Promise<string>;
|
|
119
|
-
export declare function summarizeConditionAsMarkdown(condition: DatagridCondition, localeMessageFn: (language: string, messageId: string) => Promise<string>): Promise<string>;
|
|
120
119
|
export declare function codifyCondition(condition: DatagridCondition): string;
|
|
121
120
|
/**
|
|
122
121
|
* Equivalent of `parseNumeric` in front end
|
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -286,27 +286,6 @@ export async function summarizeCondition(condition, localeMessageFn) {
|
|
|
286
286
|
}
|
|
287
287
|
return `${condition.columnName} ${ruleStr}`;
|
|
288
288
|
}
|
|
289
|
-
export async function summarizeConditionAsMarkdown(condition, localeMessageFn) {
|
|
290
|
-
let ruleStr = '';
|
|
291
|
-
switch (condition.rule) {
|
|
292
|
-
case ConditionalFormatRule.BETWEEN:
|
|
293
|
-
ruleStr = `**${await localeMessageFn(CHATWMS_DEFAULT_LANGUAGE, condition.rule)}** ${condition.value} **${await localeMessageFn(CHATWMS_DEFAULT_LANGUAGE, 'conditional-format-rule-and')}** ${condition.value2}`;
|
|
294
|
-
break;
|
|
295
|
-
case ConditionalFormatRule.BLANK:
|
|
296
|
-
case ConditionalFormatRule.NOT_BLANK:
|
|
297
|
-
ruleStr = `**${await localeMessageFn(CHATWMS_DEFAULT_LANGUAGE, condition.rule)}**`;
|
|
298
|
-
break;
|
|
299
|
-
default:
|
|
300
|
-
if (condition.dataType === 'text') {
|
|
301
|
-
ruleStr = `**${await localeMessageFn(CHATWMS_DEFAULT_LANGUAGE, condition.rule)}** '${condition.value}'`;
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
ruleStr = `**${await localeMessageFn(CHATWMS_DEFAULT_LANGUAGE, condition.rule)}** ${condition.value}`;
|
|
305
|
-
}
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
return `\`${condition.columnName}\` ${ruleStr}`;
|
|
309
|
-
}
|
|
310
289
|
export function codifyCondition(condition) {
|
|
311
290
|
// NOTE: since we check for action/unsafe SQL with every query, we do not need to check for SQL injection here.
|
|
312
291
|
if (condition.dataType === 'number') {
|