From 93f3326667fc00531ecdd1c7106b0c742be80b5b Mon Sep 17 00:00:00 2001 From: Michael Puehringer Date: Mon, 11 Oct 2021 13:57:39 +0200 Subject: [PATCH 01/40] Initial backend integration of CDC --- dist/cdc/CDCFilterDialog.d.ts | 5 ++ dist/cdc/CDCFilterDialog.js | 20 ++++++++ dist/cdc/CDCFilterDialog.js.map | 1 + dist/cdc/index.d.ts | 1 + dist/cdc/index.js | 2 + dist/cdc/index.js.map | 1 + dist/index.d.ts | 1 + dist/index.js | 1 + dist/index.js.map | 2 +- dist/lineup/internal/ScoreUtils.d.ts | 16 ++++-- requirements.txt | 1 + src/cdc/CDCFilterDialog.tsx | 27 ++++++++++ src/cdc/index.ts | 1 + src/index.ts | 1 + tdp_core/__init__.py | 6 +++ tdp_core/cdc/BaseCDC.py | 31 ++++++++++++ tdp_core/cdc/CDCManager.py | 63 ++++++++++++++++++++++++ tdp_core/cdc/DemoCDC.py | 73 ++++++++++++++++++++++++++++ tdp_core/cdc/__init__.py | 0 tdp_core/cdc/api.py | 25 ++++++++++ 20 files changed, 272 insertions(+), 6 deletions(-) create mode 100644 dist/cdc/CDCFilterDialog.d.ts create mode 100644 dist/cdc/CDCFilterDialog.js create mode 100644 dist/cdc/CDCFilterDialog.js.map create mode 100644 dist/cdc/index.d.ts create mode 100644 dist/cdc/index.js create mode 100644 dist/cdc/index.js.map create mode 100644 src/cdc/CDCFilterDialog.tsx create mode 100644 src/cdc/index.ts create mode 100644 tdp_core/cdc/BaseCDC.py create mode 100644 tdp_core/cdc/CDCManager.py create mode 100644 tdp_core/cdc/DemoCDC.py create mode 100644 tdp_core/cdc/__init__.py create mode 100644 tdp_core/cdc/api.py diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts new file mode 100644 index 000000000..5ceddc864 --- /dev/null +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -0,0 +1,5 @@ +/// +export declare function CDCFilterDialog({ show, setShow }: { + show: boolean; + setShow: (show: boolean) => void; +}): JSX.Element; diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js new file mode 100644 index 000000000..d497ad54a --- /dev/null +++ b/dist/cdc/CDCFilterDialog.js @@ -0,0 +1,20 @@ +import * as React from 'react'; +import { BSModal, BSTooltip } from '../hooks'; +export function CDCFilterDialog({ show, setShow }) { + return React.createElement("div", null, + React.createElement("button", { type: "button", "data-toggle": "modal", "data-target": "#myModal" }, "Launch modal"), + React.createElement(BSModal, { show: show, setShow: setShow }, + React.createElement("div", { className: "modal fade", tabIndex: -1 }, + React.createElement("div", { className: "modal-dialog" }, + React.createElement("div", { className: "modal-content" }, + React.createElement("div", { className: "modal-header" }, + React.createElement("h5", { className: "modal-title" }, "Modal title"), + React.createElement("button", { type: "button", className: "btn-close", "data-bs-dismiss": "modal", "aria-label": "Close" })), + React.createElement("div", { className: "modal-body" }, + React.createElement(BSTooltip, { title: "Hello" }, + React.createElement("p", null, "Modal body text goes here."))), + React.createElement("div", { className: "modal-footer" }, + React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), + React.createElement("button", { type: "button", className: "btn btn-primary" }, "Save changes"))))))); +} +//# sourceMappingURL=CDCFilterDialog.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map new file mode 100644 index 000000000..bff520394 --- /dev/null +++ b/dist/cdc/CDCFilterDialog.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAc,SAAS,EAAC,MAAM,UAAU,CAAC;AAExD,MAAM,UAAU,eAAe,CAAC,EAAC,IAAI,EAAE,OAAO,EAAqD;IAC/F,OAAO;QACH,gCAAQ,IAAI,EAAC,QAAQ,iBAAa,OAAO,iBAAa,UAAU,mBAAsB;QACtF,oBAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;YACjC,6BAAK,SAAS,EAAC,YAAY,EAAC,QAAQ,EAAE,CAAC,CAAC;gBACpC,6BAAK,SAAS,EAAC,cAAc;oBACzB,6BAAK,SAAS,EAAC,eAAe;wBAC9B,6BAAK,SAAS,EAAC,cAAc;4BACzB,4BAAI,SAAS,EAAC,aAAa,kBAAiB;4BAC5C,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,WAAW,qBAAiB,OAAO,gBAAY,OAAO,GAAU,CAC9F;wBACN,6BAAK,SAAS,EAAC,YAAY;4BACvB,oBAAC,SAAS,IAAC,KAAK,EAAC,OAAO;gCAAC,4DAAiC,CAAY,CACpE;wBACN,6BAAK,SAAS,EAAC,cAAc;4BACzB,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,mBAAmB,qBAAiB,OAAO,YAAe;4BAC1F,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,mBAAsB,CACrE,CACA,CACJ,CACJ,CACA,CACR,CAAA;AACV,CAAC"} \ No newline at end of file diff --git a/dist/cdc/index.d.ts b/dist/cdc/index.d.ts new file mode 100644 index 000000000..d6dbffba6 --- /dev/null +++ b/dist/cdc/index.d.ts @@ -0,0 +1 @@ +export * from './CDCFilterDialog'; diff --git a/dist/cdc/index.js b/dist/cdc/index.js new file mode 100644 index 000000000..2edb11929 --- /dev/null +++ b/dist/cdc/index.js @@ -0,0 +1,2 @@ +export * from './CDCFilterDialog'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/index.js.map b/dist/cdc/index.js.map new file mode 100644 index 000000000..fcb79e5dd --- /dev/null +++ b/dist/cdc/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cdc/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index 58553a03e..3200b1b5f 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,4 +1,5 @@ export * from './auth'; +export * from './cdc'; export * from './public'; export * from './base'; export * from './tour'; diff --git a/dist/index.js b/dist/index.js index 650ecebd5..454bbcb56 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,5 @@ export * from './auth'; +export * from './cdc'; export * from './public'; export * from './base'; export * from './tour'; diff --git a/dist/index.js.map b/dist/index.js.map index 7528c82ab..80a4087c0 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/dist/lineup/internal/ScoreUtils.d.ts b/dist/lineup/internal/ScoreUtils.d.ts index 6645a2f5a..2b2abf5d5 100644 --- a/dist/lineup/internal/ScoreUtils.d.ts +++ b/dist/lineup/internal/ScoreUtils.d.ts @@ -7,12 +7,18 @@ export declare class ScoreUtils { static readonly CMD_ADD_SCORE = "tdpAddScore"; static readonly CMD_REMOVE_SCORE = "tdpRemoveScore"; private static addScoreLogic; - static addScoreImpl(inputs: IObjectRef[], parameter: any): any; - static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise; - static removeScoreImpl(inputs: IObjectRef[], parameter: any): any; - static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): any; + static addScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static removeScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): import("phovea_core").IAction; static pushScoreAsync(graph: ProvenanceGraph, provider: IObjectRef, scoreName: string, scoreId: string, params: any): Promise; - static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): any; + static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): import("phovea_core").IAction; private static shallowEqualObjects; /** * compresses score creation and removal diff --git a/requirements.txt b/requirements.txt index c87352114..e6c5ae55b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ flask-swagger-ui==3.36.0 yamlreader==3.0.4 alembic==1.4.3 openpyxl~=3.0.5 +deepdiff==5.5.0 -e git+https://github.com/phovea/phovea_server.git@develop#egg=phovea_server diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx new file mode 100644 index 000000000..3b58928b4 --- /dev/null +++ b/src/cdc/CDCFilterDialog.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; +import {BSModal, useBSModal, BSTooltip} from '../hooks'; + +export function CDCFilterDialog({show, setShow}: {show: boolean; setShow: (show: boolean) => void;}) { + return
+ + +
+
+
+
+
Modal title
+ +
+
+

Modal body text goes here.

+
+
+ + +
+
+
+
+
+
+} \ No newline at end of file diff --git a/src/cdc/index.ts b/src/cdc/index.ts new file mode 100644 index 000000000..6ccfc958b --- /dev/null +++ b/src/cdc/index.ts @@ -0,0 +1 @@ +export * from './CDCFilterDialog'; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 58553a03e..3200b1b5f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ export * from './auth'; +export * from './cdc'; export * from './public'; export * from './base'; export * from './tour'; diff --git a/tdp_core/__init__.py b/tdp_core/__init__.py index 4af296464..171329f82 100644 --- a/tdp_core/__init__.py +++ b/tdp_core/__init__.py @@ -50,6 +50,12 @@ def phovea(registry): 'factory': 'create_migration_api', 'namespace': '/api/tdp/db-migration' }) + + registry.append('namespace', 'tdp_cdc', 'tdp_core.cdc.api', + { + 'namespace': '/api/tdp/cdc' + }) + # generator-phovea:end pass diff --git a/tdp_core/cdc/BaseCDC.py b/tdp_core/cdc/BaseCDC.py new file mode 100644 index 000000000..ef02d9209 --- /dev/null +++ b/tdp_core/cdc/BaseCDC.py @@ -0,0 +1,31 @@ +from abc import ABC, abstractmethod, abstractproperty +from typing import TypeVar, Generic, List, Union + +T = TypeVar('T') + + +# @ABC +class BaseCDC(Generic[T]): + @abstractproperty + def id(self): + pass + + @abstractmethod + def load_data(self) -> List[T]: + pass + + @abstractmethod + def load_existing(self) -> Union[List[T], None]: + pass + + @abstractmethod + def save_existing(self, data: List[T]): + pass + + @abstractmethod + def get_id(self, item: T) -> str: + pass + + @abstractmethod + def compare(self, old: List[T], new: List[T]): + pass diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py new file mode 100644 index 000000000..940cd96d2 --- /dev/null +++ b/tdp_core/cdc/CDCManager.py @@ -0,0 +1,63 @@ +from typing import Union +from .DemoCDC import DemoCDC +from .BaseCDC import BaseCDC +import logging +from random import choices + +_log = logging.getLogger(__name__) + + +# Alert: {filter: string; creator: ...@... } + +class CDCManager(): + + cdcs = [] + + def getCDC(self, id: str) -> Union[BaseCDC, None]: + return next((c for c in cdc_manager.cdcs if c.id == id), None) + + def registerCDC(self, cdc: BaseCDC): + _log.info(f'Registered CDC {cdc.id}') + self.cdcs.append(cdc) + + def refreshCDC(self, cdc: BaseCDC): + _log.info(f'Refreshing CDC {cdc.id}') + # Get existing entry + old = cdc.load_existing() + + # Fetch new entry + new = cdc.load_data() + + # Filter new entry + new = [item for item in new if eval('(item["id"] >= 5) or (item["id"] <= 2)')] + # filter = { + # 'operator': 'AND', + # 'filters': [{ + # 'query': 'num1 == false && num2 == true' + # }, { + # 'operator': 'OR', + # 'filters': [{ + # }, { + # 'query': '' + # }] + # }] + # } + # filter = '(num1 == false AND num2 == true) AND ((age1 >= ...) OR (age1 <= ...))' + + # TODO: How to find a proper "filter" library? + # 1) [item for item in new if exec('item.age >= 20')] + # 2) new_df = pd.DataFrame.from_dict(new) + # new_df = new_df.query('name == ["test123", "asdfasdf"] or age > 40 and ...') + + # Compare with new entry + diff_summary = cdc.compare(old, new) + + # new[5]['name'] = 'Hello world' + # cdc.save_existing(choices(new, k=len(new) // 2)) + cdc.save_existing(new) + + return diff_summary + + +cdc_manager = CDCManager() +cdc_manager.registerCDC(DemoCDC()) \ No newline at end of file diff --git a/tdp_core/cdc/DemoCDC.py b/tdp_core/cdc/DemoCDC.py new file mode 100644 index 000000000..8e9703ca3 --- /dev/null +++ b/tdp_core/cdc/DemoCDC.py @@ -0,0 +1,73 @@ +from .BaseCDC import BaseCDC +from phovea_server.util import jsonify +import requests +import logging +from deepdiff import DeepDiff + +_log = logging.getLogger(__name__) + + +class DemoCDC(BaseCDC): + # Dummy data, should be in a db/key-value store + data = None + + @property + def id(self): + return 'demo' + + def load_data(self): + _log.info('Loading up-to-date data') + return requests.get('https://jsonplaceholder.typicode.com/users').json() + + def load_existing(self): + _log.info('Loading existing data') + return self.data + + def save_existing(self, data): + _log.info('Setting existing data') + self.data = data + + def get_id(self, item): + _log.info(item) + return item['id'] + + def compare(self, old, new): + old = old or [] + new = new or [] + old_lookup = {self.get_id(item): item for item in old} + new_lookup = {self.get_id(item): item for item in new} + + _log.info(old_lookup) + _log.info(new_lookup) + + old_ids = set(old_lookup.keys()) + new_ids = set(new_lookup.keys()) + + added = new_ids - old_ids + removed = old_ids - new_ids + + changed = set() + unchanged = new_ids.intersection(old_ids) + + old_unchanged = [old_lookup[id] for id in unchanged] + new_unchanged = [new_lookup[id] for id in unchanged] + + # {} + # {1: {name: ..}, 2: {name: ...}} + return jsonify({'old': old_lookup, 'new': new_lookup, 'diff': DeepDiff(old_lookup, new_lookup).to_json()}) + + deep_diff = DeepDiff(old, new, group_by='id') + + # Added: dictionary_item_added + # Field changed: values_changed, i.e. \"values_changed\": {\"root[6]['name']\": {\"new_value\": \"Mrs. Dennis Schulist\", \"old_value\": \"Hello world\"}} + + # deep_delta = Delta(deep_diff) + + return deep_diff.to_json() + + return { + 'added': list(added), + 'removed': list(removed), + 'changed': list(changed), + 'unchanged': list(unchanged) + } diff --git a/tdp_core/cdc/__init__.py b/tdp_core/cdc/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py new file mode 100644 index 000000000..b084b31e6 --- /dev/null +++ b/tdp_core/cdc/api.py @@ -0,0 +1,25 @@ +from phovea_server.ns import Namespace, abort +from phovea_server.util import jsonify +from .CDCManager import cdc_manager +import logging + + +_log = logging.getLogger(__name__) +app = Namespace(__name__) + + +@app.route('/', methods=['GET']) +def list_cdc(): + return jsonify([c.id for c in cdc_manager.cdcs]) + + +@app.route('/', methods=['GET']) +def execute_cdc(id: str): + cdc = cdc_manager.getCDC(id) + if not cdc: + abort(404, f'No cdc with id {id} available') + return cdc_manager.refreshCDC(cdc) + + +def create(): + return app From 2538a0ee231720b5f1371edb1a44807fff994000 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Thu, 14 Oct 2021 14:45:22 +0200 Subject: [PATCH 02/40] add CDCFilterDialog + refactor for FilterComponents + try eval query --- dist/cdc/CDCFilterDialog.d.ts | 10 +- dist/cdc/CDCFilterDialog.js | 128 ++++++++++++++++- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CheckboxFilter.d.ts | 12 ++ dist/cdc/CheckboxFilter.js | 32 +++++ dist/cdc/CheckboxFilter.js.map | 1 + dist/cdc/DropZone.d.ts | 8 ++ dist/cdc/DropZone.js | 26 ++++ dist/cdc/DropZone.js.map | 1 + dist/cdc/FilterCard.d.ts | 9 ++ dist/cdc/FilterCard.js | 42 ++++++ dist/cdc/FilterCard.js.map | 1 + dist/cdc/GroupingFilter.d.ts | 2 + dist/cdc/GroupingFilter.js | 18 +++ dist/cdc/GroupingFilter.js.map | 1 + dist/cdc/RangeFilter.d.ts | 6 + dist/cdc/RangeFilter.js | 23 ++++ dist/cdc/RangeFilter.js.map | 1 + dist/cdc/TextFilter.d.ts | 17 +++ dist/cdc/TextFilter.js | 69 ++++++++++ dist/cdc/TextFilter.js.map | 1 + dist/cdc/interface.d.ts | 27 ++++ dist/cdc/interface.js | 54 ++++++++ dist/cdc/interface.js.map | 1 + dist/lineup/internal/ScoreUtils.d.ts | 16 +-- dist/utils/TDPApplicationUtils.d.ts | 6 +- package.json | 6 +- src/cdc/CDCFilterDialog.tsx | 198 ++++++++++++++++++++++++--- src/cdc/CheckboxFilter.tsx | 61 +++++++++ src/cdc/DropZone.tsx | 52 +++++++ src/cdc/FilterCard.tsx | 129 +++++++++++++++++ src/cdc/GroupingFilter.tsx | 19 +++ src/cdc/RangeFilter.tsx | 40 ++++++ src/cdc/TextFilter.tsx | 127 +++++++++++++++++ src/cdc/interface.ts | 87 ++++++++++++ tdp_core/cdc/CDCManager.py | 4 +- 36 files changed, 1189 insertions(+), 48 deletions(-) create mode 100644 dist/cdc/CheckboxFilter.d.ts create mode 100644 dist/cdc/CheckboxFilter.js create mode 100644 dist/cdc/CheckboxFilter.js.map create mode 100644 dist/cdc/DropZone.d.ts create mode 100644 dist/cdc/DropZone.js create mode 100644 dist/cdc/DropZone.js.map create mode 100644 dist/cdc/FilterCard.d.ts create mode 100644 dist/cdc/FilterCard.js create mode 100644 dist/cdc/FilterCard.js.map create mode 100644 dist/cdc/GroupingFilter.d.ts create mode 100644 dist/cdc/GroupingFilter.js create mode 100644 dist/cdc/GroupingFilter.js.map create mode 100644 dist/cdc/RangeFilter.d.ts create mode 100644 dist/cdc/RangeFilter.js create mode 100644 dist/cdc/RangeFilter.js.map create mode 100644 dist/cdc/TextFilter.d.ts create mode 100644 dist/cdc/TextFilter.js create mode 100644 dist/cdc/TextFilter.js.map create mode 100644 dist/cdc/interface.d.ts create mode 100644 dist/cdc/interface.js create mode 100644 dist/cdc/interface.js.map create mode 100644 src/cdc/CheckboxFilter.tsx create mode 100644 src/cdc/DropZone.tsx create mode 100644 src/cdc/FilterCard.tsx create mode 100644 src/cdc/GroupingFilter.tsx create mode 100644 src/cdc/RangeFilter.tsx create mode 100644 src/cdc/TextFilter.tsx create mode 100644 src/cdc/interface.ts diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index 5ceddc864..95d50eebe 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -1,5 +1,7 @@ /// -export declare function CDCFilterDialog({ show, setShow }: { - show: boolean; - setShow: (show: boolean) => void; -}): JSX.Element; +export declare function CDCFilterDialog(): JSX.Element; +export declare class CDCFilterDialogClass { + private node; + constructor(parent: HTMLElement); + private init; +} diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index d497ad54a..372545913 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -1,20 +1,134 @@ import * as React from 'react'; -import { BSModal, BSTooltip } from '../hooks'; -export function CDCFilterDialog({ show, setShow }) { +import ReactDOM from 'react-dom'; +import { BSModal } from '../hooks'; +import { getFilterFromTree, getTreeQuery } from "./interface"; +import { FilterCard } from "./FilterCard"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; +import produce from "immer"; +import { v4 as uuidv4 } from "uuid"; +import { createCDCGroupingFilter } from './GroupingFilter'; +import { createCDCTextFilter } from './TextFilter'; +import { createCDCCheckboxFilter } from './CheckboxFilter'; +import { createCDCRangeFilter } from './RangeFilter'; +export function CDCFilterDialog() { + const [filters, setFilters] = React.useState({ + ...createCDCGroupingFilter(uuidv4(), "Drop filters here"), + disableDragging: true, + disableRemoving: true + }); + //TODO filters + setFilters als prop + const filterSelection = [ + createCDCGroupingFilter(uuidv4(), "grouping-filter"), + createCDCTextFilter(uuidv4(), "text-filter", { filter: [{ field: "field1", value: [] }], fields: [{ field: "field1", options: ["hallo", "hier", "steht", "text"] }, { field: "field2", options: ["tschüss", "hier", "nicht"] }, { field: "field3", options: ["test", "noch ein test", "hi"] }] }), + createCDCCheckboxFilter(uuidv4(), "checkbox-filter", { fields: ["Eins", "zwei", "dRei"], filter: [] }), + createCDCRangeFilter(uuidv4(), "range-filter", { min: 1950, max: 2021 }), + ]; + React.useEffect(() => { + const test = getTreeQuery(filters); + if (test) { + console.log(test); + } + }, [filters]); + const onDelete = (filter) => { + setFilters(produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current && parent && parent.children) { + // Find the index of the current element in the parents children + const deleteIndex = parent.children.indexOf(current); + // Remove it from the current parent + if (deleteIndex !== -1) { + parent.children.splice(deleteIndex, 1); + } + } + })); + }; + const onDrop = (item, { target, index }) => { + // Add item to target children array + setFilters((filters) => produce(filters, (nextFilters) => { + // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, + // AND NOTHING FROM "OUTSIDE" LIKE item, or target. THESE REFERENCES + // ARE NOT UP-TO-DATE! + var _a, _b, _c; + // Find target in nextFilters + const dropTarget = getFilterFromTree(nextFilters, target.id); + const dropItem = getFilterFromTree(nextFilters, item.id); + // Check if the dropped item is part of the tree already + if (dropItem.current) { + // If we have a parent to remove us from... + if ((_a = dropItem.parent) === null || _a === void 0 ? void 0 : _a.children) { + // Find the index of the current element in the parents children + const deleteIndex = dropItem.parent.children.indexOf(dropItem.current); + // Remove it from the current parent + if (deleteIndex !== -1) { + (_c = (_b = dropItem.parent) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c.splice(deleteIndex, 1); + } + } + } + else { + // Otherwise, it is a new item to be added in the next step + dropItem.current = { ...item, id: uuidv4() }; + } + if (dropTarget.current) { + // Next, add it as target child + if (!dropTarget.current.children) { + dropTarget.current.children = []; + } + dropTarget.current.children.splice(index, 0, dropItem.current); + } + else { + console.error("Something is wrong"); + } + })); + }; + const onChange = (filter, changeFunc) => { + setFilters(produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current) { + changeFunc(current); + } + })); + }; + const onValueChanged = (filter, value) => { + onChange(filter, (f) => { + if (f.component) { + f.component.value = value; + } + }); + }; + const [showDialog, setShowDialog] = React.useState(false); return React.createElement("div", null, - React.createElement("button", { type: "button", "data-toggle": "modal", "data-target": "#myModal" }, "Launch modal"), - React.createElement(BSModal, { show: show, setShow: setShow }, + React.createElement("p", { style: { marginTop: 5, color: "white", cursor: "pointer" }, onClick: () => setShowDialog(true) }, + React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), + " Filter Dialog"), + React.createElement(BSModal, { show: showDialog }, React.createElement("div", { className: "modal fade", tabIndex: -1 }, - React.createElement("div", { className: "modal-dialog" }, + React.createElement("div", { className: "modal-dialog", style: { maxWidth: "90%" } }, React.createElement("div", { className: "modal-content" }, React.createElement("div", { className: "modal-header" }, React.createElement("h5", { className: "modal-title" }, "Modal title"), React.createElement("button", { type: "button", className: "btn-close", "data-bs-dismiss": "modal", "aria-label": "Close" })), React.createElement("div", { className: "modal-body" }, - React.createElement(BSTooltip, { title: "Hello" }, - React.createElement("p", null, "Modal body text goes here."))), + React.createElement(DndProvider, { backend: HTML5Backend }, + React.createElement("div", { className: "row" }, + React.createElement("div", { className: "col-md" }, + React.createElement("h5", null, "Your filters"), + React.createElement(FilterCard, { filter: filters, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged })), + React.createElement("div", { className: "col-md" }, + React.createElement("h5", null, "Add new filters"), + filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f }))))))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", className: "btn btn-primary" }, "Save changes"))))))); } +export class CDCFilterDialogClass { + constructor(parent) { + this.node = document.createElement("ul"); + parent.appendChild(this.node); + this.init(); + } + init() { + ReactDOM.render(React.createElement(CDCFilterDialog, null), this.node); + } +} //# sourceMappingURL=CDCFilterDialog.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index bff520394..5981709b5 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAc,SAAS,EAAC,MAAM,UAAU,CAAC;AAExD,MAAM,UAAU,eAAe,CAAC,EAAC,IAAI,EAAE,OAAO,EAAqD;IAC/F,OAAO;QACH,gCAAQ,IAAI,EAAC,QAAQ,iBAAa,OAAO,iBAAa,UAAU,mBAAsB;QACtF,oBAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;YACjC,6BAAK,SAAS,EAAC,YAAY,EAA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,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACE;oCACN,6BAAK,SAAS,EAAC,QAAQ;wCACrB,kDAAwB;wCACvB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAI,CACrC,CAAC,CACE,CACF,CACM,CACV;wBACN,6BAAK,SAAS,EAAC,cAAc;4BAC3B,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,mBAAmB,qBAAiB,OAAO,YAAe;4BAC1F,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,mBAAsB,CACnE,CACA,CACF,CACF,CACE,CACR,CAAA;AACR,CAAC;AAED,MAAM,OAAO,oBAAoB;IAG/B,YAAY,MAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAEO,IAAI;QACV,QAAQ,CAAC,MAAM,CACb,oBAAC,eAAe,OAAG,EACnB,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CheckboxFilter.d.ts b/dist/cdc/CheckboxFilter.d.ts new file mode 100644 index 000000000..badd26df0 --- /dev/null +++ b/dist/cdc/CheckboxFilter.d.ts @@ -0,0 +1,12 @@ +/// +import { IFilter } from "./interface"; +interface ICDCCheckboxFilterValue { + fields: string[]; + filter: string[]; +} +export declare function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter; +export declare function CDCCheckboxFilter({ value, onValueChanged }: { + value: any; + onValueChanged: any; +}): JSX.Element; +export {}; diff --git a/dist/cdc/CheckboxFilter.js b/dist/cdc/CheckboxFilter.js new file mode 100644 index 000000000..861101e4a --- /dev/null +++ b/dist/cdc/CheckboxFilter.js @@ -0,0 +1,32 @@ +import * as React from 'react'; +export function createCDCCheckboxFilter(id, name, value) { + return { + id, + name, + disableDropping: true, + component: { + clazz: CDCCheckboxFilter, + toFilter: CDCCheckboxFilterToString, + value, + } + }; +} +function CDCCheckboxFilterToString(value) { + // Generate filter from value + return `(${value === null || value === void 0 ? void 0 : value.fields.map((v) => { return `${v} == ${value.filter.filter((f) => f === v).length > 0}`; }).join(" and ")})`; +} +export function CDCCheckboxFilter({ value, onValueChanged }) { + return React.createElement(React.Fragment, null, value.fields.map((v) => { + return (React.createElement("div", { className: "input-group m-1" }, + React.createElement("div", { className: "form-check" }, + React.createElement("input", { className: "form-check-input", type: "checkbox", id: "flexCheckDefault", checked: value.filter.filter((f) => f === v).length > 0, disabled: !onValueChanged, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + ...value, + fields: value.fields, + filter: value.filter.filter((f) => f === v).length > 0 + ? value.filter.filter((f) => f !== v) + : [...value.filter, v] + }) }), + React.createElement("label", { className: "form-check-label", htmlFor: "flexCheckDefault" }, v)))); + })); +} +//# sourceMappingURL=CheckboxFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CheckboxFilter.js.map b/dist/cdc/CheckboxFilter.js.map new file mode 100644 index 000000000..c90c04fc4 --- /dev/null +++ b/dist/cdc/CheckboxFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA8B;IAC9F,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,QAA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C,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;4BACrC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;qBAC3B,CAAC,GAEJ;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,CAAC,CACI,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAA;AACL,CAAC"} \ No newline at end of file diff --git a/dist/cdc/DropZone.d.ts b/dist/cdc/DropZone.d.ts new file mode 100644 index 000000000..50e02ba2c --- /dev/null +++ b/dist/cdc/DropZone.d.ts @@ -0,0 +1,8 @@ +/// +import { IFilter } from "./interface"; +export declare function DropZone({ canDrop, onDrop, filter, index }: { + onDrop: any; + canDrop: boolean; + filter: IFilter; + index: number; +}): JSX.Element; diff --git a/dist/cdc/DropZone.js b/dist/cdc/DropZone.js new file mode 100644 index 000000000..50a8b55d7 --- /dev/null +++ b/dist/cdc/DropZone.js @@ -0,0 +1,26 @@ +import * as React from "react"; +import { getFilterFromTree, ItemTypes } from "./interface"; +import { useDrop } from "react-dnd"; +export function DropZone({ canDrop, onDrop, filter, index }) { + // TODO: Add proper types such that draggedItem can be infered + const [{ isOver, draggedItem }, drop] = useDrop(() => ({ + accept: ItemTypes.FILTERCARD, + drop: (item, monitor) => { + onDrop(item, { target: filter, index }); + }, + canDrop: (item) => canDrop, + collect: (monitor) => ({ + isOver: !!monitor.isOver(), + draggedItem: monitor.getItem() + }) + }), []); + // Check if the dragged item is actually our parent, because then we are no target + const isDraggedItemParent = React.useMemo(() => { + // If we can find the current filter given our dragged item as parent, we are a child + return draggedItem && !!getFilterFromTree(draggedItem, filter.id).current; + }, [draggedItem, filter]); + const isVisible = !isDraggedItemParent && draggedItem !== filter && draggedItem && canDrop; + return (React.createElement("div", { ref: drop, style: { opacity: 0.1 }, className: `border mt-1 mb-1 ${isVisible && isOver ? "bg-primary" : isVisible ? "bg-dark" : ""}` }, + React.createElement(React.Fragment, null, "\u00A0"))); +} +//# sourceMappingURL=DropZone.js.map \ No newline at end of file diff --git a/dist/cdc/DropZone.js.map b/dist/cdc/DropZone.js.map new file mode 100644 index 000000000..bc0cc317d --- /dev/null +++ b/dist/cdc/DropZone.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../src/cdc/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAW,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,QAAQ,CAAC,EACvB,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EAMN;IACC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,GAAG,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,SAAS,CAAC,UAAU;QAC5B,IAAI,EAAE,CAAC,IAAa,EAAE,OAAO,EAAE,EAAE;YAC/B,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;YAC1B,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,EACF,EAAE,CACH,CAAC;IAEF,kFAAkF;IAClF,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC7C,qFAAqF;QACrF,OAAO,WAAW,IAAI,CAAC,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAC5E,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1B,MAAM,SAAS,GACb,CAAC,mBAAmB,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,IAAI,OAAO,CAAC;IAE3E,OAAO,CACL,6BACE,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EACvB,SAAS,EAAE,oBACT,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC/D,EAAE;QAEF,mDAAW,CACP,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/FilterCard.d.ts b/dist/cdc/FilterCard.d.ts new file mode 100644 index 000000000..832e0ada5 --- /dev/null +++ b/dist/cdc/FilterCard.d.ts @@ -0,0 +1,9 @@ +/// +import { IFilter } from "./interface"; +export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged }: { + filter: IFilter; + onDrop?: any; + onDelete?: (filter: IFilter) => void; + onChange?: (filter: IFilter, changeFunc: (filter: IFilter) => void) => void; + onValueChanged?: (filter: IFilter, value: any) => void; +}): JSX.Element; diff --git a/dist/cdc/FilterCard.js b/dist/cdc/FilterCard.js new file mode 100644 index 000000000..6f5eaadff --- /dev/null +++ b/dist/cdc/FilterCard.js @@ -0,0 +1,42 @@ +import * as React from "react"; +import { ItemTypes } from "./interface"; +import { useDrag } from "react-dnd"; +import { DropZone } from "./DropZone"; +export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged }) { + var _a, _b, _c; + const [{ isDragging, draggedItem }, drag, preview] = useDrag(() => ({ + type: ItemTypes.FILTERCARD, + item: filter, + collect: (monitor) => ({ + isDragging: !!monitor.isDragging(), + draggedItem: monitor.getItem() + }) + })); + const hasChildren = filter.children && filter.children.length >= 0; + return (React.createElement("div", { className: `card mb-2 ${isDragging ? "bg-light" : ""}`, ref: preview, style: filter.disableRemoving && filter.disableDragging ? { height: "93%" } : {} }, + React.createElement("div", { className: "card-body" }, + React.createElement("h6", { ref: filter.disableDragging ? undefined : drag, className: "card-title d-flex", style: filter.disableDragging ? {} : { cursor: "move" } }, + filter.disableDragging ? null : (React.createElement("i", { style: { marginRight: 5 }, className: "fas fa-arrows-alt" })), + React.createElement("span", { className: "flex-fill" }, filter.name), + React.createElement("div", null, + React.createElement("div", { className: "input-group" }, + onChange && hasChildren && ((_a = filter === null || filter === void 0 ? void 0 : filter.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? (React.createElement("select", { className: "form-select form-select-sm", style: { width: "6em" }, value: filter.operator || "AND", onChange: (e) => { + onChange(filter, (f) => { + f.operator = e.currentTarget.value; + }); + } }, + React.createElement("option", { value: "AND" }, "AND"), + React.createElement("option", { value: "OR" }, "OR"), + React.createElement("option", { value: "NOT" }, "NOT (AND)"))) : null, + !filter.disableRemoving && onDelete ? (React.createElement("button", { className: "btn btn-danger btn-sm", onClick: () => onDelete(filter) }, + React.createElement("i", { className: "fas fa-times" }))) : null))), + filter.component ? (React.createElement("div", null, + React.createElement(filter.component.clazz, { value: filter.component.value, onValueChanged: onValueChanged + ? (value) => onValueChanged(filter, value) + : undefined }))) : null, + onDrop && (hasChildren || !filter.disableDropping) ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: 0, canDrop: draggedItem !== ((_b = filter.children) === null || _b === void 0 ? void 0 : _b[0]) })) : null, (_c = filter.children) === null || _c === void 0 ? void 0 : + _c.map((child, i, allChildren) => (React.createElement(React.Fragment, { key: child.id }, + React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onChange: onChange }), + onDrop && hasChildren ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: i + 1, canDrop: draggedItem !== allChildren[i + 1] && draggedItem !== child })) : null)))))); +} +//# sourceMappingURL=FilterCard.js.map \ No newline at end of file diff --git a/dist/cdc/FilterCard.js.map b/dist/cdc/FilterCard.js.map new file mode 100644 index 000000000..6ddd60fc6 --- /dev/null +++ b/dist/cdc/FilterCard.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FilterCard.js","sourceRoot":"","sources":["../../src/cdc/FilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAW,SAAS,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,UAAU,UAAU,CAAC,EACzB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,cAAc,EAOf;;IACC,MAAM,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,EAAE,SAAS,CAAC,UAAU;QAC1B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE;YAClC,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,CAAC,CAAC;IAEJ,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC;IAEnE,OAAO,CACL,6BACE,SAAS,EAAE,aAAa,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EACtD,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAC,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC,EAAE;QAE9E,6BAAK,SAA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,OAAO,EACL,WAAW,KAAK,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,GAE7D,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/GroupingFilter.d.ts b/dist/cdc/GroupingFilter.d.ts new file mode 100644 index 000000000..5a7da887c --- /dev/null +++ b/dist/cdc/GroupingFilter.d.ts @@ -0,0 +1,2 @@ +import { IFilter } from "./interface"; +export declare function createCDCGroupingFilter(id: string, name: string): IFilter; diff --git a/dist/cdc/GroupingFilter.js b/dist/cdc/GroupingFilter.js new file mode 100644 index 000000000..0458b374a --- /dev/null +++ b/dist/cdc/GroupingFilter.js @@ -0,0 +1,18 @@ +import * as React from 'react'; +export function createCDCGroupingFilter(id, name) { + return { + id, + name, + disableDropping: true, + operator: "AND", + children: [], + component: { + clazz: CDCGroupingFilter, + } + }; +} +function CDCGroupingFilter() { + return React.createElement("div", null, + React.createElement("br", null)); +} +//# sourceMappingURL=GroupingFilter.js.map \ No newline at end of file diff --git a/dist/cdc/GroupingFilter.js.map b/dist/cdc/GroupingFilter.js.map new file mode 100644 index 000000000..444317a6b --- /dev/null +++ b/dist/cdc/GroupingFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/GroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY;IAC9D,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;SACzB;KACF,CAAA;AACH,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO;QAAK,+BAAM,CAAM,CAAA;AAC1B,CAAC"} \ No newline at end of file diff --git a/dist/cdc/RangeFilter.d.ts b/dist/cdc/RangeFilter.d.ts new file mode 100644 index 000000000..b4de0ebea --- /dev/null +++ b/dist/cdc/RangeFilter.d.ts @@ -0,0 +1,6 @@ +import { IFilter } from "./interface"; +export interface ICDCRangeFilterValue { + min: number; + max: number; +} +export declare function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter; diff --git a/dist/cdc/RangeFilter.js b/dist/cdc/RangeFilter.js new file mode 100644 index 000000000..9ac17bb30 --- /dev/null +++ b/dist/cdc/RangeFilter.js @@ -0,0 +1,23 @@ +import * as React from 'react'; +import InputRange from "react-input-range"; +export function createCDCRangeFilter(id, name, value) { + return { + id, + name, + disableDropping: true, + component: { + clazz: CDCRangeFilter, + toFilter: CDCRangeFilterToString, + value, + } + }; +} +function CDCRangeFilterToString(value) { + // Generate filter from value + return `(date >= ${value.min} and date <= ${value.max})`; +} +function CDCRangeFilter({ value, onValueChanged }) { + return React.createElement("div", { style: { margin: "10px", paddingTop: "10px" } }, + React.createElement(InputRange, { disabled: !onValueChanged, maxValue: 2021, minValue: 1950, value: { min: value.min, max: value.max }, onChange: (v) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged(v) })); +} +//# sourceMappingURL=RangeFilter.js.map \ No newline at end of file diff --git a/dist/cdc/RangeFilter.js.map b/dist/cdc/RangeFilter.js.map new file mode 100644 index 000000000..dfe6f1285 --- /dev/null +++ b/dist/cdc/RangeFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RangeFilter.js","sourceRoot":"","sources":["../../src/cdc/RangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAQ3C,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA2B;IACxF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,cAAc;YACrB,QAAQ,EAAE,sBAAsB;YAChC,KAAK;SACN;KACF,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA2B;IACzD,6BAA6B;IAC7B,OAAO,YAAY,KAAK,CAAC,GAAG,gBAAgB,KAAK,CAAC,GAAG,GAAG,CAAC;AAC3D,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,OAAO,6BAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE;QACvD,oBAAC,UAAU,IACP,QAAQ,EAAE,CAAC,cAAc,EACzB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,EAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAC,EACvC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACtC,CACI,CAAA;AACV,CAAC"} \ No newline at end of file diff --git a/dist/cdc/TextFilter.d.ts b/dist/cdc/TextFilter.d.ts new file mode 100644 index 000000000..630e9319b --- /dev/null +++ b/dist/cdc/TextFilter.d.ts @@ -0,0 +1,17 @@ +/// +import { IFilter } from "./interface"; +export interface ICDCTextFilterValue { + fields: { + field: string; + options: string[]; + }[]; + filter: { + field: string; + value: string[]; + }[]; +} +export declare function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter; +export declare function CDCTextFilter({ value, onValueChanged }: { + value: any; + onValueChanged: any; +}): JSX.Element; diff --git a/dist/cdc/TextFilter.js b/dist/cdc/TextFilter.js new file mode 100644 index 000000000..8eb0395ac --- /dev/null +++ b/dist/cdc/TextFilter.js @@ -0,0 +1,69 @@ +import * as React from 'react'; +import Select from "react-select"; +export function createCDCTextFilter(id, name, value) { + return { + id, + name, + disableDropping: true, + component: { + clazz: CDCTextFilter, + toFilter: CDCTextFilterToString, + value, + } + }; +} +function CDCTextFilterToString(value) { + // Generate filter from value + return `(${value.filter + .map((v) => `${v.field} in (${v.value.join(',')})`) + .join(" and ")})`; +} +export function CDCTextFilter({ value, onValueChanged }) { + return React.createElement(React.Fragment, null, + value.filter.map((v, i) => { + var _a; + return (React.createElement("div", { key: i, className: "input-group m-1" }, + React.createElement("select", { className: "form-select", disabled: !onValueChanged, value: v.field, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + ...value, + filter: value.filter.map((oldV) => oldV === v + ? { + ...v, + field: e.currentTarget.value, + value: [] + } + : oldV) + }) }, + React.createElement("option", { value: "" }, "Select..."), + value.fields.map((f) => (React.createElement("option", { value: f.field, key: f.field }, f.field)))), + React.createElement("div", { style: { width: "70%" } }, + React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged, isMulti: true, value: v.value.map((value) => ({ label: value, value })), options: (_a = value.fields + .find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { + return { value: o, label: o }; + }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + ...value, + filter: value.filter.map((oldV) => oldV === v + ? { + ...v, + value: e.map((value) => value.value) + } + : oldV) + }) })), + React.createElement("button", { disabled: !onValueChanged, onClick: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + ...value, + filter: value.filter.filter((oldV) => oldV !== v) + }), className: "btn btn-secondary" }, "X"))); + }), + onValueChanged ? (React.createElement("button", { className: "btn btn-secondary m-1", onClick: () => { + onValueChanged({ + ...value, + filter: [ + ...value.filter, + { + field: "", + value: [] + } + ] + }); + } }, "+")) : null); +} +//# sourceMappingURL=TextFilter.js.map \ No newline at end of file diff --git a/dist/cdc/TextFilter.js.map b/dist/cdc/TextFilter.js.map new file mode 100644 index 000000000..dd7c2deb7 --- /dev/null +++ b/dist/cdc/TextFilter.js.map @@ -0,0 +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,CAAE,KAAa,CAAC,KAAK,CAAC;iCAC9C;gCACH,CAAC,CAAC,IAAI,CACT;yBACF,CAAC,GAEJ,CACI;gBACN,gCACE,QAAQ,EAAE,CAAC,cAAc,EACzB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;wBACf,GAAG,KAAK;wBACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;qBAClD,CAAC,EAEJ,SAAS,EAAC,mBAAmB,QAGtB,CACL,CACP,CAAA;SAAA,CAAC;QACD,cAAc,CAAC,CAAC,CAAC,CAChB,gCACE,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC,QAGM,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAA;AACL,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts new file mode 100644 index 000000000..5b1612fc2 --- /dev/null +++ b/dist/cdc/interface.d.ts @@ -0,0 +1,27 @@ +/// +export interface IFilterComponent { + clazz: (props: { + value: V; + onValueChanged?: (value: V) => void; + }) => JSX.Element; + value?: V; + toFilter?: (value: V) => string; +} +export interface IFilter { + id: string; + name: string; + disableRemoving?: boolean; + disableDragging?: boolean; + disableDropping?: boolean; + operator?: "AND" | "OR" | "NOT"; + component?: IFilterComponent; + children?: IFilter[]; +} +export declare const ItemTypes: { + FILTERCARD: string; +}; +export declare const getFilterFromTree: (filter: IFilter, id: string) => { + parent: IFilter | null; + current: IFilter | null; +}; +export declare const getTreeQuery: (filter: IFilter) => string; diff --git a/dist/cdc/interface.js b/dist/cdc/interface.js new file mode 100644 index 000000000..e9c7e34d3 --- /dev/null +++ b/dist/cdc/interface.js @@ -0,0 +1,54 @@ +export const ItemTypes = { + FILTERCARD: "filtercard" +}; +export const getFilterFromTree = (filter, id) => { + if ((filter === null || filter === void 0 ? void 0 : filter.id) === id) { + return { current: filter, parent: null }; + } + else if (filter && filter.children) { + // Is the id part of my children? + const current = filter.children.find((f) => f.id === id); + if (current) { + return { parent: filter, current }; + } + // Otherwise, continue with all children + for (const f of filter.children) { + const current = getFilterFromTree(f, id); + if (current.current) { + return current; + } + } + } + return { parent: null, current: null }; +}; +export const getTreeQuery = (filter) => { + if (!filter) { + return ""; + } + if (!filter.children) { + //leaf filter + if (filter.component && + filter.component.toFilter && + filter.component.value) { + return filter.component.toFilter(filter.component.value); + } + else { + return ""; + } + } + else { + //go through every child + let returnValue = "("; + filter.children.forEach((child, i) => { + var _a; + returnValue += `${getTreeQuery(child)}${filter.children && i < filter.children.length - 1 + ? ` ${(filter === null || filter === void 0 ? void 0 : filter.operator) === "NOT" + ? "and not" + : (_a = filter === null || filter === void 0 ? void 0 : filter.operator) === null || _a === void 0 ? void 0 : _a.toLowerCase()} ` + : ""}`; + }); + returnValue += ")"; + return returnValue; + } +}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/dist/cdc/interface.js.map b/dist/cdc/interface.js.map new file mode 100644 index 000000000..af6bb2358 --- /dev/null +++ b/dist/cdc/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/cdc/interface.ts"],"names":[],"mappings":"AAyBE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EAC2C,EAAE;IACvD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,E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G,YAAY,CAAC,KAAK,CAAC,GACnC,MAAM,CAAC,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAC/C,CAAC,CAAC,IACE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAK,KAAK;oBACxB,CAAC,CAAC,SAAS;oBACX,CAAC,OAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,WAAW,EACnC,GAAG;gBACL,CAAC,CAAC,EACN,EAAE,CAAC;QACL,CAAC,CAAC,CAAC;QACH,WAAW,IAAI,GAAG,CAAC;QACnB,OAAO,WAAW,CAAC;KACpB;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/lineup/internal/ScoreUtils.d.ts b/dist/lineup/internal/ScoreUtils.d.ts index 2b2abf5d5..6645a2f5a 100644 --- a/dist/lineup/internal/ScoreUtils.d.ts +++ b/dist/lineup/internal/ScoreUtils.d.ts @@ -7,18 +7,12 @@ export declare class ScoreUtils { static readonly CMD_ADD_SCORE = "tdpAddScore"; static readonly CMD_REMOVE_SCORE = "tdpRemoveScore"; private static addScoreLogic; - static addScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static removeScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): import("phovea_core").IAction; + static addScoreImpl(inputs: IObjectRef[], parameter: any): any; + static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise; + static removeScoreImpl(inputs: IObjectRef[], parameter: any): any; + static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): any; static pushScoreAsync(graph: ProvenanceGraph, provider: IObjectRef, scoreName: string, scoreId: string, params: any): Promise; - static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): import("phovea_core").IAction; + static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): any; private static shallowEqualObjects; /** * compresses score creation and removal diff --git a/dist/utils/TDPApplicationUtils.d.ts b/dist/utils/TDPApplicationUtils.d.ts index e90978b25..fb54ccf2c 100644 --- a/dist/utils/TDPApplicationUtils.d.ts +++ b/dist/utils/TDPApplicationUtils.d.ts @@ -40,8 +40,10 @@ export declare class TDPApplicationUtils { inverse: import("phovea_core").IAction; }; static initSession(map: object): import("phovea_core").IAction; - static setParameterImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): any; - static setParameter(view: IObjectRef, name: string, value: any, previousValue: any): any; + static setParameterImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static setParameter(view: IObjectRef, name: string, value: any, previousValue: any): import("phovea_core").IAction; static compressSetParameter(path: ActionNode[]): ActionNode[]; /** * @deprecated diff --git a/package.json b/package.json index 8688f704b..c161c2e4d 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,11 @@ "react-split": "^2.0.9", "bootstrap": "^5.0.1", "popper.js": "^1.15.0", - "plotly.js-dist": "^1.57.1" + "plotly.js-dist": "^1.57.1", + "immer": "^9.0.6", + "react-dnd": "^14.0.4", + "react-dnd-html5-backend": "^14.0.2", + "react-select": "^5.1.0" }, "devDependencies": { "@types/d3": "~3.5.36", diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 3b58928b4..e6811fa55 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,27 +1,183 @@ import * as React from 'react'; +import ReactDOM from 'react-dom'; import {BSModal, useBSModal, BSTooltip} from '../hooks'; +import { getFilterFromTree, getTreeQuery, IFilter, IFilterComponent } from "./interface"; +import { FilterCard } from "./FilterCard"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; +import produce from "immer"; +import { v4 as uuidv4 } from "uuid"; +import {createCDCGroupingFilter} from './GroupingFilter'; +import {createCDCTextFilter} from './TextFilter'; +import {createCDCCheckboxFilter} from './CheckboxFilter'; +import {createCDCRangeFilter} from './RangeFilter'; -export function CDCFilterDialog({show, setShow}: {show: boolean; setShow: (show: boolean) => void;}) { - return
- - -
-
-
-
-
Modal title
- -
-
-

Modal body text goes here.

-
-
- - -
-
+export function CDCFilterDialog() { + const [filters, setFilters] = React.useState( + { + ...createCDCGroupingFilter(uuidv4(), + "Drop filters here"), + disableDragging: true, + disableRemoving: true + } + ); + + //TODO filters + setFilters als prop + + const filterSelection: IFilter[] = [ + createCDCGroupingFilter(uuidv4(), "grouping-filter"), + createCDCTextFilter(uuidv4(), "text-filter", {filter: [{field: "field1", value: []}], fields:[{field: "field1", options: ["hallo", "hier", "steht", "text"]}, {field: "field2", options: ["tschüss", "hier", "nicht"]}, {field: "field3", options: ["test", "noch ein test", "hi"]}]}), + createCDCCheckboxFilter(uuidv4(), "checkbox-filter", {fields: ["Eins", "zwei", "dRei"], filter: []}), + createCDCRangeFilter(uuidv4(), "range-filter", {min: 1950, max: 2021}), + ]; + + React.useEffect(() => { + const test = getTreeQuery(filters); + if (test) { + console.log(test); + } + }, [filters]); + + const onDelete = (filter: IFilter) => { + setFilters( + produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current && parent && parent.children) { + // Find the index of the current element in the parents children + const deleteIndex = parent.children.indexOf(current); + // Remove it from the current parent + if (deleteIndex !== -1) { + parent.children.splice(deleteIndex, 1); + } + } + }) + ); + }; + + const onDrop = ( + item: IFilter, + { target, index }: { target: IFilter; index: number } + ) => { + // Add item to target children array + setFilters((filters) => + produce(filters, (nextFilters) => { + // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, + // AND NOTHING FROM "OUTSIDE" LIKE item, or target. THESE REFERENCES + // ARE NOT UP-TO-DATE! + + // Find target in nextFilters + const dropTarget = getFilterFromTree(nextFilters, target.id); + const dropItem = getFilterFromTree(nextFilters, item.id); + + // Check if the dropped item is part of the tree already + if (dropItem.current) { + // If we have a parent to remove us from... + if (dropItem.parent?.children) { + // Find the index of the current element in the parents children + const deleteIndex = dropItem.parent.children.indexOf( + dropItem.current + ); + // Remove it from the current parent + if (deleteIndex !== -1) { + dropItem.parent?.children?.splice(deleteIndex, 1); + } + } + } else { + // Otherwise, it is a new item to be added in the next step + dropItem.current = { ...item, id: uuidv4() }; + } + + if (dropTarget.current) { + // Next, add it as target child + if (!dropTarget.current.children) { + dropTarget.current.children = []; + } + dropTarget.current.children.splice(index, 0, dropItem.current); + } else { + console.error("Something is wrong"); + } + }) + ); + }; + + const onChange = (filter: IFilter, changeFunc: (filter: IFilter) => void) => { + setFilters( + produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current) { + changeFunc(current); + } + }) + ); + }; + + const onValueChanged = (filter: IFilter, value: any) => { + onChange(filter, (f) => { + if (f.component) { + f.component.value = value; + } + }); + }; + + const [showDialog, setShowDialog] = React.useState(false); + + return
+ setShowDialog(true)}> Alert Filter + +
+
+
+
+
Modal title
+ +
+
+ +
+
+
Your filters
+ +
+
+
Add new filters
+ {filterSelection.map((f) => ( + + ))} +
+
+
+
+ +
- -
+
+
+
+ +
+} + +export class CDCFilterDialogClass { + private node: HTMLElement; + + constructor(parent: HTMLElement) { + this.node = document.createElement("ul"); + this.node.classList.add("navbar-nav"); + parent.appendChild(this.node); + this.init(); + } + + private init() { + ReactDOM.render( + , + this.node + ); + } } \ No newline at end of file diff --git a/src/cdc/CheckboxFilter.tsx b/src/cdc/CheckboxFilter.tsx new file mode 100644 index 000000000..238b64f2b --- /dev/null +++ b/src/cdc/CheckboxFilter.tsx @@ -0,0 +1,61 @@ +import {IFilter} from "./interface"; +import * as React from 'react'; + +interface ICDCCheckboxFilterValue { + fields: string[], + filter: string[] +} + +export function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter { + return { + id, + name, + disableDropping: true, + component: { + clazz: CDCCheckboxFilter, + toFilter: CDCCheckboxFilterToString, + value, + } + } +} + +function CDCCheckboxFilterToString(value: ICDCCheckboxFilterValue): string { + // Generate filter from value + return `(${value?.fields.map((v) => {return `${v} == ${value.filter.filter((f) => f === v).length > 0}`;}).join(" and ")})`; +} + +export function CDCCheckboxFilter({ value, onValueChanged }) { + return <> + {value.fields.map((v) => { + return ( +
+
+ f === v).length > 0} + disabled={!onValueChanged} + onChange={(e) => + onValueChanged?.({ + ...value, + fields: value.fields, + filter: + value.filter.filter((f) => f === v).length > 0 + ? value.filter.filter((f) => f !== v) + : [...value.filter, v] + }) + } + /> + +
+
+ ); + })} + +} \ No newline at end of file diff --git a/src/cdc/DropZone.tsx b/src/cdc/DropZone.tsx new file mode 100644 index 000000000..2eceaee01 --- /dev/null +++ b/src/cdc/DropZone.tsx @@ -0,0 +1,52 @@ +import * as React from "react"; +import { getFilterFromTree, IFilter, ItemTypes } from "./interface"; +import { useDrop } from "react-dnd"; + +export function DropZone({ + canDrop, + onDrop, + filter, + index +}: { + onDrop: any; + canDrop: boolean; + filter: IFilter; + index: number; +}) { + // TODO: Add proper types such that draggedItem can be infered + const [{ isOver, draggedItem }, drop] = useDrop( + () => ({ + accept: ItemTypes.FILTERCARD, + drop: (item: IFilter, monitor) => { + onDrop(item, { target: filter, index }); + }, + canDrop: (item: IFilter) => canDrop, + collect: (monitor) => ({ + isOver: !!monitor.isOver(), + draggedItem: (monitor.getItem() as unknown) as IFilter | undefined + }) + }), + [] + ); + + // Check if the dragged item is actually our parent, because then we are no target + const isDraggedItemParent = React.useMemo(() => { + // If we can find the current filter given our dragged item as parent, we are a child + return draggedItem && !!getFilterFromTree(draggedItem, filter.id).current; + }, [draggedItem, filter]); + + const isVisible = + !isDraggedItemParent && draggedItem !== filter && draggedItem && canDrop; + + return ( +
+ <>  +
+ ); +} diff --git a/src/cdc/FilterCard.tsx b/src/cdc/FilterCard.tsx new file mode 100644 index 000000000..40fa587d1 --- /dev/null +++ b/src/cdc/FilterCard.tsx @@ -0,0 +1,129 @@ +import * as React from "react"; +import { IFilter, ItemTypes } from "./interface"; +import { useDrag } from "react-dnd"; +import { DropZone } from "./DropZone"; + +export function FilterCard({ + filter, + onDrop, + onDelete, + onChange, + onValueChanged +}: { + filter: IFilter; + onDrop?: any; + onDelete?: (filter: IFilter) => void; + onChange?: (filter: IFilter, changeFunc: (filter: IFilter) => void) => void; + onValueChanged?: (filter: IFilter, value: any) => void; +}) { + const [{ isDragging, draggedItem }, drag, preview] = useDrag(() => ({ + type: ItemTypes.FILTERCARD, + item: filter, + collect: (monitor) => ({ + isDragging: !!monitor.isDragging(), + draggedItem: (monitor.getItem() as unknown) as IFilter | undefined + }) + })); + + const hasChildren = filter.children && filter.children.length >= 0; + + return ( +
+
+
+ {filter.disableDragging ? null : ( + + )} + {filter.name} +
+
+ {onChange && hasChildren && filter?.children?.length > 1 ? ( + + ) : null} + {!filter.disableRemoving && onDelete ? ( + + ) : null} +
+
+
+ {/*
Card subtitle
*/} + {/*

+ Some quick example text to build on the card title and make up the + bulk of the card's content. +

*/} + + {filter.component ? ( +
+ onValueChanged(filter, value) + : undefined + } + /> +
+ ) : null} + {onDrop && (hasChildren || !filter.disableDropping) ? ( + + ) : null} + {filter.children?.map((child, i, allChildren) => ( + + + {onDrop && hasChildren ? ( + + ) : null} + + ))} +
+
+ ); +} diff --git a/src/cdc/GroupingFilter.tsx b/src/cdc/GroupingFilter.tsx new file mode 100644 index 000000000..5e0103030 --- /dev/null +++ b/src/cdc/GroupingFilter.tsx @@ -0,0 +1,19 @@ +import {IFilter} from "./interface"; +import * as React from 'react'; + +export function createCDCGroupingFilter(id: string, name: string): IFilter { + return { + id, + name, + disableDropping: true, + operator: "AND", + children: [], + component: { + clazz: CDCGroupingFilter, + } + } +} + +function CDCGroupingFilter() { + return

+} diff --git a/src/cdc/RangeFilter.tsx b/src/cdc/RangeFilter.tsx new file mode 100644 index 000000000..4ca356b48 --- /dev/null +++ b/src/cdc/RangeFilter.tsx @@ -0,0 +1,40 @@ +import {IFilter} from "./interface"; +import * as React from 'react'; +import InputRange from "react-input-range"; + + +export interface ICDCRangeFilterValue { + min: number, + max: number +} + +export function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter { + return { + id, + name, + disableDropping: true, + component: { + clazz: CDCRangeFilter, + toFilter: CDCRangeFilterToString, + value, + } + } +} + +function CDCRangeFilterToString(value: ICDCRangeFilterValue): string { + // Generate filter from value + return `(date >= ${value.min} and date <= ${value.max})`; +} + +function CDCRangeFilter({ value, onValueChanged }) { + return
+ onValueChanged?.(v)} + /> +
+} + diff --git a/src/cdc/TextFilter.tsx b/src/cdc/TextFilter.tsx new file mode 100644 index 000000000..6dd203721 --- /dev/null +++ b/src/cdc/TextFilter.tsx @@ -0,0 +1,127 @@ +import {IFilter} from "./interface"; +import * as React from 'react'; +import Select from "react-select"; + + +export interface ICDCTextFilterValue { + fields: { + field: string, + options: string[] + }[]; + filter: { + field: string, + value: string[] + }[]; +} + +export function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter { + return { + id, + name, + disableDropping: true, + component: { + clazz: CDCTextFilter, + toFilter: CDCTextFilterToString, + value, + } + } +} + +function CDCTextFilterToString(value: ICDCTextFilterValue): string { + // Generate filter from value + return `(${value.filter + .map((v) =>`${v.field} in (${v.value.join(',')})`) + .join(" and ")})`; +} + +export function CDCTextFilter({ value, onValueChanged }) { + return <> + {value.filter.map((v, i) => ( +
+ +
+ -
+
{ onChange(filter, (f) => { f.operator = e.currentTarget.value as any; diff --git a/src/cdc/api.ts b/src/cdc/api.ts new file mode 100644 index 000000000..7af43cdc6 --- /dev/null +++ b/src/cdc/api.ts @@ -0,0 +1,34 @@ +/********************************************************* + * Copyright (c) 2021 datavisyn GmbH, http://datavisyn.io + * + * This file is property of datavisyn. + * Code and any other files associated with this community + * may not be copied and/or distributed without permission. + * + * Proprietary and confidential. No warranty. + * + *********************************************************/ + + import {Ajax, AppContext} from 'phovea_core'; + import {IAlert} from './interface'; + + export async function getAlerts(): Promise { +// return Ajax.send(AppContext.getInstance().api2absURL('/tdp/cdc/alert'), null, 'GET', 'JSON', 'application/json'); + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`); + } + + export async function getCommunity(id: string): Promise { + return AppContext.getInstance().getAPIJSON(`/marketplace360/community/${id}`); + } + + export async function editCommunity(id: string, community: Partial): Promise { + return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community/${id}`), community, 'PUT', 'JSON', 'application/json'); + } + + export async function deleteCommunity(id: string): Promise { + return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community/${id}`), null, 'DELETE'); + } + +// export async function saveCommunity(community: IUploadCommunity): Promise { +// return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community`), community, 'POST', 'JSON', 'application/json'); +// } diff --git a/src/cdc/index.ts b/src/cdc/index.ts index 6ccfc958b..d6dbffba6 100644 --- a/src/cdc/index.ts +++ b/src/cdc/index.ts @@ -1 +1 @@ -export * from './CDCFilterDialog'; \ No newline at end of file +export * from './CDCFilterDialog'; diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index afdea4619..b95315139 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -6,27 +6,27 @@ export interface IFilterComponent { value?: V; toFilter?: (value: V) => string; } - + interface IData { num1: boolean; num2: boolean; } - + export interface IFilter { id: string; name: string; disableRemoving?: boolean; disableDragging?: boolean; disableDropping?: boolean; - operator?: "AND" | "OR" | "NOT"; + operator?: 'AND' | 'OR' | 'NOT'; component?: IFilterComponent; children?: IFilter[]; } - - export const ItemTypes = { - FILTERCARD: "filtercard" + + export const itemTypes = { + FILTERCARD: 'filtercard' }; - + export const getFilterFromTree = ( filter: IFilter, id: string @@ -39,7 +39,7 @@ export interface IFilterComponent { if (current) { return { parent: filter, current }; } - + // Otherwise, continue with all children for (const f of filter.children) { const current = getFilterFromTree(f, id); @@ -48,13 +48,13 @@ export interface IFilterComponent { } } } - + return { parent: null, current: null }; }; - + export const getTreeQuery = (filter: IFilter) => { if (!filter) { - return ""; + return ''; } if (!filter.children) { //leaf filter @@ -65,23 +65,29 @@ export const getTreeQuery = (filter: IFilter) => { ) { return filter.component.toFilter(filter.component.value); } else { - return ""; + return ''; } } else { //go through every child - let returnValue = "("; + let returnValue = '('; filter.children.forEach((child, i) => { returnValue += `${getTreeQuery(child)}${ filter.children && i < filter.children.length - 1 ? ` ${ - filter?.operator === "NOT" - ? "and not" + filter?.operator === 'NOT' + ? 'and not' : filter?.operator?.toLowerCase() } ` - : "" + : '' }`; }); - returnValue += ")"; + returnValue += ')'; return returnValue; } -}; \ No newline at end of file +}; + + +export interface IAlert { + id: number; + name: string; +} \ No newline at end of file diff --git a/tdp_core/cdc/BaseCDC.py b/tdp_core/cdc/BaseCDC.py index ef02d9209..8edb98df8 100644 --- a/tdp_core/cdc/BaseCDC.py +++ b/tdp_core/cdc/BaseCDC.py @@ -1,5 +1,5 @@ from abc import ABC, abstractmethod, abstractproperty -from typing import TypeVar, Generic, List, Union +from typing import Dict, TypeVar, Generic, List, Union T = TypeVar('T') @@ -14,13 +14,13 @@ def id(self): def load_data(self) -> List[T]: pass - @abstractmethod - def load_existing(self) -> Union[List[T], None]: - pass + # @abstractmethod + # def load_existing(self, options: Dict = {}) -> Union[List[T], None]: + # pass - @abstractmethod - def save_existing(self, data: List[T]): - pass + # @abstractmethod + # def save_existing(self, data: List[T]): + # pass @abstractmethod def get_id(self, item: T) -> str: diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py new file mode 100644 index 000000000..401819ea4 --- /dev/null +++ b/tdp_core/cdc/CDCAlert.py @@ -0,0 +1,77 @@ + +from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, BLOB, PickleType +from sqlalchemy.ext.hybrid import hybrid_property +from sqlalchemy.dialects.postgresql import UUID, JSONB +from sqlalchemy.sql.schema import ForeignKey +from marshmallow_sqlalchemy import SQLAlchemyAutoSchema +from marshmallow import EXCLUDE, fields +from sqlalchemy.ext.declarative import declarative_base + + +Base = declarative_base() + + +class CDCAlert(Base): + __tablename__ = 'CDCAlert' + __table_args__ = { + # TODO: Enable in postgres + #'schema': 'tdp_core', + 'extend_existing': True + } + + id = Column(Integer, primary_key=True, autoincrement=True) + name = Column(TEXT, nullable=False) + cdc_id = Column(TEXT, nullable=False) + # TODO: Change to JSONB in postgres + filter = Column(TEXT, nullable=False) + enable_mail_notification = Column(Boolean, nullable=False) + + latest_compare_date = Column(DateTime, nullable=True) + latest_diff = Column(PickleType, nullable=True) + latest_fetched_data = Column(PickleType, nullable=True) + + confirmation_date = Column(DateTime, nullable=True) # date of confirmation + confirmed_data = Column(PickleType, nullable=True) # your confirmed data + #security + creator = Column(TEXT, nullable=False) # NOQA: N815 + creation_date = Column(DateTime, nullable=False) # NOQA: N815 + group = Column(TEXT, nullable=False) # NOQA: N815 + permissions = Column(Integer, nullable=False, default=7700) # NOQA: N815 + #buddies + modifier = Column(TEXT) # NOQA: N815 + modification_date = Column(DateTime) # NOQA: N815 + + +class CDCAlertSchema(SQLAlchemyAutoSchema): + class Meta: + model = CDCAlert + load_instance = True + unknown = EXCLUDE + + +class CDCAlertArgsSchema(CDCAlertSchema): + class Meta(CDCAlertSchema.Meta): + load_instance = False + # TODO: Update to include all read-only fields + exclude = ( + 'id', + 'latest_compare_date', + 'latest_diff', + 'latest_fetched_data', + 'confirmation_date', + 'confirmed_data', + # Security fields + 'creator', + 'creation_date', + 'modifier', + 'modification_date' + ) + +# TODO: Remove and use postgres +from sqlalchemy import create_engine +from sqlalchemy.orm import sessionmaker + +engine = create_engine('sqlite:////:memory:') +# Base.metadata.drop_all(engine) +Base.metadata.create_all(engine) +create_session = sessionmaker(engine) diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py index 54de44a28..5d313725a 100644 --- a/tdp_core/cdc/CDCManager.py +++ b/tdp_core/cdc/CDCManager.py @@ -1,8 +1,9 @@ +from datetime import datetime from typing import Union from .DemoCDC import DemoCDC from .BaseCDC import BaseCDC +from .CDCAlert import CDCAlert import logging -from random import choices _log = logging.getLogger(__name__) @@ -16,6 +17,46 @@ class CDCManager(): def getCDC(self, id: str) -> Union[BaseCDC, None]: return next((c for c in cdc_manager.cdcs if c.id == id), None) + def run_alert(self, alert: CDCAlert): + _log.info(f'Refreshing alert {alert.cdc_id}') + cdc = self.getCDC(alert.cdc_id) + + if not cdc: + raise Exception(f'Missing cdc {alert.cdc_id}') + + # Fetch new entry + new = cdc.load_data({ + # TODO: Define options like username? + }) + + # Filter new entry + # '(item["id"] in (4, 5, 6, 7, 8) and not (item["id"] == 5 and item["id"] == 4 or item["id"] == 8)) or ((item["address"]["city"] == "Gwenborough") and (item["id"] > 0 and item["id"] < 5))' + new = [item for item in new if eval(alert.filter)] + + + # filter = { + # 'operator': 'AND', + # 'filters': [{ + # 'query': 'num1 == false && num2 == true' + # }, { + # 'operator': 'OR', + # 'filters': [{ + # }, { + # 'query': '' + # }] + # }] + # } + # filter = '(num1 == false AND num2 == true) AND ((age1 >= ...) OR (age1 <= ...))' + # TODO: How to find a proper "filter" library? + # 1) [item for item in new if exec('item.age >= 20')] + # 2) new_df = pd.DataFrame.from_dict(new) + # new_df = new_df.query('name == ["test123", "asdfasdf"] or age > 40 and ...') + + # Compare confirmed with new entry + diff = cdc.compare(alert.confirmed_data, new) + + return new, diff + def registerCDC(self, cdc: BaseCDC): _log.info(f'Registered CDC {cdc.id}') self.cdcs.append(cdc) diff --git a/tdp_core/cdc/DemoCDC.py b/tdp_core/cdc/DemoCDC.py index 8e9703ca3..078bc5770 100644 --- a/tdp_core/cdc/DemoCDC.py +++ b/tdp_core/cdc/DemoCDC.py @@ -1,3 +1,4 @@ +from typing import Dict from .BaseCDC import BaseCDC from phovea_server.util import jsonify import requests @@ -8,25 +9,14 @@ class DemoCDC(BaseCDC): - # Dummy data, should be in a db/key-value store - data = None - @property def id(self): return 'demo' - def load_data(self): + def load_data(self, options: Dict = {}): _log.info('Loading up-to-date data') return requests.get('https://jsonplaceholder.typicode.com/users').json() - def load_existing(self): - _log.info('Loading existing data') - return self.data - - def save_existing(self, data): - _log.info('Setting existing data') - self.data = data - def get_id(self, item): _log.info(item) return item['id'] @@ -54,7 +44,7 @@ def compare(self, old, new): # {} # {1: {name: ..}, 2: {name: ...}} - return jsonify({'old': old_lookup, 'new': new_lookup, 'diff': DeepDiff(old_lookup, new_lookup).to_json()}) + return DeepDiff(old_lookup, new_lookup).to_json() deep_diff = DeepDiff(old, new, group_by='id') diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index b084b31e6..0c287b132 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -1,19 +1,47 @@ -from phovea_server.ns import Namespace, abort +from phovea_server.ns import Namespace, abort, no_cache +from phovea_server.security import login_required, can_write, can_read, current_username from phovea_server.util import jsonify -from .CDCManager import cdc_manager +from .CDCManager import CDCManager, cdc_manager +from .CDCAlert import CDCAlert, CDCAlertSchema, create_session, CDCAlertArgsSchema +from flask_smorest import Api, Blueprint import logging +import uuid +from datetime import datetime -_log = logging.getLogger(__name__) app = Namespace(__name__) +app.config['OPENAPI_VERSION'] = '3.0.2' +app.config['OPENAPI_URL_PREFIX'] = '/spec' +app.config['OPENAPI_JSON_PATH'] = 'api.json' +app.config['OPENAPI_SWAGGER_UI_PATH'] = "/" +app.config['OPENAPI_SWAGGER_UI_URL'] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist/" +api = Api(app, spec_kwargs={ + 'title': 'CDC', + 'version': 1, + 'servers': [{ + 'url': '/api/tdp/cdc/' + }] +}) +blp = Blueprint( + 'cdc', __name__, url_prefix='/' +) + +#@app.errorhandler(400) +##@app.errorhandler(404) +#@app.errorhandler(500) +def handle_error(e): + return jsonify(error=str(e.description), code=e.code), e.code -@app.route('/', methods=['GET']) +_log = logging.getLogger(__name__) + + +@app.route('/cdc', methods=['GET']) def list_cdc(): return jsonify([c.id for c in cdc_manager.cdcs]) -@app.route('/', methods=['GET']) +@app.route('/cdc/', methods=['GET']) def execute_cdc(id: str): cdc = cdc_manager.getCDC(id) if not cdc: @@ -21,5 +49,127 @@ def execute_cdc(id: str): return cdc_manager.refreshCDC(cdc) +@no_cache +@login_required +@blp.route('/alert', methods=["GET"]) +@blp.response(CDCAlertSchema(many=True,), code=200) +def get_alerts(): + session = create_session() + alerts = session.query(CDCAlert).all() + return [p for p in alerts if can_read(p)] + + +@no_cache +@login_required +@blp.route('/alert', methods=["POST"]) +@blp.arguments(CDCAlertArgsSchema(), location='json', description='Create an alert') +@blp.response(CDCAlertSchema(), code=200) +def create_alert(data): + session = create_session() + alert = CDCAlertSchema().load(data, partial=True, session=session) + + # Security + alert.creator = current_username() + alert.creation_date = datetime.utcnow() + alert.group = "" + # Allow no one to see, and only the creator/buddy to edit + # Use permissions from endpoint + # alert.permissions = 7700 + alert.modifier = None + alert.modification_date = None + session.add(alert) + session.commit() + return alert + +@no_cache +@login_required +@blp.route('/alert/', methods=["PUT"]) +@blp.arguments(CDCAlertArgsSchema(partial=True), location='json', description='Update an alert') +@blp.response(CDCAlertSchema(), code=200) +def edit_alert_by_id(data, id: str): + session = create_session() + item = session.query(CDCAlert).get(id) + if not item: + abort(404, f'No alert with id {id}') + if not can_write(item): + abort(401) + + new_item = CDCAlertSchema().load(data, partial=True, instance=item, session=session) + new_item.modification_date = datetime.utcnow() + new_item.modifier = current_username() + session.commit() + return new_item + + +@no_cache +@login_required +@blp.route('/alert/', methods=["DELETE"]) +@blp.response(code=200) +def delete_alert_by_id(id: str): + session = create_session() + item = session.query(CDCAlert).get(id) + if not item: + abort(404, f'No alert with id {id}') + if not can_write(item): + abort(401) + + session.delete(item) + session.commit() + return "", 200 + + +@no_cache +@login_required +@blp.route('/alert//run', methods=["GET"]) +@blp.response(CDCAlertSchema(), code=200) +def run_alert_by_id(id: str): + session = create_session() + alert = session.query(CDCAlert).get(id) + if not alert: + abort(404, f'No alert with id {id}') + if not can_read(alert): + abort(401) + + new_data, diff = cdc_manager.run_alert(alert) + + if diff: + # We have a new diff! Send email? Store in db? ... + alert.latest_compare_date = datetime.utcnow() + alert.latest_fetched_data = new_data + alert.latest_diff = diff + + session.commit() + return alert, 200 + + +@no_cache +@login_required +@blp.route('/alert//confirm', methods=["GET"]) +@blp.response(CDCAlertSchema(), code=200) +def confirm_alert_by_id(id: str): + session = create_session() + alert = session.query(CDCAlert).get(id) + if not alert: + abort(404, f'No alert with id {id}') + if not can_read(alert): + abort(401) + + if not alert.latest_fetched_data: + abort(500, f'No data to confirm for id {id}') + + # TODO: How to confirm this override? + alert.confirmation_date = datetime.utcnow() + alert.confirmed_data = alert.latest_fetched_data + + alert.latest_compare_date = None + alert.latest_fetched_data = None + alert.latest_diff = None + session.commit() + return alert, 200 + + +api.register_blueprint(blp) + + def create(): - return app + return api._app From 64a0fc7ab09959818225efeb800c26e5cdece28a Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Tue, 19 Oct 2021 13:28:14 +0200 Subject: [PATCH 05/40] minor backend changes + improving filter dialog + getting endpoints in ts working --- dist/cdc/AccordionItem.d.ts | 11 ++ dist/cdc/AccordionItem.js | 11 ++ dist/cdc/AccordionItem.js.map | 1 + dist/cdc/AccordionView.d.ts | 11 ++ dist/cdc/AccordionView.js | 12 ++ dist/cdc/AccordionView.js.map | 1 + dist/cdc/CDCCreateAlert.d.ts | 2 + dist/cdc/CDCCreateAlert.js | 17 +++ dist/cdc/CDCCreateAlert.js.map | 1 + dist/cdc/CDCEditAlert.d.ts | 7 ++ dist/cdc/CDCEditAlert.js | 14 +++ dist/cdc/CDCEditAlert.js.map | 1 + dist/cdc/CDCEditFilter.d.ts | 7 ++ dist/cdc/CDCEditFilter.js | 25 ++++ dist/cdc/CDCEditFilter.js.map | 1 + dist/cdc/CDCFilterComponent.d.ts | 2 + dist/cdc/CDCFilterComponent.js | 105 +++++++++++++++++ dist/cdc/CDCFilterComponent.js.map | 1 + dist/cdc/CDCFilterDialog.js | 132 +++++---------------- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/api.d.ts | 3 +- dist/cdc/api.js | 15 +-- dist/cdc/api.js.map | 2 +- dist/cdc/interface.d.ts | 2 + dist/lineup/internal/ScoreUtils.d.ts | 16 ++- dist/utils/TDPApplicationUtils.d.ts | 6 +- src/cdc/AccordionView.tsx | 30 +++++ src/cdc/CDCCreateAlert.tsx | 25 ++++ src/cdc/CDCEditAlert.tsx | 21 ++++ src/cdc/CDCFilterComponent.tsx | 141 ++++++++++++++++++++++ src/cdc/CDCFilterDialog.tsx | 169 +++++---------------------- src/cdc/api.ts | 15 +-- src/cdc/interface.ts | 4 +- tdp_core/cdc/CDCAlert.py | 3 +- tdp_core/cdc/DemoCDC.py | 36 +----- tdp_core/cdc/api.py | 1 - 36 files changed, 547 insertions(+), 306 deletions(-) create mode 100644 dist/cdc/AccordionItem.d.ts create mode 100644 dist/cdc/AccordionItem.js create mode 100644 dist/cdc/AccordionItem.js.map create mode 100644 dist/cdc/AccordionView.d.ts create mode 100644 dist/cdc/AccordionView.js create mode 100644 dist/cdc/AccordionView.js.map create mode 100644 dist/cdc/CDCCreateAlert.d.ts create mode 100644 dist/cdc/CDCCreateAlert.js create mode 100644 dist/cdc/CDCCreateAlert.js.map create mode 100644 dist/cdc/CDCEditAlert.d.ts create mode 100644 dist/cdc/CDCEditAlert.js create mode 100644 dist/cdc/CDCEditAlert.js.map create mode 100644 dist/cdc/CDCEditFilter.d.ts create mode 100644 dist/cdc/CDCEditFilter.js create mode 100644 dist/cdc/CDCEditFilter.js.map create mode 100644 dist/cdc/CDCFilterComponent.d.ts create mode 100644 dist/cdc/CDCFilterComponent.js create mode 100644 dist/cdc/CDCFilterComponent.js.map create mode 100644 src/cdc/AccordionView.tsx create mode 100644 src/cdc/CDCCreateAlert.tsx create mode 100644 src/cdc/CDCEditAlert.tsx create mode 100644 src/cdc/CDCFilterComponent.tsx diff --git a/dist/cdc/AccordionItem.d.ts b/dist/cdc/AccordionItem.d.ts new file mode 100644 index 000000000..1af81c883 --- /dev/null +++ b/dist/cdc/AccordionItem.d.ts @@ -0,0 +1,11 @@ +/// +interface IAccordionViewProps { + parentId: string; + data: { + title: string; + JSX: JSX.Element; + show?: boolean; + }[]; +} +export declare function AccordionView({ parentId, data }: IAccordionViewProps): JSX.Element; +export {}; diff --git a/dist/cdc/AccordionItem.js b/dist/cdc/AccordionItem.js new file mode 100644 index 000000000..f7fa4623c --- /dev/null +++ b/dist/cdc/AccordionItem.js @@ -0,0 +1,11 @@ +import React from "react"; +export function AccordionView({ parentId, data }) { + const accordionItem = (index, title, JSX, show) => { + return (React.createElement("div", { className: "accordion-item" }, + React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), + React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, JSX))); + }; + return (React.createElement("div", { className: "accordion", id: parentId }, data.map((d, i) => { accordionItem(i, d.title, d.JSX, d.show); }))); +} +//# sourceMappingURL=AccordionItem.js.map \ No newline at end of file diff --git a/dist/cdc/AccordionItem.js.map b/dist/cdc/AccordionItem.js.map new file mode 100644 index 000000000..4b010274c --- /dev/null +++ b/dist/cdc/AccordionItem.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../src/cdc/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAsB;IACjE,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,GAAgB,EAAE,IAAc,EAAE,EAAE;QACvF,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,EAAE,IAChK,GAAG,CACA,CACF,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAE,QAAQ,IACpC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA,CAAA,CAAC,CAAC,CAC3D,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/AccordionView.d.ts b/dist/cdc/AccordionView.d.ts new file mode 100644 index 000000000..1af81c883 --- /dev/null +++ b/dist/cdc/AccordionView.d.ts @@ -0,0 +1,11 @@ +/// +interface IAccordionViewProps { + parentId: string; + data: { + title: string; + JSX: JSX.Element; + show?: boolean; + }[]; +} +export declare function AccordionView({ parentId, data }: IAccordionViewProps): JSX.Element; +export {}; diff --git a/dist/cdc/AccordionView.js b/dist/cdc/AccordionView.js new file mode 100644 index 000000000..ed61f4898 --- /dev/null +++ b/dist/cdc/AccordionView.js @@ -0,0 +1,12 @@ +import React from "react"; +export function AccordionView({ parentId, data }) { + console.log(parentId, data); + const accordionItem = (index, title, JSX, show) => { + return (React.createElement("div", { className: "accordion-item" }, + React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), + React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId.trim()}` }, JSX))); + }; + return (React.createElement("div", { className: "accordion", id: parentId.trim() }, data.map((d, i) => accordionItem(i, d.title, d.JSX, d.show)))); +} +//# sourceMappingURL=AccordionView.js.map \ No newline at end of file diff --git a/dist/cdc/AccordionView.js.map b/dist/cdc/AccordionView.js.map new file mode 100644 index 000000000..b3eca5b10 --- /dev/null +++ b/dist/cdc/AccordionView.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AccordionView.js","sourceRoot":"","sources":["../../src/cdc/AccordionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAsB;IACjE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC3B,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,GAAgB,EAAE,IAAc,EAAE,EAAE;QACvF,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,IACvK,GAAG,CACA,CACF,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,IAC3C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CACzD,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/CDCCreateAlert.d.ts new file mode 100644 index 000000000..67a9260f8 --- /dev/null +++ b/dist/cdc/CDCCreateAlert.d.ts @@ -0,0 +1,2 @@ +/// +export declare function CDCCreateAlert(): JSX.Element; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js new file mode 100644 index 000000000..be15a760e --- /dev/null +++ b/dist/cdc/CDCCreateAlert.js @@ -0,0 +1,17 @@ +import React from "react"; +import { AccordionView } from "./AccordionView"; +import { CDCFilterComponent } from "./CDCFilterComponent"; +export function CDCCreateAlert() { + const [alertName, setAlertName] = React.useState(""); + const generalInformation = (React.createElement(React.Fragment, null, + React.createElement("h6", null, "Name"), + React.createElement("input", { type: "text", value: alertName, onChange: (e) => setAlertName(e.target.value) }))); + const data = [ + { title: "General information", JSX: generalInformation, show: true }, + { title: "Edit filters", JSX: React.createElement(CDCFilterComponent, null) } + ]; + return (React.createElement(React.Fragment, null, + React.createElement("h5", null, "Your options"), + React.createElement(AccordionView, { parentId: "createAlert", data: data }))); +} +//# sourceMappingURL=CDCCreateAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map new file mode 100644 index 000000000..0c10675e4 --- /dev/null +++ b/dist/cdc/CDCCreateAlert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAGxD,MAAM,UAAU,cAAc;IAE5B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE7D,MAAM,kBAAkB,GACxB,CAAC;QACC,uCAAa;QACb,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,CACrF,CAAC,CAAC;IAEL,MAAM,IAAI,GAAG;QACX,EAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAC,kBAAkB,OAAG,EAAC;KACrD,CAAC;IAEF,OAAO,CAAC;QACJ,+CAAqB;QACrB,oBAAC,aAAa,IAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAI,CACvD,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.d.ts b/dist/cdc/CDCEditAlert.d.ts new file mode 100644 index 000000000..050126554 --- /dev/null +++ b/dist/cdc/CDCEditAlert.d.ts @@ -0,0 +1,7 @@ +/// +import { IAlert } from "./interface"; +interface ICDCEditAlertProps { + selectedAlert: IAlert; +} +export declare function CDCEditAlert({ selectedAlert }: ICDCEditAlertProps): JSX.Element; +export {}; diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js new file mode 100644 index 000000000..47c2ca19f --- /dev/null +++ b/dist/cdc/CDCEditAlert.js @@ -0,0 +1,14 @@ +import React from "react"; +import { AccordionView } from "./AccordionView"; +import { CDCFilterComponent } from "./CDCFilterComponent"; +export function CDCEditAlert({ selectedAlert }) { + const data = [ + { title: 'Alert overview', JSX: React.createElement("p", null, "text aufgeklappt"), show: true }, + { title: 'New literature', JSX: React.createElement("p", null, "text aufgeklappt") }, + { title: 'Filter settings', JSX: React.createElement(CDCFilterComponent, null) } + ]; + return (React.createElement(React.Fragment, null, + React.createElement("h5", null, "Your options"), + React.createElement(AccordionView, { parentId: "filterOptions", data: data }))); +} +//# sourceMappingURL=CDCEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map new file mode 100644 index 000000000..d63c4446e --- /dev/null +++ b/dist/cdc/CDCEditAlert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAOvD,MAAM,UAAU,YAAY,CAAC,EAAC,aAAa,EAAsB;IAC/D,MAAM,IAAI,GAAG;QACX,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAC;QACvD,EAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAC,kBAAkB,OAAG,EAAC;KACxD,CAAA;IAED,OAAO,CAAC;QACJ,+CAAqB;QACrB,oBAAC,aAAa,IAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,GAAG,CACxD,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditFilter.d.ts b/dist/cdc/CDCEditFilter.d.ts new file mode 100644 index 000000000..b0dd03d4c --- /dev/null +++ b/dist/cdc/CDCEditFilter.d.ts @@ -0,0 +1,7 @@ +/// +import { IAlert } from "./interface"; +interface ICDCEditFilterProps { + selectedAlert: IAlert; +} +export declare function CDCEditFilter({ selectedAlert }: ICDCEditFilterProps): JSX.Element; +export {}; diff --git a/dist/cdc/CDCEditFilter.js b/dist/cdc/CDCEditFilter.js new file mode 100644 index 000000000..7fd909b54 --- /dev/null +++ b/dist/cdc/CDCEditFilter.js @@ -0,0 +1,25 @@ +import React from "react"; +import { CDCFilterComponent } from "./CDCFilterComponent"; +export function CDCEditFilter({ selectedAlert }) { + const accordionItem = (parentId, title, index, innerHtml, show) => { + return (React.createElement("div", { className: "accordion-item" }, + React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, + React.createElement("button", { disabled: !selectedAlert, className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), + React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse ${show}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, innerHtml))); + }; + return (React.createElement(React.Fragment, null, + React.createElement("h5", null, "Your options"), + React.createElement("div", { className: "accordion", id: "filterOptions" }, + accordionItem('filterOptions', 'Alert overview', 1, (React.createElement(React.Fragment, null, + React.createElement("p", null, "text aufgeklappt"), + React.createElement("p", null, "is"), + React.createElement("p", null, "written"), + React.createElement("p", null, "here"))), "show"), + accordionItem('filterOptions', 'New Literature', 2, (React.createElement(React.Fragment, null, + React.createElement("p", null, "text"), + React.createElement("p", null, "is"), + React.createElement("p", null, "written"), + React.createElement("p", null, "here")))), + accordionItem('filterOptions', 'Filter settings', 3, React.createElement(CDCFilterComponent, null))))); +} +//# sourceMappingURL=CDCEditFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditFilter.js.map b/dist/cdc/CDCEditFilter.js.map new file mode 100644 index 000000000..bae686ce3 --- /dev/null +++ b/dist/cdc/CDCEditFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCEditFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCEditFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAOvD,MAAM,UAAU,aAAa,CAAC,EAAC,aAAa,EAAuB;IACjE,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAE,KAAa,EAAE,SAAsB,EAAE,IAAa,EAAE,EAAE;QAC9G,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IAC/L,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,mCAAmC,IAAI,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,EAAE,IAClJ,SAAS,CACN,CACF,CACP,CAAA;IACH,CAAC,CAAC;IAEF,OAAO,CAAC;QACJ,+CAAqB;QACrB,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAC,eAAe;YAC1C,aAAa,CACZ,eAAe,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;gBACvC,kDAAuB;gBACvB,oCAAS;gBACT,yCAAc;gBACd,sCAAW,CACV,CAAC,EAAE,MAAM,CAAC;YACZ,aAAa,CACZ,eAAe,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;gBACvC,sCAAW;gBACX,oCAAS;gBACT,yCAAc;gBACd,sCAAW,CACV,CAAC,CAAC;YACJ,aAAa,CACZ,eAAe,EAAE,iBAAiB,EAAE,CAAC,EAAE,oBAAC,kBAAkB,OAAG,CAAC,CAC5D,CACP,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.d.ts b/dist/cdc/CDCFilterComponent.d.ts new file mode 100644 index 000000000..186749033 --- /dev/null +++ b/dist/cdc/CDCFilterComponent.d.ts @@ -0,0 +1,2 @@ +/// +export declare function CDCFilterComponent(): JSX.Element; diff --git a/dist/cdc/CDCFilterComponent.js b/dist/cdc/CDCFilterComponent.js new file mode 100644 index 000000000..ae5d47d25 --- /dev/null +++ b/dist/cdc/CDCFilterComponent.js @@ -0,0 +1,105 @@ +import produce from "immer"; +import React from "react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; +import { createCDCCheckboxFilter } from "./CDCCheckboxFilter"; +import { createCDCGroupingFilter } from "./CDCGroupingFilter"; +import { createCDCRangeFilter } from "./CDCRangeFilter"; +import { createCDCTextFilter } from "./CDCTextFilter"; +import { FilterCard } from "./FilterCard"; +import { getFilterFromTree, getTreeQuery } from "./interface"; +import { v4 as uuidv4 } from 'uuid'; +export function CDCFilterComponent() { + const [filters, setFilters] = React.useState({ + ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), + disableDragging: true, + disableRemoving: true + }); + React.useEffect(() => { + const test = getTreeQuery(filters); + if (test) { + console.log(test); + } + }, [filters]); + const filterSelection = [ + createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), + createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), + createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), + createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), + ]; + const onDelete = (filter) => { + setFilters(produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current && parent && parent.children) { + // Find the index of the current element in the parents children + const deleteIndex = parent.children.indexOf(current); + // Remove it from the current parent + if (deleteIndex !== -1) { + parent.children.splice(deleteIndex, 1); + } + } + })); + }; + const onDrop = (item, { target, index }) => { + // Add item to target children array + setFilters((filters) => produce(filters, (nextFilters) => { + // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, + // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES + // ARE NOT UP-TO-DATE! + var _a, _b, _c; + // Find target in nextFilters + const dropTarget = getFilterFromTree(nextFilters, target.id); + const dropItem = getFilterFromTree(nextFilters, item.id); + // Check if the dropped item is part of the tree already + if (dropItem.current) { + // If we have a parent to remove us from... + if ((_a = dropItem.parent) === null || _a === void 0 ? void 0 : _a.children) { + // Find the index of the current element in the parents children + const deleteIndex = dropItem.parent.children.indexOf(dropItem.current); + // Remove it from the current parent + if (deleteIndex !== -1) { + (_c = (_b = dropItem.parent) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c.splice(deleteIndex, 1); + } + } + } + else { + // Otherwise, it is a new item to be added in the next step + dropItem.current = { ...item, id: uuidv4() }; + } + if (dropTarget.current) { + // Next, add it as target child + if (!dropTarget.current.children) { + dropTarget.current.children = []; + } + dropTarget.current.children.splice(index, 0, dropItem.current); + } + else { + console.error('Something is wrong'); + } + })); + }; + const onChange = (filter, changeFunc) => { + setFilters(produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current) { + changeFunc(current); + } + })); + }; + const onValueChanged = (filter, value) => { + onChange(filter, (f) => { + if (f.component) { + f.component.value = value; + } + }); + }; + return (React.createElement(DndProvider, { backend: HTML5Backend }, + React.createElement("div", { className: "row" }, + React.createElement("div", { className: "col-md" }, + React.createElement("h6", null, "Your filters"), + React.createElement(FilterCard, { filter: filters, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged })), + React.createElement("div", { className: "col-md" }, + React.createElement("h6", null, "New filters"), + filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f }))))))); +} +//# sourceMappingURL=CDCFilterComponent.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.js.map b/dist/cdc/CDCFilterComponent.js.map new file mode 100644 index 000000000..4b2e7dba5 --- /dev/null +++ b/dist/cdc/CDCFilterComponent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAAE,YAAY,EAAU,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,MAAM,UAAU,kBAAkB;IAEhC,MAAM,CAAC,OAAO,EAAE,UAAU,C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C,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACP,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAChB,6BAAK,SAAS,EAAC,QAAQ;gBACvB,+CAAqB;gBACrB,oBAAC,UAAU,IACP,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAChC,CACI;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACvB,8CAAoB;gBACf,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC5B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAI,CACnC,CAAC,CACA,CACJ,CACM,CACb,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index ce7e9fd8d..04bad616a 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -1,104 +1,16 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import { BSModal, useAsync } from '../hooks'; -import { getFilterFromTree, getTreeQuery } from "./interface"; -import { FilterCard } from './FilterCard'; -import { DndProvider } from 'react-dnd'; -import { HTML5Backend } from 'react-dnd-html5-backend'; -import produce from 'immer'; -import { v4 as uuidv4 } from 'uuid'; -import { createCDCGroupingFilter } from './CDCGroupingFilter'; -import { createCDCTextFilter } from './CDCTextFilter'; -import { createCDCCheckboxFilter } from './CDCCheckboxFilter'; -import { createCDCRangeFilter } from './CDCRangeFilter'; import { getAlerts } from './api'; +import { CDCEditAlert } from './CDCEditAlert'; +import { CDCCreateAlert } from './CDCCreateAlert'; export function CDCFilterDialog() { + const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); - const [filters, setFilters] = React.useState({ - ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), - disableDragging: true, - disableRemoving: true - }); + const [creationMode, setCreationMode] = React.useState(false); const { status: alertStatus, error: alertError, execute: alertExecute, value: alerts } = useAsync(getAlerts, true); - const filterSelection = [ - createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), - createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), - createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), - ]; - React.useEffect(() => { - const test = getTreeQuery(filters); - if (test) { - console.log(test); - } - }, [filters]); - const onDelete = (filter) => { - setFilters(produce(filters, (nextFilters) => { - const { current, parent } = getFilterFromTree(nextFilters, filter.id); - if (current && parent && parent.children) { - // Find the index of the current element in the parents children - const deleteIndex = parent.children.indexOf(current); - // Remove it from the current parent - if (deleteIndex !== -1) { - parent.children.splice(deleteIndex, 1); - } - } - })); - }; - const onDrop = (item, { target, index }) => { - // Add item to target children array - setFilters((filters) => produce(filters, (nextFilters) => { - // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, - // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES - // ARE NOT UP-TO-DATE! - var _a, _b, _c; - // Find target in nextFilters - const dropTarget = getFilterFromTree(nextFilters, target.id); - const dropItem = getFilterFromTree(nextFilters, item.id); - // Check if the dropped item is part of the tree already - if (dropItem.current) { - // If we have a parent to remove us from... - if ((_a = dropItem.parent) === null || _a === void 0 ? void 0 : _a.children) { - // Find the index of the current element in the parents children - const deleteIndex = dropItem.parent.children.indexOf(dropItem.current); - // Remove it from the current parent - if (deleteIndex !== -1) { - (_c = (_b = dropItem.parent) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c.splice(deleteIndex, 1); - } - } - } - else { - // Otherwise, it is a new item to be added in the next step - dropItem.current = { ...item, id: uuidv4() }; - } - if (dropTarget.current) { - // Next, add it as target child - if (!dropTarget.current.children) { - dropTarget.current.children = []; - } - dropTarget.current.children.splice(index, 0, dropItem.current); - } - else { - console.error('Something is wrong'); - } - })); - }; - const onChange = (filter, changeFunc) => { - setFilters(produce(filters, (nextFilters) => { - const { current, parent } = getFilterFromTree(nextFilters, filter.id); - if (current) { - changeFunc(current); - } - })); - }; - const onValueChanged = (filter, value) => { - onChange(filter, (f) => { - if (f.component) { - f.component.value = value; - } - }); - }; console.log(alerts); + //filter settings reusable // alert overview / edit alert return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), @@ -108,24 +20,36 @@ export function CDCFilterDialog() { React.createElement("div", { className: "modal-dialog", style: { maxWidth: '90%' } }, React.createElement("div", { className: "modal-content" }, React.createElement("div", { className: "modal-header" }, - React.createElement("h5", { className: "modal-title" }, "Modal title"), + React.createElement("h5", { className: "modal-title" }, "Alerts"), React.createElement("button", { type: "button", className: "btn-close", "data-bs-dismiss": "modal", "aria-label": "Close" })), React.createElement("div", { className: "modal-body" }, React.createElement("div", { className: "row" }, - React.createElement("div", { className: "col-md" }, - alertStatus, + React.createElement("div", { className: "col-4 overflow-auto" }, + React.createElement("div", { className: "d-flex w-100 justify-content-between" }, + React.createElement("h5", null, "Your alerts"), + React.createElement("small", null, + React.createElement("button", { className: "btn btn-secondary", onClick: () => { setCreationMode(true); setSelectedAlert(null); } }, "+"))), alertStatus === 'pending' ? React.createElement(React.Fragment, null, "Loading...") : null, alertStatus === 'error' ? React.createElement(React.Fragment, null, "Error ", alertError.toString()) : null, - alertStatus === 'success' ? React.createElement(React.Fragment, null, alerts.map((alert) => React.createElement("li", null, alert.name))) : null), - React.createElement(DndProvider, { backend: HTML5Backend }, - React.createElement("div", { className: "col-md" }, - React.createElement("h5", null, "Your filters"), - React.createElement(FilterCard, { filter: filters, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged })), - React.createElement("div", { className: "col-md" }, - React.createElement("h5", null, "Add new filters"), - filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f }))))))), + alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert, i) => React.createElement(React.Fragment, null, + React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? " border-primary" : ""}`, key: i, onClick: () => { setSelectedAlert(alert); setCreationMode(false); }, "aria-current": "true" }, + React.createElement("div", { className: "d-flex w-100 justify-content-between" }, + React.createElement("h6", { className: "mb-1" }, + alert.name, + " ", + React.createElement("small", { className: "text-muted" }, + "for ", + alert.cdc_id), + " "), + React.createElement("small", null, + React.createElement("span", { className: "badge bg-primary rounded-pill" }, "1"))), + React.createElement("p", { className: "mb-1" }, "Some placeholder content in a paragraph."), + React.createElement("small", null, + "last confirmed: ", + alert.confirmation_date))))) : null), + React.createElement("div", { className: "col-8 overflow-auto" }, creationMode ? (React.createElement(CDCCreateAlert, null)) : (selectedAlert ? React.createElement(CDCEditAlert, { selectedAlert: selectedAlert }) : null)))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", className: "btn btn-primary" }, "Save changes"))))))); diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 08128a556..e07e00eea 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,C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EAAC,qBAAqB,IACjC,YAAY,CAAC,CAAC,CAAC,CACd,oBAAC,cAAc,OAAG,CACnB,CAAC,CAAC,CAAC,CACF,aAAa,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,aAAa,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CACrE,CACG,CACF,CACF;wBACN,6BAAK,SAAS,EAAC,cAAc;4BAC3B,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,mBAAmB,qBAAiB,OAAO,YAAe;4BAC1F,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,mBAAsB,CACnE,CACA,CACF,CACF,CACE,CACX,CAAC;AACN,CAAC;AAED,MAAM,OAAO,oBAAoB;IAG/B,YAAY,MAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAEO,IAAI;QACV,QAAQ,CAAC,MAAM,CACb,oBAAC,eAAe,OAAG,EACnB,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/api.d.ts b/dist/cdc/api.d.ts index 07a066dcc..9064d8448 100644 --- a/dist/cdc/api.d.ts +++ b/dist/cdc/api.d.ts @@ -11,5 +11,6 @@ import { IAlert } from './interface'; export declare function getAlerts(): Promise; export declare function getCommunity(id: string): Promise; -export declare function editCommunity(id: string, community: Partial): Promise; +export declare function editCommunity(id: string, alert: Partial): Promise; export declare function deleteCommunity(id: string): Promise; +export declare function saveCommunity(alert: IAlert): Promise; diff --git a/dist/cdc/api.js b/dist/cdc/api.js index 27830517d..4d56a79c0 100644 --- a/dist/cdc/api.js +++ b/dist/cdc/api.js @@ -11,18 +11,19 @@ import { Ajax, AppContext } from 'phovea_core'; export async function getAlerts() { // return Ajax.send(AppContext.getInstance().api2absURL('/tdp/cdc/alert'), null, 'GET', 'JSON', 'application/json'); + console.log(AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`)); return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`); } export async function getCommunity(id) { - return AppContext.getInstance().getAPIJSON(`/marketplace360/community/${id}`); + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}`); } -export async function editCommunity(id, community) { - return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community/${id}`), community, 'PUT', 'JSON', 'application/json'); +export async function editCommunity(id, alert) { + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), alert, 'PUT', 'JSON', 'application/json'); } export async function deleteCommunity(id) { - return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community/${id}`), null, 'DELETE'); + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), null, 'DELETE'); +} +export async function saveCommunity(alert) { + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/`), alert, 'POST', 'JSON', 'application/json'); } -// export async function saveCommunity(community: IUploadCommunity): Promise { -// return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community`), community, 'POST', 'JSON', 'application/json'); -// } //# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/dist/cdc/api.js.map b/dist/cdc/api.js.map index 92bed2c12..9c3cabbe9 100644 --- a/dist/cdc/api.js.map +++ b/dist/cdc/api.js.map @@ -1 +1 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/cdc/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;2DAS2D;AAE1D,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,SAAS;IAChC,uHAAuH;IACpH,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAC/D,CAAC;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AAsB;IACpE,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC1H,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAU;IAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAa;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACtH,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index bb3763fdf..36844f09c 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -28,4 +28,6 @@ export declare const getTreeQuery: (filter: IFilter) => string; export interface IAlert { id: number; name: string; + cdc_id: string; + confirmation_date: string; } diff --git a/dist/lineup/internal/ScoreUtils.d.ts b/dist/lineup/internal/ScoreUtils.d.ts index 6645a2f5a..2b2abf5d5 100644 --- a/dist/lineup/internal/ScoreUtils.d.ts +++ b/dist/lineup/internal/ScoreUtils.d.ts @@ -7,12 +7,18 @@ export declare class ScoreUtils { static readonly CMD_ADD_SCORE = "tdpAddScore"; static readonly CMD_REMOVE_SCORE = "tdpRemoveScore"; private static addScoreLogic; - static addScoreImpl(inputs: IObjectRef[], parameter: any): any; - static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise; - static removeScoreImpl(inputs: IObjectRef[], parameter: any): any; - static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): any; + static addScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static removeScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): import("phovea_core").IAction; static pushScoreAsync(graph: ProvenanceGraph, provider: IObjectRef, scoreName: string, scoreId: string, params: any): Promise; - static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): any; + static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): import("phovea_core").IAction; private static shallowEqualObjects; /** * compresses score creation and removal diff --git a/dist/utils/TDPApplicationUtils.d.ts b/dist/utils/TDPApplicationUtils.d.ts index fb54ccf2c..e90978b25 100644 --- a/dist/utils/TDPApplicationUtils.d.ts +++ b/dist/utils/TDPApplicationUtils.d.ts @@ -40,10 +40,8 @@ export declare class TDPApplicationUtils { inverse: import("phovea_core").IAction; }; static initSession(map: object): import("phovea_core").IAction; - static setParameterImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static setParameter(view: IObjectRef, name: string, value: any, previousValue: any): import("phovea_core").IAction; + static setParameterImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): any; + static setParameter(view: IObjectRef, name: string, value: any, previousValue: any): any; static compressSetParameter(path: ActionNode[]): ActionNode[]; /** * @deprecated diff --git a/src/cdc/AccordionView.tsx b/src/cdc/AccordionView.tsx new file mode 100644 index 000000000..95950a1f1 --- /dev/null +++ b/src/cdc/AccordionView.tsx @@ -0,0 +1,30 @@ +import React from "react"; + +interface IAccordionViewProps { + parentId: string; + data: {title: string, JSX: JSX.Element, show?: boolean}[] +} + +export function AccordionView({parentId, data}: IAccordionViewProps) { + console.log(parentId, data) + const accordionItem = (index: number, title: string, JSX: JSX.Element, show?: boolean) => { + return ( +
+

+ +

+
+ {JSX} +
+
+ ); + }; + + return ( +
+ {data.map((d, i) => accordionItem(i, d.title, d.JSX, d.show))} +
+ ); +} \ No newline at end of file diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx new file mode 100644 index 000000000..d98c3a58e --- /dev/null +++ b/src/cdc/CDCCreateAlert.tsx @@ -0,0 +1,25 @@ +import React, {useState} from "react"; +import {AccordionView} from "./AccordionView"; +import {CDCFilterComponent} from "./CDCFilterComponent"; + + +export function CDCCreateAlert() { + + const [alertName, setAlertName] = React.useState(""); + + const generalInformation = + (<> +
Name
+ setAlertName(e.target.value)} /> + ); + + const data = [ + {title: "General information", JSX: generalInformation, show: true}, + {title: "Edit filters", JSX: } + ]; + + return (<> +
Your options
+ + ); +} \ No newline at end of file diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx new file mode 100644 index 000000000..86dfa7d5b --- /dev/null +++ b/src/cdc/CDCEditAlert.tsx @@ -0,0 +1,21 @@ +import React from "react" +import {AccordionView} from "./AccordionView"; +import {CDCFilterComponent} from "./CDCFilterComponent" +import {IAlert} from "./interface"; + +interface ICDCEditAlertProps { + selectedAlert: IAlert; +} + +export function CDCEditAlert({selectedAlert} : ICDCEditAlertProps) { + const data = [ + {title: 'Alert overview', JSX:

text aufgeklappt

, show: true}, + {title: 'New literature', JSX:

text aufgeklappt

}, + {title: 'Filter settings', JSX: } + ] + + return (<> +
Your options
+ + ); +} \ No newline at end of file diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx new file mode 100644 index 000000000..82b57504b --- /dev/null +++ b/src/cdc/CDCFilterComponent.tsx @@ -0,0 +1,141 @@ +import produce from "immer"; +import React from "react"; +import {DndProvider} from "react-dnd"; +import {HTML5Backend} from "react-dnd-html5-backend"; +import {createCDCCheckboxFilter} from "./CDCCheckboxFilter"; +import {createCDCGroupingFilter} from "./CDCGroupingFilter"; +import {createCDCRangeFilter} from "./CDCRangeFilter"; +import {createCDCTextFilter} from "./CDCTextFilter"; +import {FilterCard} from "./FilterCard"; +import {getFilterFromTree, getTreeQuery, IFilter} from "./interface"; +import { v4 as uuidv4 } from 'uuid'; + +export function CDCFilterComponent() { + + const [filters, setFilters] = React.useState( + { + ...createCDCGroupingFilter(uuidv4(), + 'Drop filters here'), + disableDragging: true, + disableRemoving: true + } + ); + + React.useEffect(() => { + const test = getTreeQuery(filters); + if (test) { + console.log(test); + } + }, [filters]); + + const filterSelection: IFilter[] = [ + createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), + createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: 'field1', value: []}], fields:[{field: 'field1', options: ['hallo', 'hier', 'steht', 'text']}, {field: 'field2', options: ['tschüss', 'hier', 'nicht']}, {field: 'field3', options: ['test', 'noch ein test', 'hi']}]}), + createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), + createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1950, max: 2021}), + ]; + + const onDelete = (filter: IFilter) => { + setFilters( + produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current && parent && parent.children) { + // Find the index of the current element in the parents children + const deleteIndex = parent.children.indexOf(current); + // Remove it from the current parent + if (deleteIndex !== -1) { + parent.children.splice(deleteIndex, 1); + } + } + }) + ); + }; + + const onDrop = ( + item: IFilter, + { target, index }: { target: IFilter; index: number } + ) => { + // Add item to target children array + setFilters((filters) => + produce(filters, (nextFilters) => { + // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, + // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES + // ARE NOT UP-TO-DATE! + + // Find target in nextFilters + const dropTarget = getFilterFromTree(nextFilters, target.id); + const dropItem = getFilterFromTree(nextFilters, item.id); + + // Check if the dropped item is part of the tree already + if (dropItem.current) { + // If we have a parent to remove us from... + if (dropItem.parent?.children) { + // Find the index of the current element in the parents children + const deleteIndex = dropItem.parent.children.indexOf( + dropItem.current + ); + // Remove it from the current parent + if (deleteIndex !== -1) { + dropItem.parent?.children?.splice(deleteIndex, 1); + } + } + } else { + // Otherwise, it is a new item to be added in the next step + dropItem.current = { ...item, id: uuidv4() }; + } + + if (dropTarget.current) { + // Next, add it as target child + if (!dropTarget.current.children) { + dropTarget.current.children = []; + } + dropTarget.current.children.splice(index, 0, dropItem.current); + } else { + console.error('Something is wrong'); + } + }) + ); + }; + + const onChange = (filter: IFilter, changeFunc: (filter: IFilter) => void) => { + setFilters( + produce(filters, (nextFilters) => { + const { current, parent } = getFilterFromTree(nextFilters, filter.id); + if (current) { + changeFunc(current); + } + }) + ); + }; + + const onValueChanged = (filter: IFilter, value: any) => { + onChange(filter, (f) => { + if (f.component) { + f.component.value = value; + } + }); + }; + + return ( + +
+
+
Your filters
+ +
+
+
New filters
+ {filterSelection.map((f) => ( + + ))} +
+
+
+ ) +} diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 4465545bd..16733e79e 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,128 +1,20 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import { getFilterFromTree, getTreeQuery, IFilter, IFilterComponent } from "./interface"; -import { FilterCard } from './FilterCard'; -import { DndProvider } from 'react-dnd'; -import { HTML5Backend } from 'react-dnd-html5-backend'; -import produce from 'immer'; -import { v4 as uuidv4 } from 'uuid'; -import {createCDCGroupingFilter} from './CDCGroupingFilter'; -import {createCDCTextFilter} from './CDCTextFilter'; -import {createCDCCheckboxFilter} from './CDCCheckboxFilter'; -import {createCDCRangeFilter} from './CDCRangeFilter'; +import { getFilterFromTree, getTreeQuery, IAlert, IFilter, IFilterComponent } from "./interface"; import {getAlerts} from './api'; +import {CDCEditAlert} from './CDCEditAlert'; +import {CDCCreateAlert} from './CDCCreateAlert'; export function CDCFilterDialog() { + const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); - const [filters, setFilters] = React.useState( - { - ...createCDCGroupingFilter(uuidv4(), - 'Drop filters here'), - disableDragging: true, - disableRemoving: true - } - ); - - const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); - - const filterSelection: IFilter[] = [ - createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: 'field1', value: []}], fields:[{field: 'field1', options: ['hallo', 'hier', 'steht', 'text']}, {field: 'field2', options: ['tschüss', 'hier', 'nicht']}, {field: 'field3', options: ['test', 'noch ein test', 'hi']}]}), - createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), - createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1950, max: 2021}), - ]; - - React.useEffect(() => { - const test = getTreeQuery(filters); - if (test) { - console.log(test); - } - }, [filters]); - - const onDelete = (filter: IFilter) => { - setFilters( - produce(filters, (nextFilters) => { - const { current, parent } = getFilterFromTree(nextFilters, filter.id); - if (current && parent && parent.children) { - // Find the index of the current element in the parents children - const deleteIndex = parent.children.indexOf(current); - // Remove it from the current parent - if (deleteIndex !== -1) { - parent.children.splice(deleteIndex, 1); - } - } - }) - ); - }; - - const onDrop = ( - item: IFilter, - { target, index }: { target: IFilter; index: number } - ) => { - // Add item to target children array - setFilters((filters) => - produce(filters, (nextFilters) => { - // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, - // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES - // ARE NOT UP-TO-DATE! + const [creationMode, setCreationMode] = React.useState(false); - // Find target in nextFilters - const dropTarget = getFilterFromTree(nextFilters, target.id); - const dropItem = getFilterFromTree(nextFilters, item.id); - - // Check if the dropped item is part of the tree already - if (dropItem.current) { - // If we have a parent to remove us from... - if (dropItem.parent?.children) { - // Find the index of the current element in the parents children - const deleteIndex = dropItem.parent.children.indexOf( - dropItem.current - ); - // Remove it from the current parent - if (deleteIndex !== -1) { - dropItem.parent?.children?.splice(deleteIndex, 1); - } - } - } else { - // Otherwise, it is a new item to be added in the next step - dropItem.current = { ...item, id: uuidv4() }; - } - - if (dropTarget.current) { - // Next, add it as target child - if (!dropTarget.current.children) { - dropTarget.current.children = []; - } - dropTarget.current.children.splice(index, 0, dropItem.current); - } else { - console.error('Something is wrong'); - } - }) - ); - }; - - const onChange = (filter: IFilter, changeFunc: (filter: IFilter) => void) => { - setFilters( - produce(filters, (nextFilters) => { - const { current, parent } = getFilterFromTree(nextFilters, filter.id); - if (current) { - changeFunc(current); - } - }) - ); - }; - - const onValueChanged = (filter: IFilter, value: any) => { - onChange(filter, (f) => { - if (f.component) { - f.component.value = value; - } - }); - }; - - console.log(alerts) + const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); + console.log(alerts); + //filter settings reusable // alert overview / edit alert return <> setShowDialog(true)}> Alert Filter @@ -131,35 +23,36 @@ export function CDCFilterDialog() {
-
Modal title
+
Alerts
-
{alertStatus} +
+
+
Your alerts
+ +
{alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} - {alertStatus === 'success' ? <>{alerts.map((alert) =>
  • {alert.name}
  • )} : null} + {alertStatus === 'success' ? : null} +
    +
    + {creationMode ? ( + + ) : ( + selectedAlert ? : null + )}
    - -
    -
    Your filters
    - -
    -
    -
    Add new filters
    - {filterSelection.map((f) => ( - - ))} -
    -
    -
    diff --git a/src/cdc/api.ts b/src/cdc/api.ts index 7af43cdc6..a29cd829b 100644 --- a/src/cdc/api.ts +++ b/src/cdc/api.ts @@ -14,21 +14,22 @@ export async function getAlerts(): Promise { // return Ajax.send(AppContext.getInstance().api2absURL('/tdp/cdc/alert'), null, 'GET', 'JSON', 'application/json'); + console.log(AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`)) return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`); } export async function getCommunity(id: string): Promise { - return AppContext.getInstance().getAPIJSON(`/marketplace360/community/${id}`); + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}`); } - export async function editCommunity(id: string, community: Partial): Promise { - return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community/${id}`), community, 'PUT', 'JSON', 'application/json'); + export async function editCommunity(id: string, alert: Partial): Promise { + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), alert, 'PUT', 'JSON', 'application/json'); } export async function deleteCommunity(id: string): Promise { - return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community/${id}`), null, 'DELETE'); + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), null, 'DELETE'); } -// export async function saveCommunity(community: IUploadCommunity): Promise { -// return Ajax.send(AppContext.getInstance().api2absURL(`/marketplace360/community`), community, 'POST', 'JSON', 'application/json'); -// } + export async function saveCommunity(alert: IAlert): Promise { + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/`), alert, 'POST', 'JSON', 'application/json'); + } diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index b95315139..816715512 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -90,4 +90,6 @@ export const getTreeQuery = (filter: IFilter) => { export interface IAlert { id: number; name: string; -} \ No newline at end of file + cdc_id: string; + confirmation_date: string; +} diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index 401819ea4..8e43356c1 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -64,7 +64,8 @@ class Meta(CDCAlertSchema.Meta): 'creator', 'creation_date', 'modifier', - 'modification_date' + 'modification_date', + 'permissions' ) # TODO: Remove and use postgres diff --git a/tdp_core/cdc/DemoCDC.py b/tdp_core/cdc/DemoCDC.py index 078bc5770..5d5b08bc4 100644 --- a/tdp_core/cdc/DemoCDC.py +++ b/tdp_core/cdc/DemoCDC.py @@ -26,38 +26,4 @@ def compare(self, old, new): new = new or [] old_lookup = {self.get_id(item): item for item in old} new_lookup = {self.get_id(item): item for item in new} - - _log.info(old_lookup) - _log.info(new_lookup) - - old_ids = set(old_lookup.keys()) - new_ids = set(new_lookup.keys()) - - added = new_ids - old_ids - removed = old_ids - new_ids - - changed = set() - unchanged = new_ids.intersection(old_ids) - - old_unchanged = [old_lookup[id] for id in unchanged] - new_unchanged = [new_lookup[id] for id in unchanged] - - # {} - # {1: {name: ..}, 2: {name: ...}} - return DeepDiff(old_lookup, new_lookup).to_json() - - deep_diff = DeepDiff(old, new, group_by='id') - - # Added: dictionary_item_added - # Field changed: values_changed, i.e. \"values_changed\": {\"root[6]['name']\": {\"new_value\": \"Mrs. Dennis Schulist\", \"old_value\": \"Hello world\"}} - - # deep_delta = Delta(deep_diff) - - return deep_diff.to_json() - - return { - 'added': list(added), - 'removed': list(removed), - 'changed': list(changed), - 'unchanged': list(unchanged) - } + return DeepDiff(old_lookup, new_lookup).to_json() \ No newline at end of file diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 0c287b132..89407db79 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -58,7 +58,6 @@ def get_alerts(): alerts = session.query(CDCAlert).all() return [p for p in alerts if can_read(p)] - @no_cache @login_required @blp.route('/alert', methods=["POST"]) From ce35184fca6c56273b0a3d13b3ffd826badbbcb5 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Wed, 20 Oct 2021 20:15:12 +0200 Subject: [PATCH 06/40] alignments in UI + send formdata of dialog to backend --- dist/cdc/AccordianItem.d.ts | 10 +++ dist/cdc/AccordianItem.js | 10 +++ dist/cdc/AccordianItem.js.map | 1 + dist/cdc/AccordionView.js | 3 +- dist/cdc/AccordionView.js.map | 2 +- dist/cdc/CDCCheckboxFilter.js | 4 +- dist/cdc/CDCCheckboxFilter.js.map | 2 +- dist/cdc/CDCCreateAlert.d.ts | 9 ++- dist/cdc/CDCCreateAlert.js | 4 +- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCCreateEditAlert.d.ts | 13 +++ dist/cdc/CDCCreateEditAlert.js | 24 ++++++ dist/cdc/CDCCreateEditAlert.js.map | 1 + dist/cdc/CDCEditAlert.js | 13 ++- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterComponent.d.ts | 9 ++- dist/cdc/CDCFilterComponent.js | 49 +++++------- dist/cdc/CDCFilterComponent.js.map | 2 +- dist/cdc/CDCFilterDialog.d.ts | 5 ++ dist/cdc/CDCFilterDialog.js | 56 ++++++++++--- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/api.d.ts | 8 +- dist/cdc/api.js | 10 +-- dist/cdc/api.js.map | 2 +- dist/cdc/interface.d.ts | 7 +- src/cdc/AccordionView.tsx | 5 +- src/cdc/CDCCheckboxFilter.tsx | 4 +- src/cdc/CDCCreateAlert.tsx | 25 ------ src/cdc/CDCCreateEditAlert.tsx | 46 +++++++++++ src/cdc/CDCEditAlert.tsx | 21 ----- src/cdc/CDCFilterComponent.tsx | 122 +++++++++++++---------------- src/cdc/CDCFilterDialog.tsx | 72 ++++++++++++++--- src/cdc/api.ts | 10 +-- src/cdc/interface.ts | 7 +- tdp_core/cdc/api.py | 2 +- 35 files changed, 358 insertions(+), 206 deletions(-) create mode 100644 dist/cdc/AccordianItem.d.ts create mode 100644 dist/cdc/AccordianItem.js create mode 100644 dist/cdc/AccordianItem.js.map create mode 100644 dist/cdc/CDCCreateEditAlert.d.ts create mode 100644 dist/cdc/CDCCreateEditAlert.js create mode 100644 dist/cdc/CDCCreateEditAlert.js.map delete mode 100644 src/cdc/CDCCreateAlert.tsx create mode 100644 src/cdc/CDCCreateEditAlert.tsx delete mode 100644 src/cdc/CDCEditAlert.tsx diff --git a/dist/cdc/AccordianItem.d.ts b/dist/cdc/AccordianItem.d.ts new file mode 100644 index 000000000..d9cb08adc --- /dev/null +++ b/dist/cdc/AccordianItem.d.ts @@ -0,0 +1,10 @@ +/// +interface IAccordionItem { + children: JSX.Element; + index: number; + title: string; + parentId: string; + show?: boolean; +} +export default function AccordionItem({ children, index, title, parentId, show }: IAccordionItem): JSX.Element; +export {}; diff --git a/dist/cdc/AccordianItem.js b/dist/cdc/AccordianItem.js new file mode 100644 index 000000000..cbe32694c --- /dev/null +++ b/dist/cdc/AccordianItem.js @@ -0,0 +1,10 @@ +import React from "react"; +export default function AccordionItem({ children, index, title, parentId, show }) { + // index: number, title: string, parentId: string, , show?: boolean + console.log(this); + return (React.createElement("div", { className: "accordion-item" }, + React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), + React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId.trim()}` }, children))); +} +//# sourceMappingURL=AccordianItem.js.map \ No newline at end of file diff --git a/dist/cdc/AccordianItem.js.map b/dist/cdc/AccordianItem.js.map new file mode 100644 index 000000000..da088194d --- /dev/null +++ b/dist/cdc/AccordianItem.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AccordianItem.js","sourceRoot":"","sources":["../../src/cdc/AccordianItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAiB;IAE5F,mEAAmE;IACnE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAEf,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;QAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;YACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;QACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,IACvK,QAAQ,CACL,CACF,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/AccordionView.js b/dist/cdc/AccordionView.js index ed61f4898..4aa9ec1c8 100644 --- a/dist/cdc/AccordionView.js +++ b/dist/cdc/AccordionView.js @@ -1,8 +1,7 @@ import React from "react"; export function AccordionView({ parentId, data }) { - console.log(parentId, data); const accordionItem = (index, title, JSX, show) => { - return (React.createElement("div", { className: "accordion-item" }, + return (React.createElement("div", { key: index, className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId.trim()}` }, JSX))); diff --git a/dist/cdc/AccordionView.js.map b/dist/cdc/AccordionView.js.map index b3eca5b10..7355abed7 100644 --- a/dist/cdc/AccordionView.js.map +++ b/dist/cdc/AccordionView.js.map @@ -1 +1 @@ -{"version":3,"file":"AccordionView.js","sourceRoot":"","sources":["../../src/cdc/AccordionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,UA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C,KAAa,EAAE,KAAa,EAAE,GAAgB,EAAE,IAAc,EAAE,EAAE;QACvF,OAAO,CACL,6BAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,gBAAgB;YACzC,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,IACvK,GAAG,CACA,CACF,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,IAC3C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CACzD,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCheckboxFilter.js b/dist/cdc/CDCCheckboxFilter.js index db45e3f30..19d089d92 100644 --- a/dist/cdc/CDCCheckboxFilter.js +++ b/dist/cdc/CDCCheckboxFilter.js @@ -16,8 +16,8 @@ function CDCCheckboxFilterToString(value) { return `(${value === null || value === void 0 ? void 0 : value.fields.map((v) => { return `${v} == ${value.filter.filter((f) => f === v).length > 0}`; }).join(' and ')})`; } export function CDCCheckboxFilter({ value, onValueChanged }) { - return React.createElement(React.Fragment, null, value.fields.map((v) => { - return (React.createElement("div", { className: "input-group m-1" }, + return React.createElement(React.Fragment, null, value.fields.map((v, i) => { + return (React.createElement("div", { key: i, className: "input-group m-1" }, React.createElement("div", { className: "form-check" }, React.createElement("input", { className: "form-check-input", type: "checkbox", id: "flexCheckDefault", checked: value.filter.filter((f) => f === v).length > 0, disabled: !onValueChanged, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, diff --git a/dist/cdc/CDCCheckboxFilter.js.map b/dist/cdc/CDCCheckboxFilter.js.map index 9b0b4d100..6af3526c6 100644 --- a/dist/cdc/CDCCheckboxFilter.js.map +++ b/dist/cdc/CDCCheckboxFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA8B;IAC9F,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,QAAQ,EAAE,yBAAyB;YACnC,KAAK;SACN;KACF,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,KAA8B;IAC/D,6BAA6B;IAC7B,OAAO,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,GAAG,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAA,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AAC9H,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAE,KAAK,EAA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AC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;4BAC5C,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;4BACrC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;qBAC3B,CAAC,GAEJ;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,CAAC,CACI,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/CDCCreateAlert.d.ts index 67a9260f8..193eb14b6 100644 --- a/dist/cdc/CDCCreateAlert.d.ts +++ b/dist/cdc/CDCCreateAlert.d.ts @@ -1,2 +1,9 @@ /// -export declare function CDCCreateAlert(): JSX.Element; +import { IFilter } from "./interface"; +interface ICDCCreateAlert { + filter: IFilter; + setFilter: (filter: IFilter) => void; + filterSelection: IFilter[]; +} +export declare function CDCCreateAlert({ filter, setFilter, filterSelection }: ICDCCreateAlert): JSX.Element; +export {}; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index be15a760e..c72ea8a90 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -1,14 +1,14 @@ import React from "react"; import { AccordionView } from "./AccordionView"; import { CDCFilterComponent } from "./CDCFilterComponent"; -export function CDCCreateAlert() { +export function CDCCreateAlert({ filter, setFilter, filterSelection }) { const [alertName, setAlertName] = React.useState(""); const generalInformation = (React.createElement(React.Fragment, null, React.createElement("h6", null, "Name"), React.createElement("input", { type: "text", value: alertName, onChange: (e) => setAlertName(e.target.value) }))); const data = [ { title: "General information", JSX: generalInformation, show: true }, - { title: "Edit filters", JSX: React.createElement(CDCFilterComponent, null) } + { title: "Edit filters", JSX: React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filter: filter, setFilter: setFilter }) } ]; return (React.createElement(React.Fragment, null, React.createElement("h5", null, "Your options"), diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index 0c10675e4..523a77a73 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAGxD,MAAM,UAAU,cAAc;IAE5B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE7D,MAAM,kBAAkB,GACxB,CAAC;QACC,uCAAa;QACb,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,CACrF,CAAC,CAAC;IAEL,MAAM,IAAI,GAAG;QACX,EAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAC,kBAAkB,OAAG,EAAC;KACrD,CAAC;IAEF,OAAO,CAAC;QACJ,+CAAqB;QACrB,oBAAC,aAAa,IAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAI,CACvD,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAcxD,MAAM,UAAU,cAAc,CAAC,EAAC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAkB;IAClF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE7D,MAAM,kBAAkB,GACxB,CAAC;QACC,uCAAa;QACb,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,CACrF,CAAC,CAAC;IAEL,MAAM,IAAI,GAAG;QACX,EAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,EAAC;KAC7H,CAAC;IAEF,OAAO,CAAC;QACJ,+CAAqB;QACrB,oBAAC,aAAa,IAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAI,CACvD,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateEditAlert.d.ts b/dist/cdc/CDCCreateEditAlert.d.ts new file mode 100644 index 000000000..645051457 --- /dev/null +++ b/dist/cdc/CDCCreateEditAlert.d.ts @@ -0,0 +1,13 @@ +/// +import { ICDCFormData } from "."; +import { IAlert, IFilter } from "./interface"; +interface ICDCCreateEditAlert { + formData: ICDCFormData; + setFormData: (formData: ICDCFormData) => void; + selectedAlert?: IAlert; + filterSelection: IFilter[]; + filter: IFilter; + setFilter: (filter: IFilter) => void; +} +export declare function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter }: ICDCCreateEditAlert): JSX.Element; +export {}; diff --git a/dist/cdc/CDCCreateEditAlert.js b/dist/cdc/CDCCreateEditAlert.js new file mode 100644 index 000000000..62f9bd7b8 --- /dev/null +++ b/dist/cdc/CDCCreateEditAlert.js @@ -0,0 +1,24 @@ +import React from "react"; +import { AccordionView } from "./AccordionView"; +import { CDCFilterComponent } from "./CDCFilterComponent"; +export function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter }) { + const generalInformation = (React.createElement(React.Fragment, null, + React.createElement("h6", null, "Name"), + React.createElement("input", { type: "text", value: formData.name, onChange: (e) => setFormData({ ...formData, name: e.target.value }) }), + React.createElement("h6", null, "Email notification"), + React.createElement("input", { className: "form-check-input", type: "checkbox", checked: formData.enable_mail_notification, onChange: (e) => setFormData({ ...formData, enable_mail_notification: e.target.checked }) }), + React.createElement("h6", null, "CDC"), + React.createElement("input", { type: "text", value: formData.cdc_id, onChange: (e) => setFormData({ ...formData, cdc_id: e.target.value }) }))); + const data = selectedAlert ? [ + { title: 'Alert overview', JSX: generalInformation, show: true }, + { title: 'New literature', JSX: React.createElement("p", null, "text aufgeklappt") }, + { title: 'Filter settings', JSX: React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filter: filter, setFilter: setFilter }) } + ] : [ + { title: "General information", JSX: generalInformation, show: true }, + { title: "Edit filters", JSX: React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filter: filter, setFilter: setFilter }) } + ]; + return (React.createElement(React.Fragment, null, + React.createElement("h5", null, "Your options"), + React.createElement(AccordionView, { parentId: "createAlert", data: data }))); +} +//# sourceMappingURL=CDCCreateEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCCreateEditAlert.js.map b/dist/cdc/CDCCreateEditAlert.js.map new file mode 100644 index 000000000..a5614d053 --- /dev/null +++ b/dist/cdc/CDCCreateEditAlert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCCreateEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAYxD,MAAM,UAAU,kBAAkB,CAAC,EAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAsB;IAEhI,MAAM,kBAAkB,GACxB,CAAC;QACC,uCAAa;QACb,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAC,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAC,CAAC,GAAG;QAC7G,qDAA2B;QAC3B,+BACE,SAAS,EAAC,kBAAkB,EAC5B,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,QAAQ,CAAC,wBAAwB,EAC1C,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAC,GAAG,QAAQ,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GACvF;QACF,sCAAY;QACZ,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAC,CAAC,GAAG,CAChH,CAAC,CAAC;IAEL,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC;QAC3B,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAC;QAC9D,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAC;QACvD,EAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,EAAC;KAChI,CAAC,CAAC,CAAC;QACF,EAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,EAAC;KAC7H,CAAC;IAEF,OAAO,CAAC;QACJ,+CAAqB;QACrB,oBAAC,aAAa,IAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAI,CACvD,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index 47c2ca19f..0de115a27 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -1,11 +1,22 @@ import React from "react"; import { AccordionView } from "./AccordionView"; import { CDCFilterComponent } from "./CDCFilterComponent"; +import { createCDCGroupingFilter } from "./CDCGroupingFilter"; +import { createCDCRangeFilter } from "./CDCRangeFilter"; +import { createCDCTextFilter } from "./CDCTextFilter"; +import { v4 as uuidv4 } from 'uuid'; +import { createCDCCheckboxFilter } from "./CDCCheckboxFilter"; export function CDCEditAlert({ selectedAlert }) { + const filterSelection = [ + createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), + createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), + createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), + createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), + ]; const data = [ { title: 'Alert overview', JSX: React.createElement("p", null, "text aufgeklappt"), show: true }, { title: 'New literature', JSX: React.createElement("p", null, "text aufgeklappt") }, - { title: 'Filter settings', JSX: React.createElement(CDCFilterComponent, null) } + { title: 'Filter settings', JSX: React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filter: filter, setFilter: setFilter }) } ]; return (React.createElement(React.Fragment, null, React.createElement("h5", null, "Your options"), diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index d63c4446e..1f87243ff 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAOvD,MAAM,UAAU,YAAY,CAAC,EAAC,aAAa,EAAsB;IAC/D,MAAM,IAAI,GAAG;QACX,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAC;QACvD,EAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAC,kBAAkB,OAAG,EAAC;KACxD,CAAA;IAED,OAAO,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,CAAC;QACtR,uBAAuB,CAAC,MAAM,EAAE,EAAE,iBAAiB,EAAE,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QACpG,oBAAoB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAC,CAAC;KACvE,CAAC;IAEF,MAAM,IAAI,GAAG;QACX,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAE,IAAI,EAAE,IAAI,EAAC;QACnE,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,kDAAuB,EAAC;QACvD,EAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,EAAC;KAChI,CAAA;IAED,OAAO,CAAC;QACJ,+CAAqB;QACrB,oBAAC,aAAa,IAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,GAAG,CACxD,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.d.ts b/dist/cdc/CDCFilterComponent.d.ts index 186749033..fb21391d2 100644 --- a/dist/cdc/CDCFilterComponent.d.ts +++ b/dist/cdc/CDCFilterComponent.d.ts @@ -1,2 +1,9 @@ /// -export declare function CDCFilterComponent(): JSX.Element; +import { IFilter } from "./interface"; +interface ICDCFilterComponentProps { + filterSelection: IFilter[]; + filter: IFilter; + setFilter: (filter: IFilter) => void; +} +export declare function CDCFilterComponent({ filterSelection, filter, setFilter }: ICDCFilterComponentProps): JSX.Element; +export {}; diff --git a/dist/cdc/CDCFilterComponent.js b/dist/cdc/CDCFilterComponent.js index ae5d47d25..7a468ba7e 100644 --- a/dist/cdc/CDCFilterComponent.js +++ b/dist/cdc/CDCFilterComponent.js @@ -2,34 +2,19 @@ import produce from "immer"; import React from "react"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; -import { createCDCCheckboxFilter } from "./CDCCheckboxFilter"; -import { createCDCGroupingFilter } from "./CDCGroupingFilter"; -import { createCDCRangeFilter } from "./CDCRangeFilter"; -import { createCDCTextFilter } from "./CDCTextFilter"; import { FilterCard } from "./FilterCard"; import { getFilterFromTree, getTreeQuery } from "./interface"; import { v4 as uuidv4 } from 'uuid'; -export function CDCFilterComponent() { - const [filters, setFilters] = React.useState({ - ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), - disableDragging: true, - disableRemoving: true - }); +export function CDCFilterComponent({ filterSelection, filter, setFilter }) { React.useEffect(() => { - const test = getTreeQuery(filters); + const test = getTreeQuery(filter); if (test) { console.log(test); } - }, [filters]); - const filterSelection = [ - createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), - createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), - createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), - ]; - const onDelete = (filter) => { - setFilters(produce(filters, (nextFilters) => { - const { current, parent } = getFilterFromTree(nextFilters, filter.id); + }, [filter]); + const onDelete = (newFilter) => { + setFilter(produce(filter, (nextFilter) => { + const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); if (current && parent && parent.children) { // Find the index of the current element in the parents children const deleteIndex = parent.children.indexOf(current); @@ -42,14 +27,15 @@ export function CDCFilterComponent() { }; const onDrop = (item, { target, index }) => { // Add item to target children array - setFilters((filters) => produce(filters, (nextFilters) => { - // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilters, + //TODO: remove any - but TS won't stop complaining + const newFilter = (filter) => produce(filter, (nextFilter) => { + // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilter, // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES // ARE NOT UP-TO-DATE! var _a, _b, _c; - // Find target in nextFilters - const dropTarget = getFilterFromTree(nextFilters, target.id); - const dropItem = getFilterFromTree(nextFilters, item.id); + // Find target in nextFilter + const dropTarget = getFilterFromTree(nextFilter, target.id); + const dropItem = getFilterFromTree(nextFilter, item.id); // Check if the dropped item is part of the tree already if (dropItem.current) { // If we have a parent to remove us from... @@ -76,11 +62,12 @@ export function CDCFilterComponent() { else { console.error('Something is wrong'); } - })); + }); + setFilter(newFilter); }; - const onChange = (filter, changeFunc) => { - setFilters(produce(filters, (nextFilters) => { - const { current, parent } = getFilterFromTree(nextFilters, filter.id); + const onChange = (newFilter, changeFunc) => { + setFilter(produce(filter, (nextFilter) => { + const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); if (current) { changeFunc(current); } @@ -97,7 +84,7 @@ export function CDCFilterComponent() { React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "Your filters"), - React.createElement(FilterCard, { filter: filters, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged })), + React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged })), React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "New filters"), filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f }))))))); diff --git a/dist/cdc/CDCFilterComponent.js.map b/dist/cdc/CDCFilterComponent.js.map index 4b2e7dba5..3a6ebced3 100644 --- a/dist/cdc/CDCFilterComponent.js.map +++ b/dist/cdc/CDCFilterComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],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C,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAI,CACnC,CAAC,CACA,CACJ,CACM,CACb,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index 95d50eebe..ef662409d 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -1,4 +1,9 @@ /// +export interface ICDCFormData { + name: string; + cdc_id: string; + enable_mail_notification: boolean; +} export declare function CDCFilterDialog(): JSX.Element; export declare class CDCFilterDialogClass { private node; diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 04bad616a..0a28fe83c 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -1,16 +1,54 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import { BSModal, useAsync } from '../hooks'; -import { getAlerts } from './api'; -import { CDCEditAlert } from './CDCEditAlert'; -import { CDCCreateAlert } from './CDCCreateAlert'; +import { getAlerts, saveAlert } from './api'; +import { CDCCreateEditAlert } from './CDCCreateEditAlert'; +import { createCDCGroupingFilter } from './CDCGroupingFilter'; +import { v4 as uuidv4 } from 'uuid'; +import { createCDCTextFilter } from './CDCTextFilter'; +import { createCDCCheckboxFilter } from './CDCCheckboxFilter'; +import { createCDCRangeFilter } from './CDCRangeFilter'; export function CDCFilterDialog() { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); + const [filter, setFilter] = React.useState(); + const [formData, setFormData] = React.useState(); + React.useEffect(() => { + setFormData({ + name: "", + enable_mail_notification: false, + cdc_id: "", + }); + setFilter({ + ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), + disableDragging: true, + disableRemoving: true + }); + }, []); + React.useEffect(() => { + console.log(selectedAlert); + if (selectedAlert) { + setFormData(selectedAlert); + if (selectedAlert.filter) { + JSON.parse(selectedAlert.filter).then((test) => { + setFilter(test); + }).catch((e) => console.log(e)); + } + } + }, [selectedAlert]); + const filterSelection = [ + createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), + createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), + createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), + createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), + ]; const { status: alertStatus, error: alertError, execute: alertExecute, value: alerts } = useAsync(getAlerts, true); - console.log(alerts); - //filter settings reusable // alert overview / edit alert + const onSave = () => { + //TODO: put group away again + saveAlert({ ...formData, filter: JSON.stringify(filter), group: "hi" }); + }; + // console.log(alerts); return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), @@ -33,8 +71,8 @@ export function CDCFilterDialog() { alertStatus === 'error' ? React.createElement(React.Fragment, null, "Error ", alertError.toString()) : null, - alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert, i) => React.createElement(React.Fragment, null, - React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? " border-primary" : ""}`, key: i, onClick: () => { setSelectedAlert(alert); setCreationMode(false); }, "aria-current": "true" }, + alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert, i) => React.createElement("div", { key: i }, + React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? " border-primary" : ""}`, onClick: () => { setSelectedAlert(alert); setCreationMode(false); }, "aria-current": "true" }, React.createElement("div", { className: "d-flex w-100 justify-content-between" }, React.createElement("h6", { className: "mb-1" }, alert.name, @@ -49,10 +87,10 @@ export function CDCFilterDialog() { React.createElement("small", null, "last confirmed: ", alert.confirmation_date))))) : null), - React.createElement("div", { className: "col-8 overflow-auto" }, creationMode ? (React.createElement(CDCCreateAlert, null)) : (selectedAlert ? React.createElement(CDCEditAlert, { selectedAlert: selectedAlert }) : null)))), + React.createElement("div", { className: "col-8 overflow-auto" }, creationMode ? (React.createElement(CDCCreateEditAlert, { filter: filter, setFilter: setFilter, formData: formData, setFormData: setFormData, filterSelection: filterSelection })) : (selectedAlert ? React.createElement(CDCCreateEditAlert, { filter: filter, setFilter: setFilter, formData: formData, setFormData: setFormData, filterSelection: filterSelection, selectedAlert: selectedAlert }) : null)))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), - React.createElement("button", { type: "button", className: "btn btn-primary" }, "Save changes"))))))); + React.createElement("button", { type: "button", className: "btn btn-primary", onClick: () => onSave() }, "Save changes"))))))); } export class CDCFilterDialogClass { constructor(parent) { diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index e07e00eea..c5b134cf6 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,a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,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CACjM,CACG,CACF,CACF;wBACN,6BAAK,SAAS,EAAC,cAAc;4BAC3B,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,mBAAmB,qBAAiB,OAAO,YAAe;4BAC1F,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,mBAAuB,CAC5F,CACA,CACF,CACF,CACE,CACX,CAAC;AACN,CAAC;AAED,MAAM,OAAO,oBAAoB;IAG/B,YAAY,MAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAEO,IAAI;QACV,QAAQ,CAAC,MAAM,CACb,oBAAC,eAAe,OAAG,EACnB,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/api.d.ts b/dist/cdc/api.d.ts index 9064d8448..9a28d1fab 100644 --- a/dist/cdc/api.d.ts +++ b/dist/cdc/api.d.ts @@ -10,7 +10,7 @@ *********************************************************/ import { IAlert } from './interface'; export declare function getAlerts(): Promise; -export declare function getCommunity(id: string): Promise; -export declare function editCommunity(id: string, alert: Partial): Promise; -export declare function deleteCommunity(id: string): Promise; -export declare function saveCommunity(alert: IAlert): Promise; +export declare function getAlertsById(id: string): Promise; +export declare function editAlert(id: string, alert: Partial): Promise; +export declare function deleteAlert(id: string): Promise; +export declare function saveAlert(alert: IAlert): Promise; diff --git a/dist/cdc/api.js b/dist/cdc/api.js index 4d56a79c0..fc000b129 100644 --- a/dist/cdc/api.js +++ b/dist/cdc/api.js @@ -14,16 +14,16 @@ export async function getAlerts() { console.log(AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`)); return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`); } -export async function getCommunity(id) { +export async function getAlertsById(id) { return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}`); } -export async function editCommunity(id, alert) { +export async function editAlert(id, alert) { return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), alert, 'PUT', 'JSON', 'application/json'); } -export async function deleteCommunity(id) { +export async function deleteAlert(id) { return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), null, 'DELETE'); } -export async function saveCommunity(alert) { - return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/`), alert, 'POST', 'JSON', 'application/json'); +export async function saveAlert(alert) { + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert`), alert, 'POST', 'JSON', 'application/json'); } //# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/dist/cdc/api.js.map b/dist/cdc/api.js.map index 9c3cabbe9..2c1acee70 100644 --- a/dist/cdc/api.js.map +++ b/dist/cdc/api.js.map @@ -1 +1 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/cdc/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;2DAS2D;AAE1D,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,SAAS;IAChC,uHAAuH;IACnH,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAA;IACnE,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAU;I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W,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,EAAU,EAAE,KAAsB;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC1H,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAU;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAa;IAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACrH,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index 36844f09c..8dd3d1813 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -26,8 +26,11 @@ export declare const getFilterFromTree: (filter: IFilter, id: string) => { }; export declare const getTreeQuery: (filter: IFilter) => string; export interface IAlert { - id: number; + id?: number; name: string; cdc_id: string; - confirmation_date: string; + confirmation_date?: string; + filter: string; + enable_mail_notification: boolean; + group: string; } diff --git a/src/cdc/AccordionView.tsx b/src/cdc/AccordionView.tsx index 95950a1f1..a36da701b 100644 --- a/src/cdc/AccordionView.tsx +++ b/src/cdc/AccordionView.tsx @@ -2,14 +2,13 @@ import React from "react"; interface IAccordionViewProps { parentId: string; - data: {title: string, JSX: JSX.Element, show?: boolean}[] + data: {title: string, JSX: JSX.Element, show?: boolean}[]; } export function AccordionView({parentId, data}: IAccordionViewProps) { - console.log(parentId, data) const accordionItem = (index: number, title: string, JSX: JSX.Element, show?: boolean) => { return ( -
    +

    - +

    diff --git a/src/cdc/api.ts b/src/cdc/api.ts index a29cd829b..ee37b9c52 100644 --- a/src/cdc/api.ts +++ b/src/cdc/api.ts @@ -18,18 +18,18 @@ return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert`); } - export async function getCommunity(id: string): Promise { + export async function getAlertsById(id: string): Promise { return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}`); } - export async function editCommunity(id: string, alert: Partial): Promise { + export async function editAlert(id: string, alert: Partial): Promise { return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), alert, 'PUT', 'JSON', 'application/json'); } - export async function deleteCommunity(id: string): Promise { + export async function deleteAlert(id: string): Promise { return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/${id}`), null, 'DELETE'); } - export async function saveCommunity(alert: IAlert): Promise { - return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert/`), alert, 'POST', 'JSON', 'application/json'); + export async function saveAlert(alert: IAlert): Promise { + return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert`), alert, 'POST', 'JSON', 'application/json'); } diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index 816715512..b8276ee08 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -88,8 +88,11 @@ export const getTreeQuery = (filter: IFilter) => { export interface IAlert { - id: number; + id?: number; name: string; cdc_id: string; - confirmation_date: string; + confirmation_date?: string; + filter: string; + enable_mail_notification: boolean; + group: string; } diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 89407db79..f570afd33 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -70,7 +70,7 @@ def create_alert(data): # Security alert.creator = current_username() alert.creation_date = datetime.utcnow() - alert.group = "" + alert.group = "test" # Allow no one to see, and only the creator/buddy to edit # Use permissions from endpoint # alert.permissions = 7700 From c892110b9a7f7110e2d685b08443f6374521a157 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Thu, 21 Oct 2021 17:00:02 +0200 Subject: [PATCH 07/40] refactoring filter components to split jsonify and functions + UI improvements --- dist/cdc/CDCCheckboxFilter.d.ts | 6 +- dist/cdc/CDCCheckboxFilter.js | 14 +-- dist/cdc/CDCCheckboxFilter.js.map | 2 +- dist/cdc/CDCCreateEditAlert.d.ts | 11 ++- dist/cdc/CDCCreateEditAlert.js | 51 ++++++---- dist/cdc/CDCCreateEditAlert.js.map | 2 +- dist/cdc/CDCFilterComponent.d.ts | 13 ++- dist/cdc/CDCFilterComponent.js | 28 +++--- dist/cdc/CDCFilterComponent.js.map | 2 +- dist/cdc/CDCFilterDialog.d.ts | 10 +- dist/cdc/CDCFilterDialog.js | 96 ++++++++++++------- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CDCGroupingFilter.d.ts | 4 +- dist/cdc/CDCGroupingFilter.js | 11 ++- dist/cdc/CDCGroupingFilter.js.map | 2 +- dist/cdc/CDCRangeFilter.d.ts | 4 +- dist/cdc/CDCRangeFilter.js | 14 +-- dist/cdc/CDCRangeFilter.js.map | 2 +- dist/cdc/CDCTextFilter.d.ts | 6 +- dist/cdc/CDCTextFilter.js | 14 +-- dist/cdc/CDCTextFilter.js.map | 2 +- dist/cdc/FilterCard.d.ts | 7 +- dist/cdc/FilterCard.js | 14 ++- dist/cdc/FilterCard.js.map | 2 +- dist/cdc/api.d.ts | 6 +- dist/cdc/api.js.map | 2 +- dist/cdc/interface.d.ts | 14 ++- dist/cdc/interface.js | 32 +++++-- dist/cdc/interface.js.map | 2 +- src/cdc/AccordionView.tsx | 29 ------ src/cdc/CDCCheckboxFilter.tsx | 17 ++-- src/cdc/CDCCreateEditAlert.tsx | 85 ++++++++++------- src/cdc/CDCFilterComponent.tsx | 80 ++++++++-------- src/cdc/CDCFilterDialog.tsx | 141 ++++++++++++++++++---------- src/cdc/CDCGroupingFilter.tsx | 14 ++- src/cdc/CDCRangeFilter.tsx | 33 +++---- src/cdc/CDCTextFilter.tsx | 74 ++++++++------- src/cdc/FilterCard.tsx | 32 ++++--- src/cdc/api.ts | 48 +++++----- src/cdc/interface.ts | 145 +++++++++++++++++------------ tdp_core/cdc/BaseCDC.py | 12 ++- tdp_core/cdc/CDCAlert.py | 4 +- tdp_core/cdc/DemoCDC.py | 11 +-- tdp_core/cdc/api.py | 2 +- 44 files changed, 635 insertions(+), 467 deletions(-) delete mode 100644 src/cdc/AccordionView.tsx diff --git a/dist/cdc/CDCCheckboxFilter.d.ts b/dist/cdc/CDCCheckboxFilter.d.ts index ec7849635..f68bcf146 100644 --- a/dist/cdc/CDCCheckboxFilter.d.ts +++ b/dist/cdc/CDCCheckboxFilter.d.ts @@ -1,11 +1,13 @@ /// -import { IFilter } from './interface'; +import { IFilter, IFilterComponent } from './interface'; interface ICDCCheckboxFilterValue { fields: string[]; filter: string[]; } +export declare const CDCCheckboxFilterId = "checkbox"; +export declare const CDCCheckboxFilter: IFilterComponent; export declare function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter; -export declare function CDCCheckboxFilter({ value, onValueChanged }: { +export declare function CDCCheckboxFilterComponent({ value, onValueChanged }: { value: any; onValueChanged: any; }): JSX.Element; diff --git a/dist/cdc/CDCCheckboxFilter.js b/dist/cdc/CDCCheckboxFilter.js index 19d089d92..62e941cca 100644 --- a/dist/cdc/CDCCheckboxFilter.js +++ b/dist/cdc/CDCCheckboxFilter.js @@ -1,21 +1,23 @@ import * as React from 'react'; +export const CDCCheckboxFilterId = 'checkbox'; +export const CDCCheckboxFilter = { + clazz: CDCCheckboxFilterComponent, + toFilter: CDCCheckboxFilterToString +}; export function createCDCCheckboxFilter(id, name, value) { return { id, name, disableDropping: true, - component: { - clazz: CDCCheckboxFilter, - toFilter: CDCCheckboxFilterToString, - value, - } + componentId: CDCCheckboxFilterId, + componentValue: value }; } function CDCCheckboxFilterToString(value) { // Generate filter from value return `(${value === null || value === void 0 ? void 0 : value.fields.map((v) => { return `${v} == ${value.filter.filter((f) => f === v).length > 0}`; }).join(' and ')})`; } -export function CDCCheckboxFilter({ value, onValueChanged }) { +export function CDCCheckboxFilterComponent({ value, onValueChanged }) { return React.createElement(React.Fragment, null, value.fields.map((v, i) => { return (React.createElement("div", { key: i, className: "input-group m-1" }, React.createElement("div", { className: "form-check" }, diff --git a/dist/cdc/CDCCheckboxFilter.js.map b/dist/cdc/CDCCheckboxFilter.js.map index 6af3526c6..61f3fd82a 100644 --- a/dist/cdc/CDCCheckboxFilter.js.map +++ b/dist/cdc/CDCCheckboxFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA8B;IAC9F,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,QAAQ,EAAE,yBAAyB;YACnC,KAAK;SACN;KACF,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,KAA8B;IAC/D,6BAA6B;IAC7B,OAAO,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,GAAG,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAA,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AAC9H,CAAC;AAED,MAAM,UAAU,i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cAAc,EACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;wBACf,GAAG,KAAK;wBACR,MAAM,EAAE,KAAK,CAAC,MAAM;wBACpB,MAAM,EACJ,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;4BAC5C,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;4BACrC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;qBAC3B,CAAC,GAEJ;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,CAAC,CACI,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateEditAlert.d.ts b/dist/cdc/CDCCreateEditAlert.d.ts index 645051457..fe14073ab 100644 --- a/dist/cdc/CDCCreateEditAlert.d.ts +++ b/dist/cdc/CDCCreateEditAlert.d.ts @@ -1,13 +1,18 @@ /// import { ICDCFormData } from "."; -import { IAlert, IFilter } from "./interface"; +import { IAlert, IFilter, IFilterComponent } from "./interface"; interface ICDCCreateEditAlert { formData: ICDCFormData; setFormData: (formData: ICDCFormData) => void; selectedAlert?: IAlert; - filterSelection: IFilter[]; + filterSelection: IFilter[] | undefined; filter: IFilter; setFilter: (filter: IFilter) => void; + editMode?: boolean; + setEditMode?: (editMode: boolean) => void; + filterComponents: { + [key: string]: IFilterComponent; + }; } -export declare function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter }: ICDCCreateEditAlert): JSX.Element; +export declare function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter, editMode, setEditMode, filterComponents }: ICDCCreateEditAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCCreateEditAlert.js b/dist/cdc/CDCCreateEditAlert.js index 62f9bd7b8..888eebf4a 100644 --- a/dist/cdc/CDCCreateEditAlert.js +++ b/dist/cdc/CDCCreateEditAlert.js @@ -1,24 +1,35 @@ import React from "react"; -import { AccordionView } from "./AccordionView"; import { CDCFilterComponent } from "./CDCFilterComponent"; -export function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter }) { - const generalInformation = (React.createElement(React.Fragment, null, - React.createElement("h6", null, "Name"), - React.createElement("input", { type: "text", value: formData.name, onChange: (e) => setFormData({ ...formData, name: e.target.value }) }), - React.createElement("h6", null, "Email notification"), - React.createElement("input", { className: "form-check-input", type: "checkbox", checked: formData.enable_mail_notification, onChange: (e) => setFormData({ ...formData, enable_mail_notification: e.target.checked }) }), - React.createElement("h6", null, "CDC"), - React.createElement("input", { type: "text", value: formData.cdc_id, onChange: (e) => setFormData({ ...formData, cdc_id: e.target.value }) }))); - const data = selectedAlert ? [ - { title: 'Alert overview', JSX: generalInformation, show: true }, - { title: 'New literature', JSX: React.createElement("p", null, "text aufgeklappt") }, - { title: 'Filter settings', JSX: React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filter: filter, setFilter: setFilter }) } - ] : [ - { title: "General information", JSX: generalInformation, show: true }, - { title: "Edit filters", JSX: React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filter: filter, setFilter: setFilter }) } - ]; - return (React.createElement(React.Fragment, null, - React.createElement("h5", null, "Your options"), - React.createElement(AccordionView, { parentId: "createAlert", data: data }))); +import { v4 as uuidv4 } from 'uuid'; +export function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter, editMode, setEditMode, filterComponents }) { + const generalInformation = formData ? + (React.createElement(React.Fragment, null, + React.createElement("div", { className: "mb-3" }, + React.createElement("label", { className: "form-label" }, "Name"), + selectedAlert && !editMode ? + React.createElement("p", null, formData.name) + : + React.createElement("input", { type: "text", className: "form-control", value: formData.name, onChange: (e) => setFormData({ ...formData, name: e.target.value }) })), + React.createElement("div", { className: "mb-3" }, + React.createElement("label", { className: "form-label" }, "CDC"), + selectedAlert && !editMode ? + React.createElement("p", null, formData.name) + : + React.createElement("input", { type: "text", className: "form-control", value: formData.cdc_id, onChange: (e) => setFormData({ ...formData, cdc_id: e.target.value }) })), + React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: selectedAlert && !editMode, checked: formData.enable_mail_notification, onChange: (e) => setFormData({ ...formData, enable_mail_notification: e.target.checked }) }), + React.createElement("label", { className: "form-check-label ms-2" }, "Email notification"), + React.createElement("div", { className: "mb-3 form-check" }))) : null; + const accordionItem = (title, parentId, child, show) => { + const index = uuidv4(); + parentId = parentId.trim(); + return (React.createElement("div", { key: index, className: "accordion-item" }, + React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), + React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); + }; + return (React.createElement("div", { className: "accordion", id: "createAlert" }, + accordionItem('Alert overview', 'createAlert', generalInformation, true), + selectedAlert ? accordionItem('New literature', 'createAlert', React.createElement("p", null, "text aufgeklappt")) : null, + accordionItem('Filter settings', 'createAlert', !filter ? null : React.createElement(CDCFilterComponent, { filterSelection: selectedAlert && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter })))); } //# sourceMappingURL=CDCCreateEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCCreateEditAlert.js.map b/dist/cdc/CDCCreateEditAlert.js.map index a5614d053..e16892866 100644 --- a/dist/cdc/CDCCreateEditAlert.js.map +++ b/dist/cdc/CDCCreateEditAlert.js.map @@ -1 +1 @@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ilterComponent.d.ts index fb21391d2..cc55bd734 100644 --- a/dist/cdc/CDCFilterComponent.d.ts +++ b/dist/cdc/CDCFilterComponent.d.ts @@ -1,9 +1,12 @@ -/// -import { IFilter } from "./interface"; +import React from "react"; +import { IFilter, IFilterComponent } from "./interface"; interface ICDCFilterComponentProps { - filterSelection: IFilter[]; + filterSelection?: IFilter[]; filter: IFilter; - setFilter: (filter: IFilter) => void; + setFilter: React.Dispatch>; + filterComponents: { + [key: string]: IFilterComponent; + }; } -export declare function CDCFilterComponent({ filterSelection, filter, setFilter }: ICDCFilterComponentProps): JSX.Element; +export declare function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents }: ICDCFilterComponentProps): JSX.Element; export {}; diff --git a/dist/cdc/CDCFilterComponent.js b/dist/cdc/CDCFilterComponent.js index 7a468ba7e..3fe497755 100644 --- a/dist/cdc/CDCFilterComponent.js +++ b/dist/cdc/CDCFilterComponent.js @@ -5,15 +5,15 @@ import { HTML5Backend } from "react-dnd-html5-backend"; import { FilterCard } from "./FilterCard"; import { getFilterFromTree, getTreeQuery } from "./interface"; import { v4 as uuidv4 } from 'uuid'; -export function CDCFilterComponent({ filterSelection, filter, setFilter }) { +export function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents }) { React.useEffect(() => { - const test = getTreeQuery(filter); + const test = getTreeQuery(filter, filterComponents); if (test) { console.log(test); } }, [filter]); const onDelete = (newFilter) => { - setFilter(produce(filter, (nextFilter) => { + setFilter((filter) => produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); if (current && parent && parent.children) { // Find the index of the current element in the parents children @@ -27,8 +27,7 @@ export function CDCFilterComponent({ filterSelection, filter, setFilter }) { }; const onDrop = (item, { target, index }) => { // Add item to target children array - //TODO: remove any - but TS won't stop complaining - const newFilter = (filter) => produce(filter, (nextFilter) => { + setFilter((filter) => produce(filter, (nextFilter) => { // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilter, // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES // ARE NOT UP-TO-DATE! @@ -62,11 +61,10 @@ export function CDCFilterComponent({ filterSelection, filter, setFilter }) { else { console.error('Something is wrong'); } - }); - setFilter(newFilter); + })); }; const onChange = (newFilter, changeFunc) => { - setFilter(produce(filter, (nextFilter) => { + setFilter((filter) => produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); if (current) { changeFunc(current); @@ -75,18 +73,18 @@ export function CDCFilterComponent({ filterSelection, filter, setFilter }) { }; const onValueChanged = (filter, value) => { onChange(filter, (f) => { - if (f.component) { - f.component.value = value; - } + f.componentValue = value; }); }; return (React.createElement(DndProvider, { backend: HTML5Backend }, React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "Your filters"), - React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged })), - React.createElement("div", { className: "col-md" }, - React.createElement("h6", null, "New filters"), - filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f }))))))); + React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged, filterComponents: filterComponents })), + filterSelection ? + React.createElement("div", { className: "col-md" }, + React.createElement("h6", null, "New filters"), + filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f, filterComponents: filterComponents })))) + : null))); } //# sourceMappingURL=CDCFilterComponent.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.js.map b/dist/cdc/CDCFilterComponent.js.map index 3a6ebced3..b2acb1b52 100644 --- a/dist/cdc/CDCFilterComponent.js.map +++ b/dist/cdc/CDCFilterComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO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C,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,CACzE,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index ef662409d..b242b8224 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -1,10 +1,18 @@ /// +import { IFilter, IFilterComponent } from "./interface"; export interface ICDCFormData { name: string; cdc_id: string; enable_mail_notification: boolean; } -export declare function CDCFilterDialog(): JSX.Element; +export declare function CDCFilterDialog({ filterComponents, filtersByCDC }: { + filterComponents: { + [key: string]: IFilterComponent; + }; + filtersByCDC: { + [cdcId: string]: IFilter[]; + }; +}): JSX.Element; export declare class CDCFilterDialogClass { private node; constructor(parent: HTMLElement); diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 0a28fe83c..bf53b1299 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -1,54 +1,66 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import { BSModal, useAsync } from '../hooks'; -import { getAlerts, saveAlert } from './api'; +import { deleteAlert, getAlerts, saveAlert } from './api'; import { CDCCreateEditAlert } from './CDCCreateEditAlert'; -import { createCDCGroupingFilter } from './CDCGroupingFilter'; +import { CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter } from './CDCGroupingFilter'; import { v4 as uuidv4 } from 'uuid'; -import { createCDCTextFilter } from './CDCTextFilter'; -import { createCDCCheckboxFilter } from './CDCCheckboxFilter'; -import { createCDCRangeFilter } from './CDCRangeFilter'; -export function CDCFilterDialog() { +import { CDCTextFilter, CDCTextFilterId, createCDCTextFilter } from './CDCTextFilter'; +import { CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter } from './CDCCheckboxFilter'; +import { CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './CDCRangeFilter'; +const DEFAULTFORMDATA = { name: "", enable_mail_notification: false, cdc_id: "" }; +const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true }; +export function CDCFilterDialog({ filterComponents, filtersByCDC }) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [formData, setFormData] = React.useState(); + const [editMode, setEditMode] = React.useState(false); + const [alertList, setAlertList] = React.useState(); React.useEffect(() => { - setFormData({ - name: "", - enable_mail_notification: false, - cdc_id: "", - }); - setFilter({ - ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), - disableDragging: true, - disableRemoving: true - }); + setFormData(DEFAULTFORMDATA); + setFilter(DEFAULTFILTER); }, []); React.useEffect(() => { console.log(selectedAlert); + setEditMode(false); if (selectedAlert) { setFormData(selectedAlert); if (selectedAlert.filter) { - JSON.parse(selectedAlert.filter).then((test) => { - setFilter(test); - }).catch((e) => console.log(e)); + try { + setFilter(JSON.parse(selectedAlert.filter)); + } + catch (e) { + console.log(e); + } } } }, [selectedAlert]); - const filterSelection = [ - createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), - createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), - createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), - ]; const { status: alertStatus, error: alertError, execute: alertExecute, value: alerts } = useAsync(getAlerts, true); + React.useEffect(() => { + setAlertList(alerts); + }, [alerts]); const onSave = () => { //TODO: put group away again - saveAlert({ ...formData, filter: JSON.stringify(filter), group: "hi" }); + saveAlert({ ...formData, filter: JSON.stringify(filter) }); + }; + const editButton = !creationMode ? (!editMode && selectedAlert ? (React.createElement("button", { className: "btn btn-secondary", onClick: () => setEditMode(true) }, + React.createElement("i", { className: "fas fa-pencil-alt" }))) : (React.createElement(React.Fragment, null, + React.createElement("button", { title: "Save changes", className: "btn btn-secondary", onClick: () => setEditMode(false) }, + React.createElement("i", { className: "fas fa-save" })), + React.createElement("button", { title: "Discard changes", className: "btn btn-secondary ms-1", onClick: () => setEditMode(false) }, + React.createElement("i", { className: "fas fa-ban" }))))) : null; + const onCreateButtonClick = () => { + setCreationMode(true); + setSelectedAlert(null); + setFormData(DEFAULTFORMDATA); + setFilter(DEFAULTFILTER); + }; + const onDeleteButton = (id) => { + setAlertList([...alertList.filter((alert) => alert.id !== id)]); + deleteAlert(id); }; - // console.log(alerts); return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), @@ -63,15 +75,15 @@ export function CDCFilterDialog() { React.createElement("div", { className: "modal-body" }, React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-4 overflow-auto" }, - React.createElement("div", { className: "d-flex w-100 justify-content-between" }, + React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, React.createElement("h5", null, "Your alerts"), React.createElement("small", null, - React.createElement("button", { className: "btn btn-secondary", onClick: () => { setCreationMode(true); setSelectedAlert(null); } }, "+"))), + React.createElement("button", { className: "btn btn-secondary", onClick: () => onCreateButtonClick() }, "+"))), alertStatus === 'pending' ? React.createElement(React.Fragment, null, "Loading...") : null, alertStatus === 'error' ? React.createElement(React.Fragment, null, "Error ", alertError.toString()) : null, - alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert, i) => React.createElement("div", { key: i }, + alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alertList.map((alert) => React.createElement("div", { key: alert.id }, React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? " border-primary" : ""}`, onClick: () => { setSelectedAlert(alert); setCreationMode(false); }, "aria-current": "true" }, React.createElement("div", { className: "d-flex w-100 justify-content-between" }, React.createElement("h6", { className: "mb-1" }, @@ -82,12 +94,18 @@ export function CDCFilterDialog() { alert.cdc_id), " "), React.createElement("small", null, - React.createElement("span", { className: "badge bg-primary rounded-pill" }, "1"))), + React.createElement("span", { className: "badge bg-primary rounded-pill" }, "1"), + React.createElement("span", { className: "badge bg-secondary rounded-pill", onClick: () => onDeleteButton(alert.id) }, + React.createElement("i", { className: "fas fa-trash" })))), React.createElement("p", { className: "mb-1" }, "Some placeholder content in a paragraph."), React.createElement("small", null, "last confirmed: ", alert.confirmation_date))))) : null), - React.createElement("div", { className: "col-8 overflow-auto" }, creationMode ? (React.createElement(CDCCreateEditAlert, { filter: filter, setFilter: setFilter, formData: formData, setFormData: setFormData, filterSelection: filterSelection })) : (selectedAlert ? React.createElement(CDCCreateEditAlert, { filter: filter, setFilter: setFilter, formData: formData, setFormData: setFormData, filterSelection: filterSelection, selectedAlert: selectedAlert }) : null)))), + React.createElement("div", { className: "col-8 overflow-auto" }, selectedAlert || creationMode ? React.createElement(React.Fragment, null, + React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, + React.createElement("h5", null, "Your options"), + React.createElement("small", null, editButton)), + React.createElement(CDCCreateEditAlert, { editMode: selectedAlert ? editMode : null, setEditMode: selectedAlert ? setEditMode : null, filter: filter, setFilter: setFilter, formData: formData, setFormData: setFormData, filterSelection: filtersByCDC[selectedAlert.cdc_id], filterComponents: filterComponents, selectedAlert: selectedAlert ? selectedAlert : null })) : null))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", className: "btn btn-primary", onClick: () => onSave() }, "Save changes"))))))); @@ -99,7 +117,19 @@ export class CDCFilterDialogClass { this.init(); } init() { - ReactDOM.render(React.createElement(CDCFilterDialog, null), this.node); + ReactDOM.render(React.createElement(CDCFilterDialog, { filterComponents: { + [CDCGroupingFilterId]: CDCGroupingFilter, + [CDCCheckboxFilterId]: CDCCheckboxFilter, + [CDCTextFilterId]: CDCTextFilter, + [CDCRangeFilterId]: CDCRangeFilter + }, filtersByCDC: { + 'demo': [ + createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), + createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: 'field1', value: [] }], fields: [{ field: 'field1', options: ['hallo', 'hier', 'steht', 'text'] }, { field: 'field2', options: ['tschüss', 'hier', 'nicht'] }, { field: 'field3', options: ['test', 'noch ein test', 'hi'] }] }), + createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), + createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1950, max: 2021 }), + ] + } }), this.node); } } //# sourceMappingURL=CDCFilterDialog.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index c5b134cf6..9d5b540f0 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAC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AO,CAAC,EAAC,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,EAAC,CAAC,EAAC,CAAC;oBACvR,uBAAuB,CAAC,MAAM,EAAE,EAAE,iBAAiB,EAAE,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;oBACpG,oBAAoB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAC,CAAC;iBACvE;aACF,GAAI,EACP,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CDCGroupingFilter.d.ts b/dist/cdc/CDCGroupingFilter.d.ts index 2604522cc..e80966b68 100644 --- a/dist/cdc/CDCGroupingFilter.d.ts +++ b/dist/cdc/CDCGroupingFilter.d.ts @@ -1,2 +1,4 @@ -import { IFilter } from './interface'; +import { IFilter, IFilterComponent } from './interface'; +export declare const CDCGroupingFilterId = "group"; +export declare const CDCGroupingFilter: IFilterComponent; export declare function createCDCGroupingFilter(id: string, name: string): IFilter; diff --git a/dist/cdc/CDCGroupingFilter.js b/dist/cdc/CDCGroupingFilter.js index ef79c76ef..a7ecb3acd 100644 --- a/dist/cdc/CDCGroupingFilter.js +++ b/dist/cdc/CDCGroupingFilter.js @@ -1,4 +1,8 @@ import * as React from 'react'; +export const CDCGroupingFilterId = 'group'; +export const CDCGroupingFilter = { + clazz: CDCGroupingFilterComponent, +}; export function createCDCGroupingFilter(id, name) { return { id, @@ -6,12 +10,11 @@ export function createCDCGroupingFilter(id, name) { disableDropping: true, operator: 'AND', children: [], - component: { - clazz: CDCGroupingFilter, - } + componentId: CDCGroupingFilterId, + componentValue: null }; } -function CDCGroupingFilter() { +function CDCGroupingFilterComponent() { return React.createElement("div", null, React.createElement("br", null)); } diff --git a/dist/cdc/CDCGroupingFilter.js.map b/dist/cdc/CDCGroupingFilter.js.map index 31b8530e5..670dfb9a0 100644 --- a/dist/cdc/CDCGroupingFilter.js.map +++ b/dist/cdc/CDCGroupingFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCGroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCGroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY;IAC9D,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;SACzB;KACF,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO;QAAK,+BAAM,CAAM,CAAC;AAC3B,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCGroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCGroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;CAClC,CAAA;AAED,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY;IAC9D,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,mBAAmB;QAChC,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B;IACjC,OAAO;QAAK,+BAAM,CAAM,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.d.ts b/dist/cdc/CDCRangeFilter.d.ts index c6f3ba227..78064ff4d 100644 --- a/dist/cdc/CDCRangeFilter.d.ts +++ b/dist/cdc/CDCRangeFilter.d.ts @@ -1,6 +1,8 @@ -import { IFilter } from './interface'; +import { IFilter, IFilterComponent } from './interface'; export interface ICDCRangeFilterValue { min: number; max: number; } +export declare const CDCRangeFilterId = "range"; +export declare const CDCRangeFilter: IFilterComponent; export declare function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter; diff --git a/dist/cdc/CDCRangeFilter.js b/dist/cdc/CDCRangeFilter.js index c05e3d653..62b233022 100644 --- a/dist/cdc/CDCRangeFilter.js +++ b/dist/cdc/CDCRangeFilter.js @@ -1,22 +1,24 @@ import * as React from 'react'; import InputRange from 'react-input-range'; +export const CDCRangeFilterId = 'range'; +export const CDCRangeFilter = { + clazz: CDCRangeFilterComponent, + toFilter: CDCRangeFilterToString +}; export function createCDCRangeFilter(id, name, value) { return { id, name, disableDropping: true, - component: { - clazz: CDCRangeFilter, - toFilter: CDCRangeFilterToString, - value, - } + componentId: CDCRangeFilterId, + componentValue: value }; } function CDCRangeFilterToString(value) { // Generate filter from value return `(date >= ${value.min} and date <= ${value.max})`; } -function CDCRangeFilter({ value, onValueChanged }) { +function CDCRangeFilterComponent({ value, onValueChanged }) { return React.createElement("div", { className: "t360-input-range-wrapper", style: { margin: '10px', paddingTop: '10px', minHeight: '50px' } }, React.createElement(InputRange, { disabled: !onValueChanged, maxValue: 2021, minValue: 1950, value: { min: value.min, max: value.max }, onChange: (v) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged(v) })); } diff --git a/dist/cdc/CDCRangeFilter.js.map b/dist/cdc/CDCRangeFilter.js.map index 1d672f1e0..d84718af3 100644 --- a/dist/cdc/CDCRangeFilter.js.map +++ b/dist/cdc/CDCRangeFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,K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B;IAC9B,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA2B;IACxF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,gBAAgB;QAC7B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA2B;IACzD,6BAA6B;IAC7B,OAAO,YAAY,KAAK,CAAC,GAAG,gBAAgB,KAAK,CAAC,GAAG,GAAG,CAAC;AAC3D,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAC;IACtD,OAAO,6BAAK,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QAC7G,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,EACzB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,EAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAC,EACvC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACpC,CACE,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.d.ts b/dist/cdc/CDCTextFilter.d.ts index f0e61ac82..9ab560cbb 100644 --- a/dist/cdc/CDCTextFilter.d.ts +++ b/dist/cdc/CDCTextFilter.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter } from './interface'; +import { IFilter, IFilterComponent } from './interface'; export interface ICDCTextFilterValue { fields: { field: string; @@ -10,8 +10,10 @@ export interface ICDCTextFilterValue { value: string[]; }[]; } +export declare const CDCTextFilterId = "text"; +export declare const CDCTextFilter: IFilterComponent; export declare function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter; -export declare function CDCTextFilter({ value, onValueChanged }: { +export declare function CDCTextFilterComponent({ value, onValueChanged }: { value: any; onValueChanged: any; }): JSX.Element; diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/CDCTextFilter.js index 03ef5e1a4..f2aea2b39 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/CDCTextFilter.js @@ -1,15 +1,17 @@ import * as React from 'react'; import Select from 'react-select'; +export const CDCTextFilterId = 'text'; +export const CDCTextFilter = { + clazz: CDCTextFilterComponent, + toFilter: CDCTextFilterToString +}; export function createCDCTextFilter(id, name, value) { return { id, name, disableDropping: true, - component: { - clazz: CDCTextFilter, - toFilter: CDCTextFilterToString, - value, - } + componentId: CDCTextFilterId, + componentValue: value }; } function CDCTextFilterToString(value) { @@ -18,7 +20,7 @@ function CDCTextFilterToString(value) { .map((v) => `${v.field} in (${v.value.join(',')})`) .join(' and ')})`; } -export function CDCTextFilter({ value, onValueChanged }) { +export function CDCTextFilterComponent({ value, onValueChanged }) { return React.createElement(React.Fragment, null, value.filter.map((v, i) => { var _a; diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map index c5831ff2f..42b0a4bb5 100644 --- a/dist/cdc/CDCTextFilter.js.map +++ b/dist/cdc/CDCTextFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAclC,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE,qBAAqB;YAC/B,KAAK;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SAAS,EAAC,mBAAmB,QAGtB,CACL,CACP,CAAA;SAAA,CAAC;QACD,cAAc,CAAC,CAAC,CAAC,CAChB,gCACE,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC,QAGM,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAalC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,KAAK;KACtB,CAAA;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,KAA0B;IACvD,6BAA6B;IAC7B,OAAO,IAAI,KAAK,CAAC,MAAM;SACpB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;SAClD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cA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C,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/FilterCard.d.ts b/dist/cdc/FilterCard.d.ts index 97e4e356d..23f8fdb96 100644 --- a/dist/cdc/FilterCard.d.ts +++ b/dist/cdc/FilterCard.d.ts @@ -1,9 +1,12 @@ /// -import { IFilter } from './interface'; -export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged }: { +import { IFilter, IFilterComponent } from './interface'; +export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents }: { filter: IFilter; onDrop?: any; onDelete?: (filter: IFilter) => void; onChange?: (filter: IFilter, changeFunc: (filter: IFilter) => void) => void; onValueChanged?: (filter: IFilter, value: any) => void; + filterComponents: { + [key: string]: IFilterComponent; + }; }): JSX.Element; diff --git a/dist/cdc/FilterCard.js b/dist/cdc/FilterCard.js index 3954f08e9..9432c87bd 100644 --- a/dist/cdc/FilterCard.js +++ b/dist/cdc/FilterCard.js @@ -2,7 +2,7 @@ import * as React from 'react'; import { itemTypes } from './interface'; import { useDrag } from 'react-dnd'; import { DropZone } from './DropZone'; -export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged }) { +export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents }) { var _a, _b, _c; const [{ isDragging, draggedItem }, drag, preview] = useDrag(() => ({ type: itemTypes.FILTERCARD, @@ -13,6 +13,10 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged }) })); const hasChildren = filter.children && filter.children.length >= 0; + const filterComponent = filterComponents[filter.componentId]; + if (!filterComponent) { + return React.createElement(React.Fragment, null, "ERROR!!"); + } return (React.createElement("div", { className: `card mb-2 ${isDragging ? 'bg-light' : ''}`, ref: preview, style: filter.disableRemoving && filter.disableDragging ? { height: '93%' } : {} }, React.createElement("div", { className: "card-body" }, React.createElement("h6", { ref: filter.disableDragging ? undefined : drag, className: "card-title d-flex", style: filter.disableDragging ? {} : { cursor: 'move' } }, @@ -28,15 +32,15 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged React.createElement("option", { value: "AND" }, "AND"), React.createElement("option", { value: "OR" }, "OR"), React.createElement("option", { value: "NOT" }, "NOT (AND)"))) : null, - !filter.disableRemoving && onDelete ? (React.createElement("button", { className: "btn btn-danger btn-sm", onClick: () => onDelete(filter) }, + !filter.disableRemoving && onDelete ? (React.createElement("button", { className: "btn btn-secondary btn-sm", onClick: () => onDelete(filter) }, React.createElement("i", { className: "fas fa-times" }))) : null))), - filter.component ? (React.createElement("div", null, - React.createElement(filter.component.clazz, { value: filter.component.value, onValueChanged: onValueChanged + filterComponent ? (React.createElement("div", null, + React.createElement(filterComponent.clazz, { value: filter.componentId, onValueChanged: onValueChanged ? (value) => onValueChanged(filter, value) : undefined }))) : null, onDrop && (hasChildren || !filter.disableDropping) ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: 0, canDrop: draggedItem !== ((_b = filter.children) === null || _b === void 0 ? void 0 : _b[0]) })) : null, (_c = filter.children) === null || _c === void 0 ? void 0 : _c.map((child, i, allChildren) => (React.createElement(React.Fragment, { key: child.id }, - React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onChange: onChange }), + React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onChange: onChange, filterComponents: filterComponents }), onDrop && hasChildren ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: i + 1, canDrop: draggedItem !== allChildren[i + 1] && draggedItem !== child })) : null)))))); } //# sourceMappingURL=FilterCard.js.map \ No newline at end of file diff --git a/dist/cdc/FilterCard.js.map b/dist/cdc/FilterCard.js.map index 6ddd60fc6..8b378f0fb 100644 --- a/dist/cdc/FilterCard.js.map +++ b/dist/cdc/FilterCard.js.map @@ -1 +1 @@ -{"version":3,"file":"FilterCard.js","sourceRoot":"","sources":["../../src/cdc/FilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,K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C,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,GAE7D,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/api.d.ts b/dist/cdc/api.d.ts index 9a28d1fab..16cf85942 100644 --- a/dist/cdc/api.d.ts +++ b/dist/cdc/api.d.ts @@ -8,9 +8,9 @@ * Proprietary and confidential. No warranty. * *********************************************************/ -import { IAlert } from './interface'; +import { IAlert, IUploadAlert } from './interface'; export declare function getAlerts(): Promise; export declare function getAlertsById(id: string): Promise; export declare function editAlert(id: string, alert: Partial): Promise; -export declare function deleteAlert(id: string): Promise; -export declare function saveAlert(alert: IAlert): Promise; +export declare function deleteAlert(id: number): Promise; +export declare function saveAlert(alert: IUploadAlert): Promise; diff --git a/dist/cdc/api.js.map b/dist/cdc/api.js.map index 2c1acee70..ce50f0567 100644 --- a/dist/cdc/api.js.map +++ b/dist/cdc/api.js.map @@ -1 +1 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/cdc/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;2DAS2D;AAE1D,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,SAAS;IAChC,uHAAuH;IACnH,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAA;IACnE,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAAU;IAC5C,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,EAAU,EAAE,KAAsB;IAChE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AAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC1H,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAU;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAmB;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACrH,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index 8dd3d1813..d887e3ecf 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -4,7 +4,6 @@ export interface IFilterComponent { value: V; onValueChanged?: (value: V) => void; }) => JSX.Element; - value?: V; toFilter?: (value: V) => string; } export interface IFilter { @@ -14,7 +13,8 @@ export interface IFilter { disableDragging?: boolean; disableDropping?: boolean; operator?: 'AND' | 'OR' | 'NOT'; - component?: IFilterComponent; + componentId: string; + componentValue: V; children?: IFilter[]; } export declare const itemTypes: { @@ -24,13 +24,17 @@ export declare const getFilterFromTree: (filter: IFilter, id: string) => { parent: IFilter | null; current: IFilter | null; }; -export declare const getTreeQuery: (filter: IFilter) => string; +export declare const getTreeQuery: (filter: IFilter, components: { + [key: string]: IFilterComponent; +}) => string; export interface IAlert { - id?: number; + id: number; name: string; cdc_id: string; confirmation_date?: string; filter: string; enable_mail_notification: boolean; - group: string; } +export interface IUploadAlert extends Pick { +} +export declare function isAlert(obj: IAlert | IUploadAlert): obj is IAlert; diff --git a/dist/cdc/interface.js b/dist/cdc/interface.js index 85366e982..e748b351e 100644 --- a/dist/cdc/interface.js +++ b/dist/cdc/interface.js @@ -21,27 +21,40 @@ export const getFilterFromTree = (filter, id) => { } return { parent: null, current: null }; }; -export const getTreeQuery = (filter) => { +export const getTreeQuery = (filter, components) => { + var _a, _b; if (!filter) { return ''; } if (!filter.children) { //leaf filter - if (filter.component && - filter.component.toFilter && - filter.component.value) { - return filter.component.toFilter(filter.component.value); + if (filter && + components && ((_a = components[filter.componentId]) === null || _a === void 0 ? void 0 : _a.clazz) && ((_b = components[filter.componentId]) === null || _b === void 0 ? void 0 : _b.toFilter)) { + return components[filter.componentId].toFilter(filter.componentValue); } else { return ''; } + /* + + if ( + filter.component && + filter.component.toFilter && + filter.component.value + ) { + return filter.component.toFilter(filter.component.value); + } else { + return ''; + } + + */ } else { //go through every child let returnValue = '('; filter.children.forEach((child, i) => { var _a; - returnValue += `${getTreeQuery(child)}${filter.children && i < filter.children.length - 1 + returnValue += `${getTreeQuery(child, components)}${filter.children && i < filter.children.length - 1 ? ` ${(filter === null || filter === void 0 ? void 0 : filter.operator) === 'NOT' ? 'and not' : (_a = filter === null || filter === void 0 ? void 0 : filter.operator) === null || _a === void 0 ? void 0 : _a.toLowerCase()} ` @@ -51,4 +64,11 @@ export const getTreeQuery = (filter) => { return returnValue; } }; +export function isAlert(obj) { + var _a; + return typeof ((_a = obj) === null || _a === void 0 ? void 0 : _a.id) === 'number'; +} +// const test: IAlert | IUploadAlert = null; +// if (!isAlert(test)) { +// } //# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/dist/cdc/interface.js.map b/dist/cdc/interface.js.map index af6bb2358..744454ecb 100644 --- a/dist/cdc/interface.js.map +++ b/dist/cdc/interface.js.map @@ -1 +1 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/cdc/interface.ts"],"names":[],"mappings":"AAyBE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,E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;YACL,OAAO,EAAE,CAAC;SACX;KACF;SAAM;QACL,wBAAwB;QACxB,IAAI,WAAW,GAAG,GAAG,CAAC;QACtB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;;YACnC,WAAW,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,GACnC,MAAM,CAAC,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAC/C,CAAC,CAAC,IACE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAK,KAAK;oBACxB,CAAC,CAAC,SAAS;oBACX,CAAC,OAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,WAAW,EACnC,GAAG;gBACL,CAAC,CAAC,EACN,EAAE,CAAC;QACL,CAAC,CAAC,CAAC;QACH,WAAW,IAAI,GAAG,CAAC;QACnB,OAAO,WAAW,CAAC;KACpB;AACH,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/cdc/interface.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,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M,CAAE,QAAQ,MAAK,KAAK;oBAC9B,CAAC,CAAC,SAAS;oBACX,CAAC,OAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,WAAW,EACjC,GAAG;gBACH,CAAC,CAAC,EACF,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;QACH,WAAW,IAAI,GAAG,CAAC;QACnB,OAAO,WAAW,CAAC;KACpB;AACH,CAAC,CAAC;AAeF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC;AAGD,4CAA4C;AAE5C,wBAAwB;AACxB,IAAI"} \ No newline at end of file diff --git a/src/cdc/AccordionView.tsx b/src/cdc/AccordionView.tsx deleted file mode 100644 index a36da701b..000000000 --- a/src/cdc/AccordionView.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react"; - -interface IAccordionViewProps { - parentId: string; - data: {title: string, JSX: JSX.Element, show?: boolean}[]; -} - -export function AccordionView({parentId, data}: IAccordionViewProps) { - const accordionItem = (index: number, title: string, JSX: JSX.Element, show?: boolean) => { - return ( -
    -

    - -

    -
    - {JSX} -
    -
    - ); - }; - - return ( -
    - {data.map((d, i) => accordionItem(i, d.title, d.JSX, d.show))} -
    - ); -} \ No newline at end of file diff --git a/src/cdc/CDCCheckboxFilter.tsx b/src/cdc/CDCCheckboxFilter.tsx index ac92e8e7f..8169dd519 100644 --- a/src/cdc/CDCCheckboxFilter.tsx +++ b/src/cdc/CDCCheckboxFilter.tsx @@ -1,4 +1,4 @@ -import {IFilter} from './interface'; +import {IFilter, IFilterComponent} from './interface'; import * as React from 'react'; interface ICDCCheckboxFilterValue { @@ -6,16 +6,19 @@ interface ICDCCheckboxFilterValue { filter: string[]; } +export const CDCCheckboxFilterId = 'checkbox'; +export const CDCCheckboxFilter: IFilterComponent = { + clazz: CDCCheckboxFilterComponent, + toFilter: CDCCheckboxFilterToString +}; + export function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter { return { id, name, disableDropping: true, - component: { - clazz: CDCCheckboxFilter, - toFilter: CDCCheckboxFilterToString, - value, - } + componentId: CDCCheckboxFilterId, + componentValue: value }; } @@ -24,7 +27,7 @@ function CDCCheckboxFilterToString(value: ICDCCheckboxFilterValue): string { return `(${value?.fields.map((v) => {return `${v} == ${value.filter.filter((f) => f === v).length > 0}`;}).join(' and ')})`; } -export function CDCCheckboxFilter({ value, onValueChanged }) { +export function CDCCheckboxFilterComponent({value, onValueChanged}) { return <> {value.fields.map((v, i) => { return ( diff --git a/src/cdc/CDCCreateEditAlert.tsx b/src/cdc/CDCCreateEditAlert.tsx index 029411fdd..d02f0ee2b 100644 --- a/src/cdc/CDCCreateEditAlert.tsx +++ b/src/cdc/CDCCreateEditAlert.tsx @@ -1,46 +1,67 @@ import React from "react"; import {ICDCFormData} from "."; -import {AccordionView} from "./AccordionView"; import {CDCFilterComponent} from "./CDCFilterComponent"; -import {IAlert, IFilter} from "./interface"; +import {IAlert, IFilter, IFilterComponent} from "./interface"; +import {v4 as uuidv4} from 'uuid'; interface ICDCCreateEditAlert { formData: ICDCFormData; setFormData: (formData: ICDCFormData) => void; selectedAlert?: IAlert; - filterSelection: IFilter[]; + filterSelection: IFilter[] | undefined; // TODO: Add error message if null --> no filters available for this cdc filter: IFilter; setFilter: (filter: IFilter) => void; + editMode?: boolean; + setEditMode?: (editMode: boolean) => void; + filterComponents: {[key: string]: IFilterComponent}; } -export function CDCCreateEditAlert({formData, setFormData, filterSelection, selectedAlert, filter, setFilter}: ICDCCreateEditAlert) { +export function CDCCreateEditAlert({formData, setFormData, filterSelection, selectedAlert, filter, setFilter, editMode, setEditMode, filterComponents}: ICDCCreateEditAlert) { + const generalInformation = formData ? + (<> +
    + + {selectedAlert && !editMode ? +

    {formData.name}

    + : + setFormData({...formData, name: e.target.value})} /> + } +
    +
    + + {selectedAlert && !editMode ? +

    {formData.name}

    + : + setFormData({...formData, cdc_id: e.target.value})} /> + } +
    + setFormData({...formData, enable_mail_notification: e.target.checked})} /> + +
    + ) : null; - const generalInformation = - (<> -
    Name
    - setFormData({...formData, name: e.target.value})}/> -
    Email notification
    - setFormData({...formData, enable_mail_notification: e.target.checked})} - /> -
    CDC
    - setFormData({...formData, cdc_id: e.target.value})}/> - ); + const accordionItem = (title: string, parentId: string, child: JSX.Element, show?: boolean) => { + const index = uuidv4(); + parentId = parentId.trim(); + return ( +
    +

    + +

    +
    + {child} +
    +
    + ); + }; - const data = selectedAlert ? [ - {title: 'Alert overview', JSX: generalInformation, show: true}, - {title: 'New literature', JSX:

    text aufgeklappt

    }, - {title: 'Filter settings', JSX: } - ] : [ - {title: "General information", JSX: generalInformation, show: true}, - {title: "Edit filters", JSX: } - ]; - - return (<> -
    Your options
    - - ); -} \ No newline at end of file + return ( +
    + {accordionItem('Alert overview', 'createAlert', generalInformation, true)} + {selectedAlert ? accordionItem('New literature', 'createAlert',

    text aufgeklappt

    ) : null} + {accordionItem('Filter settings', 'createAlert', !filter ? null : )} +
    + ); +} diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx index 23a927d74..eab3484af 100644 --- a/src/cdc/CDCFilterComponent.tsx +++ b/src/cdc/CDCFilterComponent.tsx @@ -3,47 +3,45 @@ import React from "react"; import {DndProvider} from "react-dnd"; import {HTML5Backend} from "react-dnd-html5-backend"; import {FilterCard} from "./FilterCard"; -import {getFilterFromTree, getTreeQuery, IFilter} from "./interface"; -import { v4 as uuidv4 } from 'uuid'; +import {getFilterFromTree, getTreeQuery, IFilter, IFilterComponent} from "./interface"; +import {v4 as uuidv4} from 'uuid'; interface ICDCFilterComponentProps { - filterSelection: IFilter[]; + filterSelection?: IFilter[]; filter: IFilter; - setFilter: (filter: IFilter) => void; + setFilter: React.Dispatch>; + filterComponents: {[key: string]: IFilterComponent}; } -export function CDCFilterComponent({filterSelection, filter, setFilter} : ICDCFilterComponentProps) { - +export function CDCFilterComponent({filterSelection, filter, setFilter, filterComponents}: ICDCFilterComponentProps) { React.useEffect(() => { - const test = getTreeQuery(filter); + const test = getTreeQuery(filter, filterComponents); if (test) { console.log(test); } }, [filter]); const onDelete = (newFilter: IFilter) => { - setFilter( - produce(filter, (nextFilter) => { - const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); - if (current && parent && parent.children) { - // Find the index of the current element in the parents children - const deleteIndex = parent.children.indexOf(current); - // Remove it from the current parent - if (deleteIndex !== -1) { - parent.children.splice(deleteIndex, 1); - } + setFilter((filter) => produce(filter, (nextFilter) => { + const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); + if (current && parent && parent.children) { + // Find the index of the current element in the parents children + const deleteIndex = parent.children.indexOf(current); + // Remove it from the current parent + if (deleteIndex !== -1) { + parent.children.splice(deleteIndex, 1); } - }) + } + }) ); }; const onDrop = ( item: IFilter, - { target, index }: { target: IFilter; index: number } + {target, index}: {target: IFilter; index: number} ) => { // Add item to target children array - //TODO: remove any - but TS won't stop complaining - const newFilter: any = (filter) => produce(filter, (nextFilter) => { + setFilter((filter) => produce(filter, (nextFilter) => { // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilter, // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES // ARE NOT UP-TO-DATE! @@ -67,7 +65,7 @@ export function CDCFilterComponent({filterSelection, filter, setFilter} : ICDCFi } } else { // Otherwise, it is a new item to be added in the next step - dropItem.current = { ...item, id: uuidv4() }; + dropItem.current = {...item, id: uuidv4()}; } if (dropTarget.current) { @@ -79,13 +77,12 @@ export function CDCFilterComponent({filterSelection, filter, setFilter} : ICDCFi } else { console.error('Something is wrong'); } - }); - setFilter(newFilter); + })); }; const onChange = (newFilter: IFilter, changeFunc: (filter: IFilter) => void) => { - setFilter(produce(filter, (nextFilter) => { - const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); + setFilter((filter) => produce(filter, (nextFilter) => { + const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); if (current) { changeFunc(current); } @@ -94,32 +91,33 @@ export function CDCFilterComponent({filterSelection, filter, setFilter} : ICDCFi const onValueChanged = (filter: IFilter, value: any) => { onChange(filter, (f) => { - if (f.component) { - f.component.value = value; - } + f.componentValue = value; }); }; - + return ( - -
    + +
    -
    Your filters
    - Your filters + + filterComponents={filterComponents} + />
    -
    -
    New filters
    + {filterSelection ? +
    +
    New filters
    {filterSelection.map((f) => ( - + ))} -
    -
    - +
    + : null} +
    +
    ) } diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index abaae61c8..8052ef2ef 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,14 +1,14 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import {IAlert, IFilter} from "./interface"; -import {getAlerts, saveAlert} from './api'; +import {IAlert, IFilter, IFilterComponent} from "./interface"; +import {deleteAlert, getAlerts, saveAlert} from './api'; import {CDCCreateEditAlert} from './CDCCreateEditAlert'; -import {createCDCGroupingFilter} from './CDCGroupingFilter'; -import { v4 as uuidv4 } from 'uuid'; -import {createCDCTextFilter} from './CDCTextFilter'; -import {createCDCCheckboxFilter} from './CDCCheckboxFilter'; -import {createCDCRangeFilter} from './CDCRangeFilter'; +import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter} from './CDCGroupingFilter'; +import {v4 as uuidv4} from 'uuid'; +import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './CDCTextFilter'; +import {CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter} from './CDCCheckboxFilter'; +import {CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter} from './CDCRangeFilter'; export interface ICDCFormData { name: string; @@ -16,62 +16,78 @@ export interface ICDCFormData { enable_mail_notification: boolean; } -export function CDCFilterDialog() { +const DEFAULTFORMDATA = {name: "", enable_mail_notification: false, cdc_id: ""}; +const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; + +export function CDCFilterDialog({filterComponents, filtersByCDC}: { + filterComponents: {[key: string]: IFilterComponent}; + filtersByCDC: {[cdcId: string]: IFilter[]} +}) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [formData, setFormData] = React.useState(); + const [editMode, setEditMode] = React.useState(false); + const [alertList, setAlertList] = React.useState(); React.useEffect(() => { - setFormData({ - name: "", - enable_mail_notification: false, - cdc_id: "", - }); - setFilter({ - ...createCDCGroupingFilter(uuidv4(), - 'Drop filters here'), - disableDragging: true, - disableRemoving: true - }); + setFormData(DEFAULTFORMDATA); + setFilter(DEFAULTFILTER); }, []); React.useEffect(() => { console.log(selectedAlert) + setEditMode(false); if (selectedAlert) { setFormData(selectedAlert); if (selectedAlert.filter) { - JSON.parse(selectedAlert.filter).then((test) => { - setFilter(test) - }).catch((e) => console.log(e)); + try { + setFilter(JSON.parse(selectedAlert.filter)); + } catch (e) { + console.log(e); + } } } - }, [selectedAlert]) - - - const filterSelection = [ - createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: 'field1', value: []}], fields:[{field: 'field1', options: ['hallo', 'hier', 'steht', 'text']}, {field: 'field2', options: ['tschüss', 'hier', 'nicht']}, {field: 'field3', options: ['test', 'noch ein test', 'hi']}]}), - createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), - createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1950, max: 2021}), - ]; + }, [selectedAlert]); const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); + React.useEffect(() => { + setAlertList(alerts); + }, [alerts]); const onSave = () => { //TODO: put group away again - saveAlert({...formData, filter: JSON.stringify(filter), group: "hi"}); + saveAlert({...formData, filter: JSON.stringify(filter)}); + }; + + const editButton = !creationMode ? ( + !editMode && selectedAlert ? ( + + ) : (<> + + + ) + ) : null; + + const onCreateButtonClick = () => { + setCreationMode(true); + setSelectedAlert(null); + setFormData(DEFAULTFORMDATA); + setFilter(DEFAULTFILTER); }; - // console.log(alerts); + const onDeleteButton = (id: number) => { + setAlertList([...alertList.filter((alert) => alert.id !== id)]); + deleteAlert(id); + }; return <> - setShowDialog(true)}> Alert Filter - -
    -
    -
    + setShowDialog(true)}> Alert Filter + +
    +
    +
    Alerts
    @@ -79,17 +95,17 @@ export function CDCFilterDialog() {
    -
    +
    Your alerts
    - +
    {alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} - {alertStatus === 'success' ? @@ -109,10 +134,10 @@ export function CDCFilterDialog() {
    -
    - +
    + ; } @@ -127,7 +152,21 @@ export class CDCFilterDialogClass { private init() { ReactDOM.render( - , + , this.node ); } diff --git a/src/cdc/CDCGroupingFilter.tsx b/src/cdc/CDCGroupingFilter.tsx index c927b0556..2b615147f 100644 --- a/src/cdc/CDCGroupingFilter.tsx +++ b/src/cdc/CDCGroupingFilter.tsx @@ -1,6 +1,11 @@ -import {IFilter} from './interface'; +import {IFilter, IFilterComponent} from './interface'; import * as React from 'react'; +export const CDCGroupingFilterId = 'group'; +export const CDCGroupingFilter: IFilterComponent = { + clazz: CDCGroupingFilterComponent, +} + export function createCDCGroupingFilter(id: string, name: string): IFilter { return { id, @@ -8,12 +13,11 @@ export function createCDCGroupingFilter(id: string, name: string): IFilter disableDropping: true, operator: 'AND', children: [], - component: { - clazz: CDCGroupingFilter, - } + componentId: CDCGroupingFilterId, + componentValue: null }; } -function CDCGroupingFilter() { +function CDCGroupingFilterComponent() { return

    ; } diff --git a/src/cdc/CDCRangeFilter.tsx b/src/cdc/CDCRangeFilter.tsx index cfd59d81c..0da428d13 100644 --- a/src/cdc/CDCRangeFilter.tsx +++ b/src/cdc/CDCRangeFilter.tsx @@ -1,23 +1,25 @@ -import {IFilter} from './interface'; +import {IFilter, IFilterComponent} from './interface'; import * as React from 'react'; import InputRange from 'react-input-range'; - export interface ICDCRangeFilterValue { min: number; max: number; } +export const CDCRangeFilterId = 'range'; +export const CDCRangeFilter: IFilterComponent = { + clazz: CDCRangeFilterComponent, + toFilter: CDCRangeFilterToString +}; + export function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter { return { id, name, disableDropping: true, - component: { - clazz: CDCRangeFilter, - toFilter: CDCRangeFilterToString, - value, - } + componentId: CDCRangeFilterId, + componentValue: value }; } @@ -26,15 +28,14 @@ function CDCRangeFilterToString(value: ICDCRangeFilterValue): string { return `(date >= ${value.min} and date <= ${value.max})`; } -function CDCRangeFilter({ value, onValueChanged }) { - return
    +function CDCRangeFilterComponent({value, onValueChanged}) { + return
    onValueChanged?.(v)} + disabled={!onValueChanged} + maxValue={2021} + minValue={1950} + value={{min: value.min, max: value.max}} + onChange={(v) => onValueChanged?.(v)} /> -
    ; +
    ; } - diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index 0e165c157..9227913fd 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -1,8 +1,7 @@ -import {IFilter} from './interface'; +import {IFilter, IFilterComponent} from './interface'; import * as React from 'react'; import Select from 'react-select'; - export interface ICDCTextFilterValue { fields: { field: string, @@ -14,27 +13,30 @@ export interface ICDCTextFilterValue { }[]; } +export const CDCTextFilterId = 'text'; +export const CDCTextFilter: IFilterComponent = { + clazz: CDCTextFilterComponent, + toFilter: CDCTextFilterToString +}; + export function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter { return { id, name, disableDropping: true, - component: { - clazz: CDCTextFilter, - toFilter: CDCTextFilterToString, - value, - } - }; + componentId: CDCTextFilterId, + componentValue: value + } } function CDCTextFilterToString(value: ICDCTextFilterValue): string { // Generate filter from value return `(${value.filter - .map((v) =>`${v.field} in (${v.value.join(',')})`) + .map((v) => `${v.field} in (${v.value.join(',')})`) .join(' and ')})`; } -export function CDCTextFilter({ value, onValueChanged }) { +export function CDCTextFilterComponent({value, onValueChanged}) { return <> {value.filter.map((v, i) => (
    @@ -48,10 +50,10 @@ export function CDCTextFilter({ value, onValueChanged }) { filter: value.filter.map((oldV) => oldV === v ? { - ...v, - field: e.currentTarget.value, - value: [] - } + ...v, + field: e.currentTarget.value, + value: [] + } : oldV ) }) @@ -64,31 +66,31 @@ export function CDCTextFilter({ value, onValueChanged }) { ))} -
    - ({label: value, value}))} + options={value.fields + .find((f) => f.field === v.field) + ?.options.map((o) => { + return {value: o, label: o}; + })} + onChange={(e) => + onValueChanged?.({ + ...value, + filter: value.filter.map((oldV) => + oldV === v + ? { ...v, value: e.map((value) => (value as any).value) } - : oldV - ) - }) - } - /> + : oldV + ) + }) + } + />
    + + +
    +
    + {accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true)} + {accordionItem(2, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )} +
    + + ); +} + diff --git a/src/cdc/CDCCreateEditAlert.tsx b/src/cdc/CDCCreateEditAlert.tsx deleted file mode 100644 index d02f0ee2b..000000000 --- a/src/cdc/CDCCreateEditAlert.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import React from "react"; -import {ICDCFormData} from "."; -import {CDCFilterComponent} from "./CDCFilterComponent"; -import {IAlert, IFilter, IFilterComponent} from "./interface"; -import {v4 as uuidv4} from 'uuid'; - -interface ICDCCreateEditAlert { - formData: ICDCFormData; - setFormData: (formData: ICDCFormData) => void; - selectedAlert?: IAlert; - filterSelection: IFilter[] | undefined; // TODO: Add error message if null --> no filters available for this cdc - filter: IFilter; - setFilter: (filter: IFilter) => void; - editMode?: boolean; - setEditMode?: (editMode: boolean) => void; - filterComponents: {[key: string]: IFilterComponent}; -} - -export function CDCCreateEditAlert({formData, setFormData, filterSelection, selectedAlert, filter, setFilter, editMode, setEditMode, filterComponents}: ICDCCreateEditAlert) { - const generalInformation = formData ? - (<> -
    - - {selectedAlert && !editMode ? -

    {formData.name}

    - : - setFormData({...formData, name: e.target.value})} /> - } -
    -
    - - {selectedAlert && !editMode ? -

    {formData.name}

    - : - setFormData({...formData, cdc_id: e.target.value})} /> - } -
    - setFormData({...formData, enable_mail_notification: e.target.checked})} /> - -
    - ) : null; - - const accordionItem = (title: string, parentId: string, child: JSX.Element, show?: boolean) => { - const index = uuidv4(); - parentId = parentId.trim(); - return ( -
    -

    - -

    -
    - {child} -
    -
    - ); - }; - - return ( -
    - {accordionItem('Alert overview', 'createAlert', generalInformation, true)} - {selectedAlert ? accordionItem('New literature', 'createAlert',

    text aufgeklappt

    ) : null} - {accordionItem('Filter settings', 'createAlert', !filter ? null : )} -
    - ); -} diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx new file mode 100644 index 000000000..468f94e09 --- /dev/null +++ b/src/cdc/CDCEditAlert.tsx @@ -0,0 +1,83 @@ +import React from "react"; +import {accordionItem} from "."; +import {editAlert} from "./api"; +import {CDCFilterComponent} from "./CDCFilterComponent"; +import {IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; + +interface ICDCEditAlert { + alertData: IUploadAlert; + setAlertData: (formData: IUploadAlert) => void; + filterSelection: IFilter[] | undefined; // TODO: Add error message if null --> no filters available for this cdc + filter: IFilter; + setFilter: (filter: IFilter) => void; + filterComponents: {[key: string]: IFilterComponent}; + alertList: IAlert[]; + setAlertList: (alerts: IAlert[]) => void; + selectedAlert: IAlert; + setSelctedAlert: (alert: IAlert) => void; +} + +export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, selectedAlert, setSelctedAlert}: ICDCEditAlert) { + const [editMode, setEditMode] = React.useState(false); + React.useEffect(() => { + setEditMode(false); + }, [selectedAlert]); + + const generalInformation = + (<> +
    + + {!editMode ? +

    {alertData.name}

    + : + setAlertData({...alertData, name: e.target.value})} /> + } +
    +
    + + {!editMode ? +

    {alertData.cdc_id}

    + : + setAlertData({...alertData, cdc_id: e.target.value})} /> + } +
    + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + +
    + ); + + const onSave = async () => { + const newAlert = await editAlert(selectedAlert.id, alertData); + setAlertList([newAlert, ...alertList.filter((alert) => alert.id !== selectedAlert.id)]); + setSelctedAlert(newAlert); + setEditMode(false); + }; + + const onDiscard = () => { + setAlertData(selectedAlert); + setFilter(JSON.parse(selectedAlert.filter_dump)); + setEditMode(false); + }; + + const editButton = !editMode ? ( + + ) : (<> + + + ); + + return (<> +
    +
    Your options
    + {editButton} +
    +
    + {accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true)} + {accordionItem(2, 'New literature', 'createAlert',

    text aufgeklappt

    )} + {accordionItem(3, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )} +
    + {editMode ? + + : null} + ); +} diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx index eab3484af..545b416a1 100644 --- a/src/cdc/CDCFilterComponent.tsx +++ b/src/cdc/CDCFilterComponent.tsx @@ -11,16 +11,10 @@ interface ICDCFilterComponentProps { filter: IFilter; setFilter: React.Dispatch>; filterComponents: {[key: string]: IFilterComponent}; + disableFilter?: boolean; } -export function CDCFilterComponent({filterSelection, filter, setFilter, filterComponents}: ICDCFilterComponentProps) { - React.useEffect(() => { - const test = getTreeQuery(filter, filterComponents); - if (test) { - console.log(test); - } - }, [filter]); - +export function CDCFilterComponent({filterSelection, filter, setFilter, filterComponents, disableFilter}: ICDCFilterComponentProps) { const onDelete = (newFilter: IFilter) => { setFilter((filter) => produce(filter, (nextFilter) => { const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); @@ -107,13 +101,14 @@ export function CDCFilterComponent({filterSelection, filter, setFilter, filterCo onChange={onChange} onValueChanged={onValueChanged} filterComponents={filterComponents} + disableFilter={disableFilter} />
    {filterSelection ?
    New filters
    {filterSelection.map((f) => ( - + ))}
    : null} diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 8052ef2ef..b7760b05c 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,85 +1,79 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import {IAlert, IFilter, IFilterComponent} from "./interface"; -import {deleteAlert, getAlerts, saveAlert} from './api'; -import {CDCCreateEditAlert} from './CDCCreateEditAlert'; +import {IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; +import {deleteAlert, getAlerts} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter} from './CDCGroupingFilter'; import {v4 as uuidv4} from 'uuid'; import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './CDCTextFilter'; import {CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter} from './CDCCheckboxFilter'; import {CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter} from './CDCRangeFilter'; +import {CDCCreateAlert} from './CDCCreateAlert'; +import {CDCEditAlert} from './CDCEditAlert'; -export interface ICDCFormData { - name: string; - cdc_id: string; - enable_mail_notification: boolean; +interface ICDCFilterDialogProps { + filterComponents: {[key: string]: IFilterComponent}; + filtersByCDC: {[cdcId: string]: IFilter[]}; } -const DEFAULTFORMDATA = {name: "", enable_mail_notification: false, cdc_id: ""}; -const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; +export const DEFAULTALERTDATA: IUploadAlert = {name: "", enable_mail_notification: false, cdc_id: "demo", filter_dump: "", filter_query: ""}; +export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; -export function CDCFilterDialog({filterComponents, filtersByCDC}: { - filterComponents: {[key: string]: IFilterComponent}; - filtersByCDC: {[cdcId: string]: IFilter[]} -}) { +export const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { + parentId = parentId.trim(); + return ( +
    +

    + +

    +
    + {child} +
    +
    + ); +}; + +export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDialogProps) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); - const [formData, setFormData] = React.useState(); - const [editMode, setEditMode] = React.useState(false); + const [alertData, setAlertData] = React.useState(); const [alertList, setAlertList] = React.useState(); + const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); React.useEffect(() => { - setFormData(DEFAULTFORMDATA); + setAlertData(DEFAULTALERTDATA); setFilter(DEFAULTFILTER); }, []); - React.useEffect(() => { - console.log(selectedAlert) - setEditMode(false); - if (selectedAlert) { - setFormData(selectedAlert); - if (selectedAlert.filter) { - try { - setFilter(JSON.parse(selectedAlert.filter)); - } catch (e) { - console.log(e); - } - } - } - }, [selectedAlert]); - - const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); React.useEffect(() => { setAlertList(alerts); }, [alerts]); - const onSave = () => { - //TODO: put group away again - saveAlert({...formData, filter: JSON.stringify(filter)}); - }; - - const editButton = !creationMode ? ( - !editMode && selectedAlert ? ( - - ) : (<> - - - ) - ) : null; - const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); - setFormData(DEFAULTFORMDATA); + setAlertData(DEFAULTALERTDATA); setFilter(DEFAULTFILTER); }; - const onDeleteButton = (id: number) => { + const onDeleteButton = async (id: number) => { setAlertList([...alertList.filter((alert) => alert.id !== id)]); - deleteAlert(id); + await deleteAlert(id); + if (selectedAlert.id === id) { + setSelectedAlert(null); + } + }; + + const onAlertClick = async (alert: IAlert) => { + console.log(alert); + setAlertData(alert); + setFilter(JSON.parse(alert.filter_dump)); + setCreationMode(false); + setSelectedAlert(alert); }; return <> @@ -102,7 +96,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: { {alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} {alertStatus === 'success' ?
    - + {/* */}
    @@ -155,8 +163,8 @@ export class CDCFilterDialogClass { = ${value.min} and date <= ${value.max})`; } -function CDCRangeFilterComponent({value, onValueChanged}) { +function CDCRangeFilterComponent({value, onValueChanged, disabled}) { return
    {value.filter.map((v, i) => (
    ({label: value, value}))} options={value.fields @@ -92,21 +92,23 @@ export function CDCTextFilterComponent({value, onValueChanged}) { } />
    - + {disabled ? null : + + }
    ))} - {onValueChanged ? ( + {onValueChanged && !disabled ? ( - + +
    {accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true)} {accordionItem(2, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )}
    - ); } diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index 468f94e09..fc5c9f7bf 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -1,13 +1,14 @@ import React from "react"; +import Select from 'react-select'; import {accordionItem} from "."; import {editAlert} from "./api"; import {CDCFilterComponent} from "./CDCFilterComponent"; -import {IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; +import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; - filterSelection: IFilter[] | undefined; // TODO: Add error message if null --> no filters available for this cdc + filterSelection: IFilter[] | undefined; filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: {[key: string]: IFilterComponent}; @@ -15,9 +16,10 @@ interface ICDCEditAlert { setAlertList: (alerts: IAlert[]) => void; selectedAlert: IAlert; setSelctedAlert: (alert: IAlert) => void; + cdcs: string[]; } -export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, selectedAlert, setSelctedAlert}: ICDCEditAlert) { +export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, selectedAlert, setSelctedAlert, cdcs}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); React.useEffect(() => { setEditMode(false); @@ -35,19 +37,33 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter,
    - {!editMode ? -

    {alertData.cdc_id}

    - : - setAlertData({...alertData, cdc_id: e.target.value})} /> - } + setAlertData({...alertData, enable_mail_notification: e.target.checked})} />
    ); + const literature = () => { + const data = JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added; + return (<>{data?.length > 0 ? (<> +
    New literature from:
    +

    {selectedAlert.latest_compare_date}

    +
    Literature:
    + {data.map((d, i) =>

    {d}

    )} + ) : ( +

    No new literature available

    + )} + ); + }; + const onSave = async () => { - const newAlert = await editAlert(selectedAlert.id, alertData); + const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); setAlertList([newAlert, ...alertList.filter((alert) => alert.id !== selectedAlert.id)]); setSelctedAlert(newAlert); setEditMode(false); @@ -60,10 +76,10 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, }; const editButton = !editMode ? ( - + ) : (<> - - + + ); return (<> @@ -72,12 +88,9 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, {editButton}
    - {accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true)} - {accordionItem(2, 'New literature', 'createAlert',

    text aufgeklappt

    )} + {accordionItem(1, 'New literature', 'createAlert', literature(), true)} + {accordionItem(2, 'Alert overview', 'createAlert', generalInformation)} {accordionItem(3, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )}
    - {editMode ? - - : null} ); } diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index b7760b05c..e3a23d631 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; import {IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; -import {deleteAlert, getAlerts} from './api'; +import {deleteAlert, getAlerts, runAlertById} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter} from './CDCGroupingFilter'; import {v4 as uuidv4} from 'uuid'; import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './CDCTextFilter'; @@ -42,15 +42,19 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); const [alertList, setAlertList] = React.useState(); + const [cdcs, setCdcs] = React.useState(); const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); React.useEffect(() => { setAlertData(DEFAULTALERTDATA); setFilter(DEFAULTFILTER); + setCdcs(["demo"]); }, []); React.useEffect(() => { - setAlertList(alerts); + const runAlerts = []; + alerts?.sort((a, b) => a.modification_date > b.modification_date ? -1 : a.modification_date < b.modification_date ? 1 : 0).forEach((alert) => runAlertById(alert.id).then((a) => runAlerts.push(a))); + setAlertList(runAlerts); }, [alerts]); const onCreateButtonClick = () => { @@ -63,19 +67,21 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial const onDeleteButton = async (id: number) => { setAlertList([...alertList.filter((alert) => alert.id !== id)]); await deleteAlert(id); - if (selectedAlert.id === id) { - setSelectedAlert(null); - } + setSelectedAlert(null); }; const onAlertClick = async (alert: IAlert) => { - console.log(alert); setAlertData(alert); setFilter(JSON.parse(alert.filter_dump)); setCreationMode(false); setSelectedAlert(alert); }; + const newLiteratureCount = (alert: IAlert) => { + const data = JSON.parse(alert?.latest_diff)?.dictionary_item_added; + return data?.length > 0 ? {data.length} : null; + }; + return <>
    setShowDialog(true)}> Alert Filter @@ -91,18 +97,17 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    Your alerts
    - +
    {alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} {alertStatus === 'success' ? @@ -118,6 +123,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setAlertList={setAlertList} selectedAlert={selectedAlert} setSelctedAlert={setSelectedAlert} + cdcs={cdcs} /> : creationMode ? @@ -132,6 +138,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setAlertList={setAlertList} setSelectedAlert={setSelectedAlert} setCreationMode={setCreationMode} + cdcs={cdcs} /> : null } @@ -140,7 +147,6 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    - {/* */}
    @@ -170,9 +176,9 @@ export class CDCFilterDialogClass { filtersByCDC={{ 'demo': [ createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: 'field1', value: []}], fields: [{field: 'field1', options: ['hallo', 'hier', 'steht', 'text']}, {field: 'field2', options: ['tschüss', 'hier', 'nicht']}, {field: 'field3', options: ['test', 'noch ein test', 'hi']}]}), + createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: `item["address"]["city"]`, value: []}], fields: [{field: `item["address"]["city"]`, options: [`"Gwenborough"`, `"Wisokyburgh"`, `"McKenziehaven"`, `"South Elvis"`, `"Roscoeview"`, `"South Christy"`, `"Howemouth"`, `"Aliyaview"`, `"Bartholomebury"`]}, {field: `item["address"]["zipcode"]`, options: [`"33263"`, `"23505-1337"`, `"58804-1099"`]}, {field: `item["name"]`, options: [`"Leanne Graham"`, `"Ervin Howell"`, `"Glenna Reichert"`, `"Clementina DuBuque"`]}]}), createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), - createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1950, max: 2021}), + createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1, max: 10}), ] }} />, this.node diff --git a/src/cdc/CDCRangeFilter.tsx b/src/cdc/CDCRangeFilter.tsx index 427f58dac..600578015 100644 --- a/src/cdc/CDCRangeFilter.tsx +++ b/src/cdc/CDCRangeFilter.tsx @@ -25,15 +25,15 @@ export function createCDCRangeFilter(id: string, name: string, value: ICDCRangeF function CDCRangeFilterToString(value: ICDCRangeFilterValue): string { // Generate filter from value - return `(date >= ${value.min} and date <= ${value.max})`; + return `(item["id"] >= ${value.min} and item["id"] <= ${value.max})`; } function CDCRangeFilterComponent({value, onValueChanged, disabled}) { return
    onValueChanged?.(v)} /> diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index 8d99939c9..13f518cc0 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -101,16 +101,16 @@ export function CDCTextFilterComponent({value, onValueChanged, disabled}) { filter: value.filter.filter((oldV) => oldV !== v) }) } - className="btn btn-secondary" + className="btn btn-text-secondary" > - X + }
    ))} {onValueChanged && !disabled ? ( ) : null} ; diff --git a/src/cdc/FilterCard.tsx b/src/cdc/FilterCard.tsx index c9bf0b07e..8d905517b 100644 --- a/src/cdc/FilterCard.tsx +++ b/src/cdc/FilterCard.tsx @@ -51,11 +51,12 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, {filter.name}
    - {onChange && hasChildren && filter?.children?.length > 1 && !disableFilter ? ( + {onChange && hasChildren && filter?.children?.length > 1 ? ( {return {label: c, value: c}})} + options={cdcs.map((c) => {return {label: c, value: c};})} value={{label: alertData.cdc_id, value: alertData.cdc_id}} - onChange={e => setAlertData({...alertData, cdc_id: e.value})} + onChange={(e) => setAlertData({...alertData, cdc_id: e.value})} />
    setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index fc5c9f7bf..91df5e4dd 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -1,9 +1,9 @@ -import React from "react"; +import React from 'react'; import Select from 'react-select'; -import {accordionItem} from "."; -import {editAlert} from "./api"; -import {CDCFilterComponent} from "./CDCFilterComponent"; -import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; +import {accordionItem} from '.'; +import {editAlert} from './api'; +import {CDCFilterComponent} from './CDCFilterComponent'; +import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; interface ICDCEditAlert { alertData: IUploadAlert; @@ -39,9 +39,9 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx index 545b416a1..2377da4b8 100644 --- a/src/cdc/CDCFilterComponent.tsx +++ b/src/cdc/CDCFilterComponent.tsx @@ -1,9 +1,9 @@ -import produce from "immer"; -import React from "react"; -import {DndProvider} from "react-dnd"; -import {HTML5Backend} from "react-dnd-html5-backend"; -import {FilterCard} from "./FilterCard"; -import {getFilterFromTree, getTreeQuery, IFilter, IFilterComponent} from "./interface"; +import produce from 'immer'; +import React from 'react'; +import {DndProvider} from 'react-dnd'; +import {HTML5Backend} from 'react-dnd-html5-backend'; +import {FilterCard} from './FilterCard'; +import {getFilterFromTree, IFilter, IFilterComponent} from './interface'; import {v4 as uuidv4} from 'uuid'; interface ICDCFilterComponentProps { @@ -114,5 +114,5 @@ export function CDCFilterComponent({filterSelection, filter, setFilter, filterCo : null}
    - ) + ); } diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index e3a23d631..019c51574 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert} from "./interface"; +import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; import {deleteAlert, getAlerts, runAlertById} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter} from './CDCGroupingFilter'; import {v4 as uuidv4} from 'uuid'; @@ -16,7 +16,7 @@ interface ICDCFilterDialogProps { filtersByCDC: {[cdcId: string]: IFilter[]}; } -export const DEFAULTALERTDATA: IUploadAlert = {name: "", enable_mail_notification: false, cdc_id: "demo", filter_dump: "", filter_query: ""}; +export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: '', filter_query: ''}; export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; export const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { @@ -28,7 +28,7 @@ export const accordionItem = (index: number, title: string, parentId: string, ch {title} -
    +
    {child}
    @@ -48,7 +48,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial React.useEffect(() => { setAlertData(DEFAULTALERTDATA); setFilter(DEFAULTFILTER); - setCdcs(["demo"]); + setCdcs(['demo']); }, []); React.useEffect(() => { @@ -102,7 +102,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial {alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} {alertStatus === 'success' ?
    {alertList.map((alert) => -
    onAlertClick(alert)} aria-current="true"> +
    onAlertClick(alert)} aria-current="true">
    {alert.name} for {alert.cdc_id} {newLiteratureCount(alert)}
    {selectedAlert === alert ? onDeleteButton(alert.id)}> : null} @@ -133,7 +133,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial filter={filter} setFilter={setFilter} filterComponents={filterComponents} - filterSelection={filtersByCDC["demo"]} + filterSelection={filtersByCDC['demo']} alertList={alertList} setAlertList={setAlertList} setSelectedAlert={setSelectedAlert} diff --git a/src/cdc/CDCGroupingFilter.tsx b/src/cdc/CDCGroupingFilter.tsx index 2b615147f..5b98873ba 100644 --- a/src/cdc/CDCGroupingFilter.tsx +++ b/src/cdc/CDCGroupingFilter.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; export const CDCGroupingFilterId = 'group'; export const CDCGroupingFilter: IFilterComponent = { clazz: CDCGroupingFilterComponent, -} +}; export function createCDCGroupingFilter(id: string, name: string): IFilter { return { diff --git a/src/cdc/DropZone.tsx b/src/cdc/DropZone.tsx index 05aea8bf6..79af4cfae 100644 --- a/src/cdc/DropZone.tsx +++ b/src/cdc/DropZone.tsx @@ -9,7 +9,7 @@ interface IDropZoneProps { index: number; } -export function DropZone({canDrop, onDrop, filter, index} : IDropZoneProps) { +export function DropZone({canDrop, onDrop, filter, index}: IDropZoneProps) { // TODO: Add proper types such that draggedItem can be infered const [{ isOver, draggedItem }, drop] = useDrop( () => ({ From 3eb360b6f9e6acccd0d5d79a9afac83034d94bf9 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Wed, 27 Oct 2021 15:01:22 +0200 Subject: [PATCH 11/40] add backend concept + some UI improvements + add confirm button to edit dialog --- dist/cdc/CDCCheckboxFilter.js | 1 + dist/cdc/CDCCheckboxFilter.js.map | 2 +- dist/cdc/CDCCreateAlert.d.ts | 5 +-- dist/cdc/CDCCreateAlert.js | 10 +++-- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.d.ts | 7 ++- dist/cdc/CDCEditAlert.js | 39 +++++++++++------ dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.js | 65 ++++++++++++--------------- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CDCTextFilter.d.ts | 20 +++++++-- dist/cdc/CDCTextFilter.js | 32 ++++++-------- dist/cdc/CDCTextFilter.js.map | 2 +- dist/cdc/api.d.ts | 1 + dist/cdc/api.js | 6 +-- dist/cdc/api.js.map | 2 +- dist/cdc/interface.d.ts | 3 +- dist/cdc/interface.js.map | 2 +- src/cdc/CDCCheckboxFilter.tsx | 2 + src/cdc/CDCCreateAlert.tsx | 13 +++--- src/cdc/CDCEditAlert.tsx | 43 +++++++++++------- src/cdc/CDCFilterDialog.tsx | 52 +++++++++------------- src/cdc/CDCTextFilter.tsx | 73 ++++++++++++++----------------- src/cdc/api.ts | 6 +-- src/cdc/interface.ts | 3 +- tdp_core/cdc/BaseCDC.py | 15 ++++++- tdp_core/cdc/CDCAlert.py | 4 ++ tdp_core/cdc/CDCManager.py | 36 ++++++++------- tdp_core/cdc/DemoCDC.py | 3 +- tdp_core/cdc/api.py | 3 +- 30 files changed, 247 insertions(+), 209 deletions(-) diff --git a/dist/cdc/CDCCheckboxFilter.js b/dist/cdc/CDCCheckboxFilter.js index 7df5d4107..a0200190e 100644 --- a/dist/cdc/CDCCheckboxFilter.js +++ b/dist/cdc/CDCCheckboxFilter.js @@ -17,6 +17,7 @@ function CDCCheckboxFilterToString(value) { // Generate filter from value return `(${value === null || value === void 0 ? void 0 : value.fields.map((v) => { return `${v} == ${value.filter.filter((f) => f === v).length > 0}`; }).join(' and ')})`; } +//checkbox1 == true and checkbox2 == false and item["address"] == true export function CDCCheckboxFilterComponent({ value, onValueChanged, disabled }) { return React.createElement(React.Fragment, null, value.fields.map((v, i) => { return (React.createElement("div", { key: i, className: "input-group m-1" }, diff --git a/dist/cdc/CDCCheckboxFilter.js.map b/dist/cdc/CDCCheckboxFilter.js.map index fabed43d7..5fb7ba72b 100644 --- a/dist/cdc/CDCCheckboxFilter.js.map +++ b/dist/cdc/CDCCheckboxFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAC9C,MAAM,CAAC,MAAM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BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,CAAC,CACI,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/CDCCreateAlert.d.ts index 2dec2ec1b..15d0ca174 100644 --- a/dist/cdc/CDCCreateAlert.d.ts +++ b/dist/cdc/CDCCreateAlert.d.ts @@ -9,11 +9,10 @@ interface ICDCCreateAlert { filterComponents: { [key: string]: IFilterComponent; }; - alertList: IAlert[]; - setAlertList: (alerts: IAlert[]) => void; + fetchAlerts: () => void; setSelectedAlert: (alert: IAlert) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; } -export declare function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, setCreationMode, setSelectedAlert, cdcs }: ICDCCreateAlert): JSX.Element; +export declare function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, setCreationMode, setSelectedAlert, cdcs }: ICDCCreateAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index ca4d02e0a..269f90806 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -1,10 +1,10 @@ import React from 'react'; import Select from 'react-select'; import { accordionItem } from '.'; -import { saveAlert } from './api'; +import { runAlertById, saveAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; -export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, setCreationMode, setSelectedAlert, cdcs }) { +export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, setCreationMode, setSelectedAlert, cdcs }) { const generalInformation = (React.createElement(React.Fragment, null, React.createElement("div", { className: "mb-3" }, React.createElement("label", { className: "form-label" }, "Name"), @@ -17,9 +17,11 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement("div", { className: "mb-3 form-check" }))); const onSave = async () => { const newAlert = await saveAlert({ ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - setAlertList([newAlert, ...alertList]); - setSelectedAlert(newAlert); + await runAlertById(newAlert.id); + await fetchAlerts(); setCreationMode(false); + // setSelectedAlert(newAlert); + setSelectedAlert(null); }; return (React.createElement(React.Fragment, null, React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index e8690ab26..c64ac89ca 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,GAAG,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAgB1F,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,IAAI,EAAkB;IAE/L,MAAM,kBAAkB,GACtB,CAAC;QACC,6BAAK,SAAS,EAAC,MAAM;YACnB,+BAAO,SAAS,EAAC,YAAY,WAAa;YAC1C,+BAAO,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,SAAS,CAAC,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AAC;YAC3E,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CACnQ,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.d.ts b/dist/cdc/CDCEditAlert.d.ts index fa0e2aabc..02c23ae0c 100644 --- a/dist/cdc/CDCEditAlert.d.ts +++ b/dist/cdc/CDCEditAlert.d.ts @@ -9,11 +9,10 @@ interface ICDCEditAlert { filterComponents: { [key: string]: IFilterComponent; }; - alertList: IAlert[]; - setAlertList: (alerts: IAlert[]) => void; + fetchAlerts: () => void; selectedAlert: IAlert; - setSelctedAlert: (alert: IAlert) => void; + setSelectedAlert: (alert: IAlert) => void; cdcs: string[]; } -export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, selectedAlert, setSelctedAlert, cdcs }: ICDCEditAlert): JSX.Element; +export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, selectedAlert, setSelectedAlert, cdcs }: ICDCEditAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index 915ed40e6..afb4c022f 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -1,10 +1,11 @@ import React from 'react'; import Select from 'react-select'; import { accordionItem } from '.'; -import { editAlert } from './api'; +import { confirmAlertById, deleteAlert, editAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; -export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, selectedAlert, setSelctedAlert, cdcs }) { +export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, selectedAlert, setSelectedAlert, cdcs }) { + var _a; const [editMode, setEditMode] = React.useState(false); React.useEffect(() => { setEditMode(false); @@ -26,15 +27,19 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, var _a; const data = (_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added; return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.length) > 0 ? (React.createElement(React.Fragment, null, - React.createElement("h6", null, "New literature from:"), - React.createElement("p", null, selectedAlert.latest_compare_date), React.createElement("h6", null, "Literature:"), - data.map((d, i) => React.createElement("p", { key: i }, d)))) : (React.createElement("p", null, "No new literature available")))); + data.map((d, i) => React.createElement("p", { key: i }, d)), + React.createElement("button", { className: "btn btn-secondary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm changes"))) : (React.createElement("p", null, "No new data available")))); + }; + const confirmChanges = async (id) => { + const alert = await confirmAlertById(id); + await fetchAlerts(); + setSelectedAlert(alert); }; const onSave = async () => { const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - setAlertList([newAlert, ...alertList.filter((alert) => alert.id !== selectedAlert.id)]); - setSelctedAlert(newAlert); + await fetchAlerts(); + setSelectedAlert(newAlert); setEditMode(false); }; const onDiscard = () => { @@ -42,8 +47,16 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter(JSON.parse(selectedAlert.filter_dump)); setEditMode(false); }; - const editButton = !editMode ? (React.createElement("button", { className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, - React.createElement("i", { className: "fas fa-pencil-alt" }))) : (React.createElement(React.Fragment, null, + const onDelete = async (id) => { + await fetchAlerts(); + await deleteAlert(id); + setSelectedAlert(null); + }; + const editButton = !editMode ? (React.createElement(React.Fragment, null, + React.createElement("button", { className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, + React.createElement("i", { className: "fas fa-pencil-alt" })), + React.createElement("button", { className: "btn btn-text-secondary", onClick: () => onDelete(selectedAlert.id) }, + React.createElement("i", { className: "fas fa-trash" })))) : (React.createElement(React.Fragment, null, React.createElement("button", { title: "Save changes", className: "btn btn-text-secondary", onClick: () => onSave() }, React.createElement("i", { className: "fas fa-save" })), React.createElement("button", { title: "Discard changes", className: "btn btn-text-secondary ms-1", onClick: () => onDiscard() }, @@ -52,9 +65,9 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, React.createElement("h5", null, "Your options"), React.createElement("small", null, editButton)), - React.createElement("div", { className: "accordion", id: "createAlert" }, - accordionItem(1, 'New literature', 'createAlert', literature(), true), - accordionItem(2, 'Alert overview', 'createAlert', generalInformation), - accordionItem(3, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode })) : React.createElement("p", null, "No filters available for this cdc"))))); + React.createElement("div", { className: "accordion", id: "editAlert" }, + accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true), + accordionItem(2, 'Alert overview', 'editAlert', generalInformation), + accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode })) : React.createElement("p", null, "No filters available for this cdc"))))); } //# sourceMappingURL=CDCEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index dfc2ed016..ae83e3fd2 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,GAAG,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAgB1F,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAgB;IACxL,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,kBAAkB,GACtB,CAAC;QACC,6BAAK,SAAS,EAAC,MAAM;YACnB,+BAAO,SAAS,EAAC,YAAY,WAAa;YACzC,CAAC,QAAQ,CAAC,CAAC;gBACV,+BAAI,SAAS,CAAC,IAAI,CAAK;gBACvB,CAAC;oBACD,+BAAO,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,M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AAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CAC9S,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index d28317108..310ebff66 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -1,7 +1,7 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import { BSModal, useAsync } from '../hooks'; -import { deleteAlert, getAlerts, runAlertById } from './api'; +import { getAlerts, runAlertById } from './api'; import { CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter } from './CDCGroupingFilter'; import { v4 as uuidv4 } from 'uuid'; import { CDCTextFilter, CDCTextFilterId, createCDCTextFilter } from './CDCTextFilter'; @@ -24,40 +24,27 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); - const [alertList, setAlertList] = React.useState(); const [cdcs, setCdcs] = React.useState(); - const { status: alertStatus, error: alertError, execute: alertExecute, value: alerts } = useAsync(getAlerts, true); + const { status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts } = useAsync(getAlerts, true); React.useEffect(() => { setAlertData(DEFAULTALERTDATA); setFilter(DEFAULTFILTER); setCdcs(['demo']); }, []); - React.useEffect(() => { - const runAlerts = []; - alerts === null || alerts === void 0 ? void 0 : alerts.sort((a, b) => a.modification_date > b.modification_date ? -1 : a.modification_date < b.modification_date ? 1 : 0).forEach((alert) => runAlertById(alert.id).then((a) => runAlerts.push(a))); - setAlertList(runAlerts); - }, [alerts]); const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); setAlertData(DEFAULTALERTDATA); setFilter(DEFAULTFILTER); }; - const onDeleteButton = async (id) => { - setAlertList([...alertList.filter((alert) => alert.id !== id)]); - await deleteAlert(id); - setSelectedAlert(null); - }; const onAlertClick = async (alert) => { setAlertData(alert); setFilter(JSON.parse(alert.filter_dump)); setCreationMode(false); setSelectedAlert(alert); }; - const newLiteratureCount = (alert) => { - var _a; - const data = (_a = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added; - return (data === null || data === void 0 ? void 0 : data.length) > 0 ? React.createElement("span", { className: "badge bg-primary rounded-pill ms-1" }, data.length) : null; + const onAlertChanged = async () => { + await fetchAlerts(); }; return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, @@ -72,7 +59,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { React.createElement("button", { type: "button", className: "btn-close", "data-bs-dismiss": "modal", "aria-label": "Close" })), React.createElement("div", { className: "modal-body" }, React.createElement("div", { className: "row" }, - React.createElement("div", { className: "col-4 overflow-auto" }, + React.createElement("div", { className: "col-3 overflow-auto" }, React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, React.createElement("h5", null, "Your alerts"), React.createElement("small", null, @@ -82,28 +69,32 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { alertStatus === 'error' ? React.createElement(React.Fragment, null, "Error ", alertError.toString()) : null, - alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alertList.map((alert) => React.createElement("div", { key: alert.id }, - React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, - React.createElement("div", { className: "d-flex w-100 justify-content-between" }, - React.createElement("h6", { className: "mb-1" }, - alert.name, - " ", - React.createElement("small", { className: "text-muted" }, - "for ", - alert.cdc_id), - " ", - newLiteratureCount(alert)), - selectedAlert === alert ? React.createElement("span", { className: "text-muted", onClick: () => onDeleteButton(alert.id) }, - React.createElement("i", { className: "fas fa-trash" })) : null), - React.createElement("small", null, alert.confirmation_date ? `last confirmed: ${alert.confirmation_date}` : 'No data revision yet'))))) : null), - React.createElement("div", { className: "col-8 overflow-auto" }, selectedAlert ? - React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC[selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.cdc_id], filterComponents: filterComponents, alertList: alertList, setAlertList: setAlertList, selectedAlert: selectedAlert, setSelctedAlert: setSelectedAlert, cdcs: cdcs }) + alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => { + var _a, _b; + return React.createElement("div", { key: alert.id }, + React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, + React.createElement("div", { className: "d-flex w-100 justify-content-between" }, + React.createElement("h6", { className: "mb-1" }, + alert.name, + " ", + React.createElement("small", { className: "text-muted" }, + "for ", + alert.cdc_id)), + ((_b = (_a = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.length) > 0 ? React.createElement("small", null, + React.createElement("i", { className: "fas fa-circle text-danger" })) : null), + React.createElement("small", null, !alert.latest_diff && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${alert.confirmation_date}`))); + })) : null), + React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert ? + React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, fetchAlerts: () => onAlertChanged(), selectedAlert: selectedAlert, setSelectedAlert: setSelectedAlert, cdcs: cdcs }) : creationMode ? - React.createElement(CDCCreateAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], alertList: alertList, setAlertList: setAlertList, setSelectedAlert: setSelectedAlert, setCreationMode: setCreationMode, cdcs: cdcs }) + React.createElement(CDCCreateAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], fetchAlerts: () => onAlertChanged(), setSelectedAlert: setSelectedAlert, setCreationMode: setCreationMode, cdcs: cdcs }) : null))), React.createElement("div", { className: "modal-footer" }, - React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"))))))); + React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), + React.createElement("button", { type: "button", onClick: () => { + Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlertById(alert.id))).then(() => fetchAlerts()); + }, className: "btn btn-secondary" }, "Sync"))))))); } export class CDCFilterDialogClass { constructor(parent) { @@ -120,7 +111,7 @@ export class CDCFilterDialogClass { }, filtersByCDC: { 'demo': [ createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: `item["address"]["city"]`, value: [] }], fields: [{ field: `item["address"]["city"]`, options: [`"Gwenborough"`, `"Wisokyburgh"`, `"McKenziehaven"`, `"South Elvis"`, `"Roscoeview"`, `"South Christy"`, `"Howemouth"`, `"Aliyaview"`, `"Bartholomebury"`] }, { field: `item["address"]["zipcode"]`, options: [`"33263"`, `"23505-1337"`, `"58804-1099"`] }, { field: `item["name"]`, options: [`"Leanne Graham"`, `"Ervin Howell"`, `"Glenna Reichert"`, `"Clementina DuBuque"`] }] }), + createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: null, value: [] }], fields: [{ field: { label: 'City', value: `item["address"]["city"]` }, options: [{ label: 'Gwenborough', value: `"Gwenborough"` }, { label: 'Wisokyburgh', value: `"Wisokyburgh"` }, { label: 'McKenziehaven', value: `"McKenziehaven"` }, { label: 'Roscoeview', value: `"Roscoeview"` }, { label: 'Aliyaview', value: `"Aliyaview"` }, { label: 'Howemouth', value: `"Howemouth"` }] }, { field: { label: "Zip Code", value: `item["address"]["zipcode"]` }, options: [{ label: '33263', value: `"33263"` }, { label: '23505-1337', value: `"23505-1337"` }, { label: '58804-1099', value: `"58804-1099"` }] }, { field: { label: 'Name', value: `item["name"]` }, options: [{ label: 'Leanne Graham', value: `"Leanne Graham"` }, { label: 'Ervin Howell', value: `"Ervin Howell"` }, { label: 'Glenna Reichert', value: `"Glenna Reichert"` }, { label: 'Clementina DuBuque', value: `"Clementina DuBuque"` }] }] }), createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1, max: 10 }), ] diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 7cc5d3727..3a2c6c638 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,kBAA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G,oBAAoB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,CAAC;iBAClE;aACF,GAAI,EACP,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.d.ts b/dist/cdc/CDCTextFilter.d.ts index 6de58857a..43c81b589 100644 --- a/dist/cdc/CDCTextFilter.d.ts +++ b/dist/cdc/CDCTextFilter.d.ts @@ -2,12 +2,24 @@ import { IFilter, IFilterComponent } from './interface'; export interface ICDCTextFilterValue { fields: { - field: string; - options: string[]; + field: { + label: string; + value: string; + }; + options: { + label: string; + value: string; + }[]; }[]; filter: { - field: string; - value: string[]; + field: { + label: string; + value: string; + }; + value: { + label: string; + value: string; + }[]; }[]; } export declare const CDCTextFilterId = "text"; diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/CDCTextFilter.js index 79455160f..b996d5f1c 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/CDCTextFilter.js @@ -17,7 +17,7 @@ export function createCDCTextFilter(id, name, value) { function CDCTextFilterToString(value) { // Generate filter from value return `(${value.filter - .map((v) => `${v.field} in (${v.value.join(',')})`) + .map((v) => `${v.field.value} in (${v.value.map((vV => vV.value)).join(',')})`) .join(' and ')})`; } export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { @@ -25,28 +25,24 @@ export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { value.filter.map((v, i) => { var _a; return (React.createElement("div", { key: i, className: "input-group m-1" }, - React.createElement("select", { className: "form-select", disabled: !onValueChanged || disabled, value: v.field, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.map((oldV) => oldV === v - ? { - ...v, - field: e.currentTarget.value, - value: [] - } - : oldV) - }) }, - React.createElement("option", { value: "" }, "Select..."), - value.fields.map((f) => (React.createElement("option", { value: f.field, key: f.field }, f.field)))), + React.createElement("div", { style: { width: '30%' } }, + React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: v.field, options: [...value.fields.map((field) => field.field)], onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + ...value, + filter: value.filter.map((oldV) => oldV === v + ? { + ...v, + field: e, + value: [] + } + : oldV) + }) })), React.createElement("div", { style: { width: '70%' } }, - React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled, isMulti: true, value: v.value.map((value) => ({ label: value, value })), options: (_a = value.fields - .find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { - return { value: o, label: o }; - }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !v.field, isMulti: true, value: v.value, options: (_a = value.fields.find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, filter: value.filter.map((oldV) => oldV === v ? { ...v, - value: e.map((value) => value.value) + value: e } : oldV) }) })), diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map index 56ddf5f5e..1d54cc8fd 100644 --- a/dist/cdc/CDCTextFilter.js.map +++ b/dist/cdc/CDCTextFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAalC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY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C,CAAC,EAAE,EAAE,CACb,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;4BACf,GAAG,KAAK;4BACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;yBAClD,CAAC,EAEJ,SAAS,EAAC,wBAAwB;wBAElC,2BAAG,SAAS,EAAC,cAAc,GAAK,CACzB,CAEP,CACP,CAAA;SAAA,CAAC;QACD,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAiBlC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CA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KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/api.d.ts b/dist/cdc/api.d.ts index 6def51605..5137bcfb4 100644 --- a/dist/cdc/api.d.ts +++ b/dist/cdc/api.d.ts @@ -15,3 +15,4 @@ export declare function editAlert(id: number, alert: Partial): Promise; export declare function saveAlert(alert: IUploadAlert): Promise; export declare function runAlertById(id: number): Promise; +export declare function confirmAlertById(id: number): Promise; diff --git a/dist/cdc/api.js b/dist/cdc/api.js index a2915b2ca..861adbb84 100644 --- a/dist/cdc/api.js +++ b/dist/cdc/api.js @@ -27,7 +27,7 @@ export async function saveAlert(alert) { export async function runAlertById(id) { return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}/run`); } -// export async function getCDCs(): Promise { -// return AppContext.getInstance().getAPIJSON(`/tdp/cdc`); -// } +export async function confirmAlertById(id) { + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}/confirm`); +} //# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/dist/cdc/api.js.map b/dist/cdc/api.js.map index e7a50e45d..895064432 100644 --- a/dist/cdc/api.js.map +++ b/dist/cdc/api.js.map @@ -1 +1 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/cdc/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;2DAS2D;AAE3D,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,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cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -32,7 +32,6 @@ export interface IAlert { id: number; name: string; cdc_id: string; - confirmation_date?: string; filter_dump: string; filter_query: string; enable_mail_notification: boolean; @@ -40,6 +39,8 @@ export interface IAlert { latest_fetched_data: string; latest_compare_date: string; modification_date: string; + confirmed_data: string; + confirmation_date: string; } export interface IUploadAlert extends Pick { } diff --git a/dist/cdc/interface.js.map b/dist/cdc/interface.js.map index 64c501e17..6da3c2775 100644 --- a/dist/cdc/interface.js.map +++ b/dist/cdc/interface.js.map @@ -1 +1 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/cdc/interface.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE;YACX,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;SAClC;QACD,wCAAwC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;SACF;KACF;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Aa;QACb,IACE,MAAM;YACN,UAAU,WACV,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,0CAAE,KAAK,CAAA,WACrC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,0CAAE,QAAQ,CAAA,EACxC;YACA,OAAO,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;SACvE;aAAM;YACL,OAAO,EAAE,CAAC;SACX;KACF;SAAM;QACL,wBAAwB;QACxB,IAAI,WAAW,GAAG,GAAG,CAAC;QACtB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;;YACnC,WAAW,IAAI,GAAG,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;gBACnG,CAAC,CAAC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAK,KAAK;oBAC9B,CAAC,CAAC,SAAS;oBACX,CAAC,OAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,WAAW,EACjC,GAAG;gBACH,CAAC,CAAC,EACF,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;QACH,WAAW,IAAI,GAAG,CAAC;QACnB,OAAO,WAAW,CAAC;KACpB;AACH,CAAC,CAAC;AAmBF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCCheckboxFilter.tsx b/src/cdc/CDCCheckboxFilter.tsx index c0557f094..2c7cac77d 100644 --- a/src/cdc/CDCCheckboxFilter.tsx +++ b/src/cdc/CDCCheckboxFilter.tsx @@ -27,6 +27,8 @@ function CDCCheckboxFilterToString(value: ICDCCheckboxFilterValue): string { return `(${value?.fields.map((v) => {return `${v} == ${value.filter.filter((f) => f === v).length > 0}`;}).join(' and ')})`; } +//checkbox1 == true and checkbox2 == false and item["address"] == true + export function CDCCheckboxFilterComponent({value, onValueChanged, disabled}) { return <> {value.fields.map((v, i) => { diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index e23664f67..798ceb4bc 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Select from 'react-select'; import {accordionItem} from '.'; -import {saveAlert} from './api'; +import {runAlertById, saveAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; @@ -12,14 +12,13 @@ interface ICDCCreateAlert { filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: {[key: string]: IFilterComponent}; - alertList: IAlert[]; - setAlertList: (alerts: IAlert[]) => void; + fetchAlerts: () => void; setSelectedAlert: (alert: IAlert) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; } -export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, setCreationMode, setSelectedAlert, cdcs}: ICDCCreateAlert) { +export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, setCreationMode, setSelectedAlert, cdcs}: ICDCCreateAlert) { const generalInformation = (<> @@ -42,9 +41,11 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter const onSave = async () => { const newAlert = await saveAlert({...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - setAlertList([newAlert, ...alertList]); - setSelectedAlert(newAlert); + await runAlertById(newAlert.id); + await fetchAlerts(); setCreationMode(false); + // setSelectedAlert(newAlert); + setSelectedAlert(null); }; return (<> diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index 91df5e4dd..a08982405 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Select from 'react-select'; import {accordionItem} from '.'; -import {editAlert} from './api'; +import {confirmAlertById, deleteAlert, editAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; @@ -12,14 +12,13 @@ interface ICDCEditAlert { filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: {[key: string]: IFilterComponent}; - alertList: IAlert[]; - setAlertList: (alerts: IAlert[]) => void; + fetchAlerts: () => void; selectedAlert: IAlert; - setSelctedAlert: (alert: IAlert) => void; + setSelectedAlert: (alert: IAlert) => void; cdcs: string[]; } -export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, alertList, setAlertList, selectedAlert, setSelctedAlert, cdcs}: ICDCEditAlert) { +export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, selectedAlert, setSelectedAlert, cdcs}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); React.useEffect(() => { setEditMode(false); @@ -52,20 +51,25 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const literature = () => { const data = JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added; return (<>{data?.length > 0 ? (<> -
    New literature from:
    -

    {selectedAlert.latest_compare_date}

    Literature:
    {data.map((d, i) =>

    {d}

    )} + ) : ( -

    No new literature available

    +

    No new data available

    )} ); }; + const confirmChanges = async (id: number) => { + const alert = await confirmAlertById(id); + await fetchAlerts() + setSelectedAlert(alert); + } + const onSave = async () => { const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - setAlertList([newAlert, ...alertList.filter((alert) => alert.id !== selectedAlert.id)]); - setSelctedAlert(newAlert); + await fetchAlerts(); + setSelectedAlert(newAlert); setEditMode(false); }; @@ -75,9 +79,16 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setEditMode(false); }; - const editButton = !editMode ? ( + const onDelete = async (id: number) => { + await fetchAlerts(); + await deleteAlert(id); + setSelectedAlert(null); + }; + + const editButton = !editMode ? (<> - ) : (<> + + ) : (<> ); @@ -87,10 +98,10 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter,
    Your options
    {editButton}
    -
    - {accordionItem(1, 'New literature', 'createAlert', literature(), true)} - {accordionItem(2, 'Alert overview', 'createAlert', generalInformation)} - {accordionItem(3, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )} +
    + {accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true)} + {accordionItem(2, 'Alert overview', 'editAlert', generalInformation)} + {accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )}
    ); } diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 019c51574..ed7762c21 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; -import {deleteAlert, getAlerts, runAlertById} from './api'; +import {getAlerts, runAlertById} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter} from './CDCGroupingFilter'; import {v4 as uuidv4} from 'uuid'; import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './CDCTextFilter'; @@ -41,9 +41,8 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); - const [alertList, setAlertList] = React.useState(); const [cdcs, setCdcs] = React.useState(); - const {status: alertStatus, error: alertError, execute: alertExecute, value: alerts} = useAsync(getAlerts, true); + const {status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts} = useAsync(getAlerts, true); React.useEffect(() => { setAlertData(DEFAULTALERTDATA); @@ -51,12 +50,6 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setCdcs(['demo']); }, []); - React.useEffect(() => { - const runAlerts = []; - alerts?.sort((a, b) => a.modification_date > b.modification_date ? -1 : a.modification_date < b.modification_date ? 1 : 0).forEach((alert) => runAlertById(alert.id).then((a) => runAlerts.push(a))); - setAlertList(runAlerts); - }, [alerts]); - const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); @@ -64,12 +57,6 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setFilter(DEFAULTFILTER); }; - const onDeleteButton = async (id: number) => { - setAlertList([...alertList.filter((alert) => alert.id !== id)]); - await deleteAlert(id); - setSelectedAlert(null); - }; - const onAlertClick = async (alert: IAlert) => { setAlertData(alert); setFilter(JSON.parse(alert.filter_dump)); @@ -77,9 +64,8 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setSelectedAlert(alert); }; - const newLiteratureCount = (alert: IAlert) => { - const data = JSON.parse(alert?.latest_diff)?.dictionary_item_added; - return data?.length > 0 ? {data.length} : null; + const onAlertChanged = async () => { + await fetchAlerts(); }; return <> @@ -94,35 +80,35 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    -
    +
    Your alerts
    {alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} - {alertStatus === 'success' ?
    -
    +
    {selectedAlert ? onAlertChanged()} selectedAlert={selectedAlert} - setSelctedAlert={setSelectedAlert} + setSelectedAlert={setSelectedAlert} cdcs={cdcs} /> : @@ -134,8 +120,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setFilter={setFilter} filterComponents={filterComponents} filterSelection={filtersByCDC['demo']} - alertList={alertList} - setAlertList={setAlertList} + fetchAlerts={() => onAlertChanged()} setSelectedAlert={setSelectedAlert} setCreationMode={setCreationMode} cdcs={cdcs} @@ -147,6 +132,9 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    +
    @@ -176,7 +164,7 @@ export class CDCFilterDialogClass { filtersByCDC={{ 'demo': [ createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: `item["address"]["city"]`, value: []}], fields: [{field: `item["address"]["city"]`, options: [`"Gwenborough"`, `"Wisokyburgh"`, `"McKenziehaven"`, `"South Elvis"`, `"Roscoeview"`, `"South Christy"`, `"Howemouth"`, `"Aliyaview"`, `"Bartholomebury"`]}, {field: `item["address"]["zipcode"]`, options: [`"33263"`, `"23505-1337"`, `"58804-1099"`]}, {field: `item["name"]`, options: [`"Leanne Graham"`, `"Ervin Howell"`, `"Glenna Reichert"`, `"Clementina DuBuque"`]}]}), + createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: null, value: []}], fields: [{field: {label: 'City', value: `item["address"]["city"]`}, options: [{label: 'Gwenborough', value: `"Gwenborough"`}, {label: 'Wisokyburgh', value: `"Wisokyburgh"`}, {label: 'McKenziehaven', value: `"McKenziehaven"`}, {label: 'Roscoeview', value: `"Roscoeview"`}, {label: 'Aliyaview', value: `"Aliyaview"`}, {label: 'Howemouth', value: `"Howemouth"`}]}, {field: {label: "Zip Code", value: `item["address"]["zipcode"]`}, options: [{label: '33263', value: `"33263"`}, {label: '23505-1337', value: `"23505-1337"`}, {label: '58804-1099', value: `"58804-1099"`}]}, {field: {label: 'Name', value: `item["name"]`}, options: [{label: 'Leanne Graham', value: `"Leanne Graham"`}, {label: 'Ervin Howell', value: `"Ervin Howell"`}, {label: 'Glenna Reichert', value: `"Glenna Reichert"`}, {label: 'Clementina DuBuque', value: `"Clementina DuBuque"`}]}]}), createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1, max: 10}), ] diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index 13f518cc0..69793d380 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -4,12 +4,16 @@ import Select from 'react-select'; export interface ICDCTextFilterValue { fields: { - field: string, - options: string[] + // field: string; + // options: string[]; + field: {label: string, value: string}; + options: {label: string, value: string}[]; }[]; filter: { - field: string, - value: string[] + // field: string; + // value: string[]; + field: {label: string, value: string} + value: {label: string, value: string}[] }[]; } @@ -32,7 +36,7 @@ export function createCDCTextFilter(id: string, name: string, value: ICDCTextFil function CDCTextFilterToString(value: ICDCTextFilterValue): string { // Generate filter from value return `(${value.filter - .map((v) => `${v.field} in (${v.value.join(',')})`) + .map((v) => `${v.field.value} in (${v.value.map((vV => vV.value)).join(',')})`) .join(' and ')})`; } @@ -40,43 +44,34 @@ export function CDCTextFilterComponent({value, onValueChanged, disabled}) { return <> {value.filter.map((v, i) => (
    - +
    + ({label: value, value}))} - options={value.fields - .find((f) => f.field === v.field) - ?.options.map((o) => { - return {value: o, label: o}; - })} + value={v.value} + options={value.fields.find((f) => f.field === v.field)?.options} onChange={(e) => onValueChanged?.({ ...value, @@ -84,7 +79,7 @@ export function CDCTextFilterComponent({value, onValueChanged, disabled}) { oldV === v ? { ...v, - value: e.map((value) => (value as any).value) + value: e } : oldV ) diff --git a/src/cdc/api.ts b/src/cdc/api.ts index 3dc784d00..472202ef8 100644 --- a/src/cdc/api.ts +++ b/src/cdc/api.ts @@ -36,6 +36,6 @@ export async function runAlertById(id: number): Promise { return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}/run`); } -// export async function getCDCs(): Promise { -// return AppContext.getInstance().getAPIJSON(`/tdp/cdc`); -// } +export async function confirmAlertById(id: number): Promise { + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}/confirm`); +} diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index f367d8bcc..fdbaa66b9 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -83,7 +83,6 @@ export interface IAlert { id: number; name: string; cdc_id: string; - confirmation_date?: string; filter_dump: string; filter_query: string; enable_mail_notification: boolean; @@ -91,6 +90,8 @@ export interface IAlert { latest_fetched_data: string; latest_compare_date: string; modification_date: string; + confirmed_data: string; + confirmation_date: string; } export interface IUploadAlert extends Pick {} diff --git a/tdp_core/cdc/BaseCDC.py b/tdp_core/cdc/BaseCDC.py index 1347c3bb7..ec04bcf8b 100644 --- a/tdp_core/cdc/BaseCDC.py +++ b/tdp_core/cdc/BaseCDC.py @@ -1,5 +1,6 @@ from abc import abstractmethod, abstractproperty -from typing import TypeVar, Generic, List +from types import LambdaType +from typing import Dict, TypeVar, Generic, List from deepdiff import DeepDiff T = TypeVar('T') @@ -33,3 +34,15 @@ def compare(self, old: List[T], new: List[T]): old_lookup = {self.get_id(item): item for item in old} new_lookup = {self.get_id(item): item for item in new} return DeepDiff(old_lookup, new_lookup).to_json() + + # @abstractproperty # ? + # @property + # def available_filters() -> Dict[str, LambdaType]: + # return { + # 'text': lambda item, filter: item[filter.field] == filter.value, + # 'range': lambda item, filter: item[filter.field] >= filter.min and item[filter.field] <= filter.max, + # 'text': textFilter + # } + +# def textFilter(item, filter) -> bool: +# return True diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index 8e4394752..c68eaf42c 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -42,6 +42,10 @@ class CDCAlert(Base): modifier = Column(TEXT) # NOQA: N815 modification_date = Column(DateTime) # NOQA: N815 + # TODO: Avoid loading latest_diff, latest_fetch_data, latest_confirmed_data, use flags instead and load individually + # def has_latest_diff(self): + # return self.latest_diff is not None + class CDCAlertSchema(SQLAlchemyAutoSchema): class Meta: diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py index 5282f4d5c..cfadbc4e9 100644 --- a/tdp_core/cdc/CDCManager.py +++ b/tdp_core/cdc/CDCManager.py @@ -69,24 +69,30 @@ def refreshCDC(self, cdc: BaseCDC): # Fetch new entry new = cdc.load_data() + # validate filter tree + + # { + # id: 'group', + # value: {operator: 'AND'} + # filters: [{ + # id: 'range', + # value: {from: 1, to: 2, field: 'address.zipCode'} + # }, { + # id: 'group', + # value: {operator: 'AND'}, + # filters: [...] + # }] + # } + + class GroupFilter(): + pass + # schema = .. + + # def filter(item: Dict[...], ..) + # Filter new entry new = [item for item in new if eval('(item["id"] in (4, 5, 6, 7, 8) and not (item["id"] == 5 and item["id"] == 4 or item["id"] == 8)) or ((item["address"]["city"] == "Gwenborough") and (item["id"] > 0 and item["id"] < 5))')] - - # filter = { - # 'operator': 'AND', - # 'filters': [{ - # 'query': 'num1 == false && num2 == true' - # }, { - # 'operator': 'OR', - # 'filters': [{ - # }, { - # 'query': '' - # }] - # }] - # } - # filter = '(num1 == false AND num2 == true) AND ((age1 >= ...) OR (age1 <= ...))' - # TODO: How to find a proper "filter" library? # 1) [item for item in new if exec('item.age >= 20')] # 2) new_df = pd.DataFrame.from_dict(new) diff --git a/tdp_core/cdc/DemoCDC.py b/tdp_core/cdc/DemoCDC.py index d4f0124ad..44b085fa2 100644 --- a/tdp_core/cdc/DemoCDC.py +++ b/tdp_core/cdc/DemoCDC.py @@ -1,3 +1,4 @@ +from types import LambdaType from typing import Dict from .BaseCDC import BaseCDC import requests @@ -17,4 +18,4 @@ def load_data(self, options: Dict = {}): def get_id(self, item): _log.info(item) - return item['id'] \ No newline at end of file + return item['id'] diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 82972080c..79f90663c 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -56,7 +56,7 @@ def execute_cdc(id: str): def get_alerts(): session = create_session() alerts = session.query(CDCAlert).all() - return [p for p in alerts if can_read(p)] + return sorted([p for p in alerts if can_read(p)], key=lambda item: item.id) @no_cache @login_required @@ -136,6 +136,7 @@ def run_alert_by_id(id: int): alert.latest_compare_date = datetime.utcnow() alert.latest_fetched_data = new_data alert.latest_diff = diff + # TODO else: also set latest diff to empty session.commit() return alert, 200 From a9b58bec7d782fd320f68e6fb4e02991bae05e70 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Thu, 28 Oct 2021 10:02:59 +0200 Subject: [PATCH 12/40] make range slider less hardcoded + improve UI --- dist/cdc/CDCCreateAlert.d.ts | 7 ++--- dist/cdc/CDCCreateAlert.js | 13 ++++----- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.d.ts | 5 ++-- dist/cdc/CDCEditAlert.js | 41 ++++++++++++++------------ dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.d.ts | 1 + dist/cdc/CDCFilterDialog.js | 32 +++++++++++++++------ dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CDCRangeFilter.d.ts | 12 ++++++-- dist/cdc/CDCRangeFilter.js | 6 ++-- dist/cdc/CDCRangeFilter.js.map | 2 +- dist/cdc/CDCTextFilter.js | 4 +-- dist/cdc/CDCTextFilter.js.map | 2 +- dist/lineup/internal/ScoreUtils.d.ts | 16 ++++------- dist/utils/TDPApplicationUtils.d.ts | 6 ++-- src/cdc/CDCCreateAlert.tsx | 16 +++++------ src/cdc/CDCEditAlert.tsx | 43 +++++++++++++++------------- src/cdc/CDCFilterDialog.tsx | 34 +++++++++++++++------- src/cdc/CDCRangeFilter.tsx | 23 ++++++++++----- src/cdc/CDCTextFilter.tsx | 4 +-- 21 files changed, 159 insertions(+), 114 deletions(-) diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/CDCCreateAlert.d.ts index 15d0ca174..0bc307ef6 100644 --- a/dist/cdc/CDCCreateAlert.d.ts +++ b/dist/cdc/CDCCreateAlert.d.ts @@ -1,5 +1,5 @@ /// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interface'; +import { IFilter, IFilterComponent, IUploadAlert } from './interface'; interface ICDCCreateAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; @@ -9,10 +9,9 @@ interface ICDCCreateAlert { filterComponents: { [key: string]: IFilterComponent; }; - fetchAlerts: () => void; - setSelectedAlert: (alert: IAlert) => void; + onAlertChanged: (id?: number) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; } -export declare function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, setCreationMode, setSelectedAlert, cdcs }: ICDCCreateAlert): JSX.Element; +export declare function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs }: ICDCCreateAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index 269f90806..953a1006d 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -1,10 +1,11 @@ import React from 'react'; import Select from 'react-select'; import { accordionItem } from '.'; -import { runAlertById, saveAlert } from './api'; +import { runAlert } from '..'; +import { saveAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; -export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, setCreationMode, setSelectedAlert, cdcs }) { +export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs }) { const generalInformation = (React.createElement(React.Fragment, null, React.createElement("div", { className: "mb-3" }, React.createElement("label", { className: "form-label" }, "Name"), @@ -17,11 +18,9 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement("div", { className: "mb-3 form-check" }))); const onSave = async () => { const newAlert = await saveAlert({ ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - await runAlertById(newAlert.id); - await fetchAlerts(); + runAlert(newAlert.id); + onAlertChanged(newAlert.id); setCreationMode(false); - // setSelectedAlert(newAlert); - setSelectedAlert(null); }; return (React.createElement(React.Fragment, null, React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, @@ -30,7 +29,7 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement("button", { title: "Save changes", className: "btn btn-text-secondary", onClick: () => onSave() }, React.createElement("i", { className: "fas fa-save" })), React.createElement("button", { title: "Discard changes", className: "btn btn-text-secondary ms-1", onClick: () => setCreationMode(false) }, - React.createElement("i", { className: "fas fa-ban" })))), + React.createElement("i", { className: "fas fa-times" })))), React.createElement("div", { className: "accordion", id: "createAlert" }, accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true), accordionItem(2, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter })) : React.createElement("p", null, "No filters available for this cdc"))))); diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index c64ac89ca..d0297196a 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,GAAG,CAAC;AAChC,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAe1F,MAAM,UAAU,cAAc,CAAC,EAA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,aAAa,GAAK,CAAS;gBACjI,gCAAQ,KAAK,EAAC,iBAAiB,EAAC,SAAS,EAAC,6BAA6B,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC;oBAAE,2BAAG,SAAS,EAAC,cAAc,GAAK,CAAS,CAClJ,CACJ;QACN,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAC,aAAa;YACxC,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,IAAI,CAAC;YAC3E,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CACnQ,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.d.ts b/dist/cdc/CDCEditAlert.d.ts index 02c23ae0c..8858f00c9 100644 --- a/dist/cdc/CDCEditAlert.d.ts +++ b/dist/cdc/CDCEditAlert.d.ts @@ -9,10 +9,9 @@ interface ICDCEditAlert { filterComponents: { [key: string]: IFilterComponent; }; - fetchAlerts: () => void; + onAlertChanged: (id?: number) => void; selectedAlert: IAlert; - setSelectedAlert: (alert: IAlert) => void; cdcs: string[]; } -export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, selectedAlert, setSelectedAlert, cdcs }: ICDCEditAlert): JSX.Element; +export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs }: ICDCEditAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index afb4c022f..10cc8728e 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -1,14 +1,16 @@ import React from 'react'; import Select from 'react-select'; -import { accordionItem } from '.'; +import { accordionItem, runAlert } from '.'; import { confirmAlertById, deleteAlert, editAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; -export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, selectedAlert, setSelectedAlert, cdcs }) { +export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs }) { var _a; const [editMode, setEditMode] = React.useState(false); + const [deleteMode, setDeleteMode] = React.useState(false); React.useEffect(() => { setEditMode(false); + setDeleteMode(false); }, [selectedAlert]); const generalInformation = (React.createElement(React.Fragment, null, React.createElement("div", { className: "mb-3" }, @@ -29,45 +31,48 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.length) > 0 ? (React.createElement(React.Fragment, null, React.createElement("h6", null, "Literature:"), data.map((d, i) => React.createElement("p", { key: i }, d)), - React.createElement("button", { className: "btn btn-secondary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm changes"))) : (React.createElement("p", null, "No new data available")))); + React.createElement("button", { title: "Confirm changes", className: "btn btn-text-secondary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm Changes"))) : (React.createElement("p", null, "No new data available")))); }; const confirmChanges = async (id) => { const alert = await confirmAlertById(id); - await fetchAlerts(); - setSelectedAlert(alert); + onAlertChanged(alert.id); }; const onSave = async () => { - const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - await fetchAlerts(); - setSelectedAlert(newAlert); setEditMode(false); + const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); + runAlert(newAlert.id); + onAlertChanged(newAlert.id); }; const onDiscard = () => { + setEditMode(false); setAlertData(selectedAlert); setFilter(JSON.parse(selectedAlert.filter_dump)); - setEditMode(false); }; const onDelete = async (id) => { - await fetchAlerts(); + setEditMode(false); await deleteAlert(id); - setSelectedAlert(null); + onAlertChanged(); }; - const editButton = !editMode ? (React.createElement(React.Fragment, null, - React.createElement("button", { className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, + const editButton = !editMode && !deleteMode ? (React.createElement(React.Fragment, null, + React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, React.createElement("i", { className: "fas fa-pencil-alt" })), - React.createElement("button", { className: "btn btn-text-secondary", onClick: () => onDelete(selectedAlert.id) }, - React.createElement("i", { className: "fas fa-trash" })))) : (React.createElement(React.Fragment, null, + React.createElement("button", { title: "Delete Alert", className: "btn btn-text-secondary", onClick: () => setDeleteMode(true) }, + React.createElement("i", { className: "fas fa-trash" })))) : (editMode ? React.createElement(React.Fragment, null, React.createElement("button", { title: "Save changes", className: "btn btn-text-secondary", onClick: () => onSave() }, React.createElement("i", { className: "fas fa-save" })), React.createElement("button", { title: "Discard changes", className: "btn btn-text-secondary ms-1", onClick: () => onDiscard() }, - React.createElement("i", { className: "fas fa-ban" })))); + React.createElement("i", { className: "fas fa-times" }))) : React.createElement(React.Fragment, null, + React.createElement("button", { title: "Delete", className: "btn btn-text-secondary", onClick: () => onDelete(selectedAlert.id) }, + React.createElement("i", { className: "fas fa-check" })), + React.createElement("button", { title: "No Delete", className: "btn btn-text-secondary ms-1", onClick: () => setDeleteMode(false) }, + React.createElement("i", { className: "fas fa-times" })))); return (React.createElement(React.Fragment, null, React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, React.createElement("h5", null, "Your options"), React.createElement("small", null, editButton)), React.createElement("div", { className: "accordion", id: "editAlert" }, - accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true), - accordionItem(2, 'Alert overview', 'editAlert', generalInformation), + !editMode ? accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true) : null, + accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode), accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode })) : React.createElement("p", null, "No filters available for this cdc"))))); } //# sourceMappingURL=CDCEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index ae83e3fd2..ded8f0420 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,GAAG,CAAC;AAChC,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAe1F,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAgB;;IAC7K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EAAE,GAAG,OAAA,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,0CAAE,qBAAqB,EAAC,CAAC,CAAC,wBAAwB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACtN,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,CAAC;YAC7E,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,kBAAkB,IAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,QAAQ,GAAI,CAAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CAC9S,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index e2e2328ca..fe705e655 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -21,6 +21,7 @@ export declare const DEFAULTFILTER: { children?: IFilter[]; }; export declare const accordionItem: (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => JSX.Element; +export declare const runAlert: (id: number) => void; export declare function CDCFilterDialog({ filterComponents, filtersByCDC }: ICDCFilterDialogProps): JSX.Element; export declare class CDCFilterDialogClass { private node; diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 310ebff66..cbbbc645b 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -18,6 +18,11 @@ export const accordionItem = (index, title, parentId, child, show) => { React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); }; +export const runAlert = (id) => { + runAlertById(id).catch((e) => { + alert(`${e}: Invalid filter parameter in alert: ${id}`); + }); +}; export function CDCFilterDialog({ filterComponents, filtersByCDC }) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); @@ -43,8 +48,17 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { setCreationMode(false); setSelectedAlert(alert); }; - const onAlertChanged = async () => { - await fetchAlerts(); + const onAlertChanged = async (id) => { + //refetches alerts and makes new selection + fetchAlerts().then((alerts) => { + //if no id there is no need to iterate through alerts + if (!id) { + setSelectedAlert(null); + } + else { + setSelectedAlert(alerts.find((alert) => alert.id === id)); + } + }).catch((e) => console.error(e)); }; return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, @@ -72,28 +86,28 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => { var _a, _b; return React.createElement("div", { key: alert.id }, - React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${selectedAlert === alert ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, + React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, React.createElement("div", { className: "d-flex w-100 justify-content-between" }, - React.createElement("h6", { className: "mb-1" }, + React.createElement("h6", { title: `${alert.name} for ${alert.cdc_id}`, className: "mb-1 overflow-hidden" }, alert.name, " ", React.createElement("small", { className: "text-muted" }, "for ", alert.cdc_id)), ((_b = (_a = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.length) > 0 ? React.createElement("small", null, - React.createElement("i", { className: "fas fa-circle text-danger" })) : null), + React.createElement("i", { className: "fas fa-circle text-primary" })) : null), React.createElement("small", null, !alert.latest_diff && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${alert.confirmation_date}`))); })) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert ? - React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, fetchAlerts: () => onAlertChanged(), selectedAlert: selectedAlert, setSelectedAlert: setSelectedAlert, cdcs: cdcs }) + React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, onAlertChanged: onAlertChanged, selectedAlert: selectedAlert, cdcs: cdcs }) : creationMode ? - React.createElement(CDCCreateAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], fetchAlerts: () => onAlertChanged(), setSelectedAlert: setSelectedAlert, setCreationMode: setCreationMode, cdcs: cdcs }) + React.createElement(CDCCreateAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, cdcs: cdcs }) : null))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", onClick: () => { - Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlertById(alert.id))).then(() => fetchAlerts()); + Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlert(alert.id))).then(() => fetchAlerts()); }, className: "btn btn-secondary" }, "Sync"))))))); } export class CDCFilterDialogClass { @@ -113,7 +127,7 @@ export class CDCFilterDialogClass { createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: null, value: [] }], fields: [{ field: { label: 'City', value: `item["address"]["city"]` }, options: [{ label: 'Gwenborough', value: `"Gwenborough"` }, { label: 'Wisokyburgh', value: `"Wisokyburgh"` }, { label: 'McKenziehaven', value: `"McKenziehaven"` }, { label: 'Roscoeview', value: `"Roscoeview"` }, { label: 'Aliyaview', value: `"Aliyaview"` }, { label: 'Howemouth', value: `"Howemouth"` }] }, { field: { label: "Zip Code", value: `item["address"]["zipcode"]` }, options: [{ label: '33263', value: `"33263"` }, { label: '23505-1337', value: `"23505-1337"` }, { label: '58804-1099', value: `"58804-1099"` }] }, { field: { label: 'Name', value: `item["name"]` }, options: [{ label: 'Leanne Graham', value: `"Leanne Graham"` }, { label: 'Ervin Howell', value: `"Ervin Howell"` }, { label: 'Glenna Reichert', value: `"Glenna Reichert"` }, { label: 'Clementina DuBuque', value: `"Clementina DuBuque"` }] }] }), createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), - createCDCRangeFilter(uuidv4(), 'Range Filter', { min: 1, max: 10 }), + createCDCRangeFilter(uuidv4(), 'Range Filter', { config: { minValue: 1, maxValue: 10, label: "ID", field: `item["id"]` }, value: { min: 1, max: 10 } }), ] } }), this.node); } diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 3a2c6c638..5104e6e85 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cd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EAAE,EAAE,cAAc,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAC,EAAE,KAAK,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,EAAC,CAAC;iBAClJ;aACF,GAAI,EACP,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.d.ts b/dist/cdc/CDCRangeFilter.d.ts index 78064ff4d..070c3dcc4 100644 --- a/dist/cdc/CDCRangeFilter.d.ts +++ b/dist/cdc/CDCRangeFilter.d.ts @@ -1,7 +1,15 @@ import { IFilter, IFilterComponent } from './interface'; export interface ICDCRangeFilterValue { - min: number; - max: number; + config: { + minValue: number; + maxValue: number; + label: string; + field: string; + }; + value: { + min: number; + max: number; + }; } export declare const CDCRangeFilterId = "range"; export declare const CDCRangeFilter: IFilterComponent; diff --git a/dist/cdc/CDCRangeFilter.js b/dist/cdc/CDCRangeFilter.js index c80a0d7df..3e5143660 100644 --- a/dist/cdc/CDCRangeFilter.js +++ b/dist/cdc/CDCRangeFilter.js @@ -16,10 +16,12 @@ export function createCDCRangeFilter(id, name, value) { } function CDCRangeFilterToString(value) { // Generate filter from value - return `(item["id"] >= ${value.min} and item["id"] <= ${value.max})`; + return `(${value.config.field} >= ${value.value.min} and ${value.config.field} <= ${value.value.max})`; } function CDCRangeFilterComponent({ value, onValueChanged, disabled }) { + var _a; return React.createElement("div", { className: "t360-input-range-wrapper", style: { margin: '10px', paddingTop: '10px', minHeight: '50px' } }, - React.createElement(InputRange, { disabled: !onValueChanged || disabled, minValue: 1, maxValue: 10, value: { min: value.min, max: value.max }, onChange: (v) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged(v) })); + React.createElement("h6", null, (_a = value === null || value === void 0 ? void 0 : value.config) === null || _a === void 0 ? void 0 : _a.label), + React.createElement(InputRange, { disabled: !onValueChanged || disabled, minValue: value.config.minValue, maxValue: value.config.maxValue, value: value.value, onChange: (v) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, value: v }) })); } //# sourceMappingURL=CDCRangeFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.js.map b/dist/cdc/CDCRangeFilter.js.map index c864ac219..7e218e47c 100644 --- a/dist/cdc/CDCRangeFilter.js.map +++ b/dist/cdc/CDCRangeFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAO3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA2B;IACxF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,gBAAgB;QAC7B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA2B;IACzD,6BAA6B;IAC7B,OAAO,kBAAkB,KAAK,CAAC,GAAG,sBAAsB,KAAK,CAAC,GAAG,GAAG,CAAC;AACvE,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAC;IAChE,OAAO,6BAAK,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QAC7G,oBAAC,UAAU,IACT,Q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,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QAC7G,sCAAK,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,KAAK,CAAM;QAC/B,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC/B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC/B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,EAAC,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,GACvD,CACE,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/CDCTextFilter.js index b996d5f1c..a183bd788 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/CDCTextFilter.js @@ -25,7 +25,7 @@ export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { value.filter.map((v, i) => { var _a; return (React.createElement("div", { key: i, className: "input-group m-1" }, - React.createElement("div", { style: { width: '30%' } }, + React.createElement("div", { style: { width: '28%' } }, React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: v.field, options: [...value.fields.map((field) => field.field)], onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, filter: value.filter.map((oldV) => oldV === v @@ -36,7 +36,7 @@ export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { } : oldV) }) })), - React.createElement("div", { style: { width: '70%' } }, + React.createElement("div", { className: "ms-1", style: { width: '58%' } }, React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !v.field, isMulti: true, value: v.value, options: (_a = value.fields.find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, filter: value.filter.map((oldV) => oldV === v diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map index 1d54cc8fd..0a0e215c0 100644 --- a/dist/cdc/CDCTextFilter.js.map +++ b/dist/cdc/CDCTextFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAiBlC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,KAA0B;IACvD,6BAA6B;IAC7B,OAAO,IAAI,KAAK,CAAC,MAAM;SACpB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;SAC9E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAC;IACtE,OAAO;QACJ,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,E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CAAC,IAAI,EAAE,EAAE,CAChC,IAAI,KAAK,CAAC;gCACR,CAAC,CAAC;oCACA,GAAG,CAAC;oCACJ,KAAK,EAAE,CAAC;iCACT;gCACD,CAAC,CAAC,IAAI,CACT;yBACF,CAAC,GAEJ,CACE;gBACL,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;oBAChB,gCACE,QAAQ,EAAE,CAAC,cAAc,EACzB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;4BACf,GAAG,KAAK;4BACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;yBAClD,CAAC,EAEJ,SAAS,EAAC,wBAAwB;wBAElC,2BAAG,SAAS,EAAC,cAAc,GAAK,CACzB,CAEP,CACP,CAAA;SAAA,CAAC;QACD,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAiBlC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,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I,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;yBAClD,CAAC,EAEJ,SAAS,EAAC,wBAAwB;wBAElC,2BAAG,SAAS,EAAC,cAAc,GAAK,CACzB,CAEP,CACP,CAAA;SAAA,CAAC;QACD,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/lineup/internal/ScoreUtils.d.ts b/dist/lineup/internal/ScoreUtils.d.ts index 2b2abf5d5..6645a2f5a 100644 --- a/dist/lineup/internal/ScoreUtils.d.ts +++ b/dist/lineup/internal/ScoreUtils.d.ts @@ -7,18 +7,12 @@ export declare class ScoreUtils { static readonly CMD_ADD_SCORE = "tdpAddScore"; static readonly CMD_REMOVE_SCORE = "tdpRemoveScore"; private static addScoreLogic; - static addScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static removeScoreImpl(inputs: IObjectRef[], parameter: any): Promise<{ - inverse: import("phovea_core").IAction; - }>; - static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): import("phovea_core").IAction; + static addScoreImpl(inputs: IObjectRef[], parameter: any): any; + static addScoreAsync(inputs: IObjectRef[], parameter: any): Promise; + static removeScoreImpl(inputs: IObjectRef[], parameter: any): any; + static addScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any): any; static pushScoreAsync(graph: ProvenanceGraph, provider: IObjectRef, scoreName: string, scoreId: string, params: any): Promise; - static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): import("phovea_core").IAction; + static removeScore(provider: IObjectRef, scoreName: string, scoreId: string, params: any, columnId: string | string[]): any; private static shallowEqualObjects; /** * compresses score creation and removal diff --git a/dist/utils/TDPApplicationUtils.d.ts b/dist/utils/TDPApplicationUtils.d.ts index e90978b25..fb54ccf2c 100644 --- a/dist/utils/TDPApplicationUtils.d.ts +++ b/dist/utils/TDPApplicationUtils.d.ts @@ -40,8 +40,10 @@ export declare class TDPApplicationUtils { inverse: import("phovea_core").IAction; }; static initSession(map: object): import("phovea_core").IAction; - static setParameterImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): any; - static setParameter(view: IObjectRef, name: string, value: any, previousValue: any): any; + static setParameterImpl(inputs: IObjectRef[], parameter: any, graph: ProvenanceGraph): Promise<{ + inverse: import("phovea_core").IAction; + }>; + static setParameter(view: IObjectRef, name: string, value: any, previousValue: any): import("phovea_core").IAction; static compressSetParameter(path: ActionNode[]): ActionNode[]; /** * @deprecated diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index 798ceb4bc..5c8ad1472 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -1,7 +1,8 @@ import React from 'react'; import Select from 'react-select'; import {accordionItem} from '.'; -import {runAlertById, saveAlert} from './api'; +import {runAlert} from '..'; +import {saveAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; @@ -12,13 +13,12 @@ interface ICDCCreateAlert { filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: {[key: string]: IFilterComponent}; - fetchAlerts: () => void; - setSelectedAlert: (alert: IAlert) => void; + onAlertChanged: (id?: number) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; } -export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, setCreationMode, setSelectedAlert, cdcs}: ICDCCreateAlert) { +export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs}: ICDCCreateAlert) { const generalInformation = (<> @@ -41,11 +41,9 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter const onSave = async () => { const newAlert = await saveAlert({...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - await runAlertById(newAlert.id); - await fetchAlerts(); + runAlert(newAlert.id); + onAlertChanged(newAlert.id); setCreationMode(false); - // setSelectedAlert(newAlert); - setSelectedAlert(null); }; return (<> @@ -53,7 +51,7 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter
    Create alert
    - +
    diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index a08982405..4bee2cd63 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -1,6 +1,6 @@ import React from 'react'; import Select from 'react-select'; -import {accordionItem} from '.'; +import {accordionItem, runAlert} from '.'; import {confirmAlertById, deleteAlert, editAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; @@ -12,16 +12,17 @@ interface ICDCEditAlert { filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: {[key: string]: IFilterComponent}; - fetchAlerts: () => void; + onAlertChanged: (id?: number) => void; selectedAlert: IAlert; - setSelectedAlert: (alert: IAlert) => void; cdcs: string[]; } -export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, fetchAlerts, selectedAlert, setSelectedAlert, cdcs}: ICDCEditAlert) { +export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); + const [deleteMode, setDeleteMode] = React.useState(false); React.useEffect(() => { setEditMode(false); + setDeleteMode(false); }, [selectedAlert]); const generalInformation = @@ -53,7 +54,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, return (<>{data?.length > 0 ? (<>
    Literature:
    {data.map((d, i) =>

    {d}

    )} - + ) : (

    No new data available

    )} @@ -62,35 +63,37 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const confirmChanges = async (id: number) => { const alert = await confirmAlertById(id); - await fetchAlerts() - setSelectedAlert(alert); + onAlertChanged(alert.id); } const onSave = async () => { - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - await fetchAlerts(); - setSelectedAlert(newAlert); setEditMode(false); + const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); + runAlert(newAlert.id); + onAlertChanged(newAlert.id); }; const onDiscard = () => { + setEditMode(false); setAlertData(selectedAlert); setFilter(JSON.parse(selectedAlert.filter_dump)); - setEditMode(false); }; const onDelete = async (id: number) => { - await fetchAlerts(); + setEditMode(false); await deleteAlert(id); - setSelectedAlert(null); + onAlertChanged(); }; - const editButton = !editMode ? (<> - - - ) : (<> + const editButton = !editMode && !deleteMode ? (<> + + + ) : (editMode ? <> - + + : <> + + ); return (<> @@ -99,8 +102,8 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, {editButton}
    - {accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true)} - {accordionItem(2, 'Alert overview', 'editAlert', generalInformation)} + {!editMode ? accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true) : null} + {accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)} {accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )}
    ); diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index ed7762c21..7e5eb4837 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -35,6 +35,12 @@ export const accordionItem = (index: number, title: string, parentId: string, ch ); }; +export const runAlert = (id: number) => { + runAlertById(id).catch((e) => { + alert(`${e}: Invalid filter parameter in alert: ${id}`); + }); +}; + export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDialogProps) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); @@ -64,8 +70,16 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setSelectedAlert(alert); }; - const onAlertChanged = async () => { - await fetchAlerts(); + const onAlertChanged = async (id?: number) => { + //refetches alerts and makes new selection + fetchAlerts().then((alerts) => { + //if no id there is no need to iterate through alerts + if (!id) { + setSelectedAlert(null); + } else { + setSelectedAlert(alerts.find((alert) => alert.id === id)) + } + }).catch((e) => console.error(e)) }; return <> @@ -88,10 +102,10 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial {alertStatus === 'pending' ? <>Loading... : null} {alertStatus === 'error' ? <>Error {alertError.toString()} : null} {alertStatus === 'success' ?
    {alerts.map((alert) => -
    onAlertClick(alert)} aria-current="true"> + @@ -106,9 +120,8 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setFilter={setFilter} filterSelection={filtersByCDC['demo']} filterComponents={filterComponents} - fetchAlerts={() => onAlertChanged()} + onAlertChanged={onAlertChanged} selectedAlert={selectedAlert} - setSelectedAlert={setSelectedAlert} cdcs={cdcs} /> : @@ -120,8 +133,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial setFilter={setFilter} filterComponents={filterComponents} filterSelection={filtersByCDC['demo']} - fetchAlerts={() => onAlertChanged()} - setSelectedAlert={setSelectedAlert} + onAlertChanged={onAlertChanged} setCreationMode={setCreationMode} cdcs={cdcs} /> @@ -133,7 +145,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    @@ -166,7 +178,7 @@ export class CDCFilterDialogClass { createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), createCDCTextFilter(uuidv4(), 'Text Filter', {filter: [{field: null, value: []}], fields: [{field: {label: 'City', value: `item["address"]["city"]`}, options: [{label: 'Gwenborough', value: `"Gwenborough"`}, {label: 'Wisokyburgh', value: `"Wisokyburgh"`}, {label: 'McKenziehaven', value: `"McKenziehaven"`}, {label: 'Roscoeview', value: `"Roscoeview"`}, {label: 'Aliyaview', value: `"Aliyaview"`}, {label: 'Howemouth', value: `"Howemouth"`}]}, {field: {label: "Zip Code", value: `item["address"]["zipcode"]`}, options: [{label: '33263', value: `"33263"`}, {label: '23505-1337', value: `"23505-1337"`}, {label: '58804-1099', value: `"58804-1099"`}]}, {field: {label: 'Name', value: `item["name"]`}, options: [{label: 'Leanne Graham', value: `"Leanne Graham"`}, {label: 'Ervin Howell', value: `"Ervin Howell"`}, {label: 'Glenna Reichert', value: `"Glenna Reichert"`}, {label: 'Clementina DuBuque', value: `"Clementina DuBuque"`}]}]}), createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), - createCDCRangeFilter(uuidv4(), 'Range Filter', {min: 1, max: 10}), + createCDCRangeFilter(uuidv4(), 'Range Filter', {config: {minValue: 1, maxValue: 10, label: "ID", field: `item["id"]`}, value: {min: 1, max: 10}}), ] }} />, this.node diff --git a/src/cdc/CDCRangeFilter.tsx b/src/cdc/CDCRangeFilter.tsx index 600578015..540e6f0ce 100644 --- a/src/cdc/CDCRangeFilter.tsx +++ b/src/cdc/CDCRangeFilter.tsx @@ -3,8 +3,16 @@ import * as React from 'react'; import InputRange from 'react-input-range'; export interface ICDCRangeFilterValue { - min: number; - max: number; + config: { + minValue: number; + maxValue: number; + label: string; + field: string; + } + value: { + min: number; + max: number; + } } export const CDCRangeFilterId = 'range'; @@ -25,17 +33,18 @@ export function createCDCRangeFilter(id: string, name: string, value: ICDCRangeF function CDCRangeFilterToString(value: ICDCRangeFilterValue): string { // Generate filter from value - return `(item["id"] >= ${value.min} and item["id"] <= ${value.max})`; + return `(${value.config.field} >= ${value.value.min} and ${value.config.field} <= ${value.value.max})`; } function CDCRangeFilterComponent({value, onValueChanged, disabled}) { return
    +
    {value?.config?.label}
    onValueChanged?.(v)} + minValue={value.config.minValue} + maxValue={value.config.maxValue} + value={value.value} + onChange={(v) => onValueChanged?.({...value, value: v})} />
    ; } diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index 69793d380..050923cf6 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -44,7 +44,7 @@ export function CDCTextFilterComponent({value, onValueChanged, disabled}) { return <> {value.filter.map((v, i) => (
    -
    +
    Date: Thu, 28 Oct 2021 13:23:02 +0200 Subject: [PATCH 13/40] minor style changes --- dist/cdc/CDCTextFilter.js | 17 +++++++++-------- dist/cdc/CDCTextFilter.js.map | 2 +- src/cdc/CDCTextFilter.tsx | 36 +++++++++++++++++------------------ 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/CDCTextFilter.js index a183bd788..73708f704 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/CDCTextFilter.js @@ -24,8 +24,8 @@ export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { return React.createElement(React.Fragment, null, value.filter.map((v, i) => { var _a; - return (React.createElement("div", { key: i, className: "input-group m-1" }, - React.createElement("div", { style: { width: '28%' } }, + return (React.createElement("div", { key: i, className: "input-group m-1 row" }, + React.createElement("div", { className: "col-3 p-0" }, React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: v.field, options: [...value.fields.map((field) => field.field)], onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, filter: value.filter.map((oldV) => oldV === v @@ -36,7 +36,7 @@ export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { } : oldV) }) })), - React.createElement("div", { className: "ms-1", style: { width: '58%' } }, + React.createElement("div", { className: "col-7 p-0" }, React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !v.field, isMulti: true, value: v.value, options: (_a = value.fields.find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, filter: value.filter.map((oldV) => oldV === v @@ -47,11 +47,12 @@ export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { : oldV) }) })), disabled ? null : - React.createElement("button", { disabled: !onValueChanged, onClick: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.filter((oldV) => oldV !== v) - }), className: "btn btn-text-secondary" }, - React.createElement("i", { className: "fas fa-trash" })))); + React.createElement("div", { className: "col-1 p-0" }, + React.createElement("button", { disabled: !onValueChanged, onClick: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + ...value, + filter: value.filter.filter((oldV) => oldV !== v) + }), className: "btn btn-text-secondary" }, + React.createElement("i", { className: "fas fa-trash" }))))); }), onValueChanged && !disabled ? (React.createElement("button", { className: "btn btn-text-secondary m-1", onClick: () => { onValueChanged({ diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map index 0a0e215c0..c90b48eed 100644 --- a/dist/cdc/CDCTextFilter.js.map +++ b/dist/cdc/CDCTextFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAA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AC,EAAE,EAAE,CACb,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;4BACf,GAAG,KAAK;4BACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;yBAClD,CAAC,EAEJ,SAAS,EAAC,wBAAwB;wBAElC,2BAAG,SAAS,EAAC,cAAc,GAAK,CACzB,CAEP,CACP,CAAA;SAAA,CAAC;QACD,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAalC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,eAAe;QAC5B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,KAA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M,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index 050923cf6..0d68934dc 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -4,14 +4,10 @@ import Select from 'react-select'; export interface ICDCTextFilterValue { fields: { - // field: string; - // options: string[]; field: {label: string, value: string}; options: {label: string, value: string}[]; }[]; filter: { - // field: string; - // value: string[]; field: {label: string, value: string} value: {label: string, value: string}[] }[]; @@ -43,8 +39,8 @@ function CDCTextFilterToString(value: ICDCTextFilterValue): string { export function CDCTextFilterComponent({value, onValueChanged, disabled}) { return <> {value.filter.map((v, i) => ( -
    -
    +
    +
    {disabled ? null : - +
    + +
    }
    ))} From 82332d4a4f44d2003ba7727df2665e429a15a8f2 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Thu, 28 Oct 2021 13:48:51 +0200 Subject: [PATCH 14/40] lint errors --- dist/cdc/CDCEditAlert.js | 42 +++++++++++++-------------- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.js | 4 +-- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CDCTextFilter.js | 2 +- dist/cdc/CDCTextFilter.js.map | 2 +- src/cdc/CDCEditAlert.tsx | 50 ++++++++++++++++----------------- src/cdc/CDCFilterDialog.tsx | 10 +++---- src/cdc/CDCRangeFilter.tsx | 4 +-- src/cdc/CDCTextFilter.tsx | 2 +- 10 files changed, 60 insertions(+), 60 deletions(-) diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index 10cc8728e..ef9debd16 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -12,6 +12,26 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setEditMode(false); setDeleteMode(false); }, [selectedAlert]); + const confirmChanges = async (id) => { + const alert = await confirmAlertById(id); + onAlertChanged(alert.id); + }; + const onSave = async () => { + setEditMode(false); + const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); + runAlert(newAlert.id); + onAlertChanged(newAlert.id); + }; + const onDiscard = () => { + setEditMode(false); + setAlertData(selectedAlert); + setFilter(JSON.parse(selectedAlert.filter_dump)); + }; + const onDelete = async (id) => { + setEditMode(false); + await deleteAlert(id); + onAlertChanged(); + }; const generalInformation = (React.createElement(React.Fragment, null, React.createElement("div", { className: "mb-3" }, React.createElement("label", { className: "form-label" }, "Name"), @@ -33,26 +53,6 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, data.map((d, i) => React.createElement("p", { key: i }, d)), React.createElement("button", { title: "Confirm changes", className: "btn btn-text-secondary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm Changes"))) : (React.createElement("p", null, "No new data available")))); }; - const confirmChanges = async (id) => { - const alert = await confirmAlertById(id); - onAlertChanged(alert.id); - }; - const onSave = async () => { - setEditMode(false); - const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - runAlert(newAlert.id); - onAlertChanged(newAlert.id); - }; - const onDiscard = () => { - setEditMode(false); - setAlertData(selectedAlert); - setFilter(JSON.parse(selectedAlert.filter_dump)); - }; - const onDelete = async (id) => { - setEditMode(false); - await deleteAlert(id); - onAlertChanged(); - }; const editButton = !editMode && !deleteMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, React.createElement("i", { className: "fas fa-pencil-alt" })), @@ -71,7 +71,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("h5", null, "Your options"), React.createElement("small", null, editButton)), React.createElement("div", { className: "accordion", id: "editAlert" }, - !editMode ? accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true) : null, + !editMode ? accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? 'Latest revision from: ' + selectedAlert.latest_compare_date : 'No new data'}`, 'editAlert', literature(), true) : null, accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode), accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode })) : React.createElement("p", null, "No filters available for this cdc"))))); } diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index ded8f0420..0d29886fc 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAc1F,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,E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AAkB,IAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,QAAQ,GAAI,CAAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CAC9S,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index cbbbc645b..0cb13e469 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -125,9 +125,9 @@ export class CDCFilterDialogClass { }, filtersByCDC: { 'demo': [ createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: null, value: [] }], fields: [{ field: { label: 'City', value: `item["address"]["city"]` }, options: [{ label: 'Gwenborough', value: `"Gwenborough"` }, { label: 'Wisokyburgh', value: `"Wisokyburgh"` }, { label: 'McKenziehaven', value: `"McKenziehaven"` }, { label: 'Roscoeview', value: `"Roscoeview"` }, { label: 'Aliyaview', value: `"Aliyaview"` }, { label: 'Howemouth', value: `"Howemouth"` }] }, { field: { label: "Zip Code", value: `item["address"]["zipcode"]` }, options: [{ label: '33263', value: `"33263"` }, { label: '23505-1337', value: `"23505-1337"` }, { label: '58804-1099', value: `"58804-1099"` }] }, { field: { label: 'Name', value: `item["name"]` }, options: [{ label: 'Leanne Graham', value: `"Leanne Graham"` }, { label: 'Ervin Howell', value: `"Ervin Howell"` }, { label: 'Glenna Reichert', value: `"Glenna Reichert"` }, { label: 'Clementina DuBuque', value: `"Clementina DuBuque"` }] }] }), + createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: null, value: [] }], fields: [{ field: { label: 'City', value: `item["address"]["city"]` }, options: [{ label: 'Gwenborough', value: `"Gwenborough"` }, { label: 'Wisokyburgh', value: `"Wisokyburgh"` }, { label: 'McKenziehaven', value: `"McKenziehaven"` }, { label: 'Roscoeview', value: `"Roscoeview"` }, { label: 'Aliyaview', value: `"Aliyaview"` }, { label: 'Howemouth', value: `"Howemouth"` }] }, { field: { label: 'Zip Code', value: `item["address"]["zipcode"]` }, options: [{ label: '33263', value: `"33263"` }, { label: '23505-1337', value: `"23505-1337"` }, { label: '58804-1099', value: `"58804-1099"` }] }, { field: { label: 'Name', value: `item["name"]` }, options: [{ label: 'Leanne Graham', value: `"Leanne Graham"` }, { label: 'Ervin Howell', value: `"Ervin Howell"` }, { label: 'Glenna Reichert', value: `"Glenna Reichert"` }, { label: 'Clementina DuBuque', value: `"Clementina DuBuque"` }] }] }), createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), - createCDCRangeFilter(uuidv4(), 'Range Filter', { config: { minValue: 1, maxValue: 10, label: "ID", field: `item["id"]` }, value: { min: 1, max: 10 } }), + createCDCRangeFilter(uuidv4(), 'Range Filter', { config: { minValue: 1, maxValue: 10, label: 'ID', field: `item["id"]` }, value: { min: 1, max: 10 } }), ] } }), this.node); } diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 5104e6e85..2db9a2147 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAC,M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AC,EAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAC,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAC,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,mBAAmB,EAAC,EAAE,EAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,sBAAsB,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC;oBACp6B,uBAAuB,CAAC,MAAM,EAAE,EAAE,iBAAiB,EAAE,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;oBACpG,oBAAoB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAC,EAAE,KAAK,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,EAAC,CAAC;iBAClJ;aACF,GAAI,EACP,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/CDCTextFilter.js index 73708f704..38ce04a93 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/CDCTextFilter.js @@ -17,7 +17,7 @@ export function createCDCTextFilter(id, name, value) { function CDCTextFilterToString(value) { // Generate filter from value return `(${value.filter - .map((v) => `${v.field.value} in (${v.value.map((vV => vV.value)).join(',')})`) + .map((v) => `${v.field.value} in (${v.value.map(((vV) => vV.value)).join(',')})`) .join(' and ')})`; } export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map index c90b48eed..1ecfd74c7 100644 --- a/dist/cdc/CDCTextFilter.js.map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,IAAI,CAAC,CAAC;oBAChB,6BAAK,SAAS,EAAC,WAAW;wBACxB,gCACE,QAAQ,EAAE,CAAC,cAAc,EACzB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;gCACf,GAAG,KAAK;gCACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;6BAClD,CAAC,EAEJ,SAAS,EAAC,wBAAwB;4BAElC,2BAAG,SAAS,EAAC,cAAc,GAAK,CACzB,CACL,CAEJ,CACP,CAAA;SAAA,CAAC;QACD,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAalC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ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AAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index 4bee2cd63..c6b044f45 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -25,6 +25,30 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setDeleteMode(false); }, [selectedAlert]); + const confirmChanges = async (id: number) => { + const alert = await confirmAlertById(id); + onAlertChanged(alert.id); + }; + + const onSave = async () => { + setEditMode(false); + const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); + runAlert(newAlert.id); + onAlertChanged(newAlert.id); + }; + + const onDiscard = () => { + setEditMode(false); + setAlertData(selectedAlert); + setFilter(JSON.parse(selectedAlert.filter_dump)); + }; + + const onDelete = async (id: number) => { + setEditMode(false); + await deleteAlert(id); + onAlertChanged(); + }; + const generalInformation = (<>
    @@ -61,30 +85,6 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, ); }; - const confirmChanges = async (id: number) => { - const alert = await confirmAlertById(id); - onAlertChanged(alert.id); - } - - const onSave = async () => { - setEditMode(false); - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - runAlert(newAlert.id); - onAlertChanged(newAlert.id); - }; - - const onDiscard = () => { - setEditMode(false); - setAlertData(selectedAlert); - setFilter(JSON.parse(selectedAlert.filter_dump)); - }; - - const onDelete = async (id: number) => { - setEditMode(false); - await deleteAlert(id); - onAlertChanged(); - }; - const editButton = !editMode && !deleteMode ? (<> @@ -102,7 +102,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, {editButton}
    - {!editMode ? accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? "Latest revision from: " + selectedAlert.latest_compare_date : "No new data"}`, 'editAlert', literature(), true) : null} + {!editMode ? accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? 'Latest revision from: ' + selectedAlert.latest_compare_date : 'No new data'}`, 'editAlert', literature(), true) : null} {accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)} {accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )}
    diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 7e5eb4837..c4c63311a 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -77,9 +77,9 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial if (!id) { setSelectedAlert(null); } else { - setSelectedAlert(alerts.find((alert) => alert.id === id)) + setSelectedAlert(alerts.find((alert) => alert.id === id)); } - }).catch((e) => console.error(e)) + }).catch((e) => console.error(e)); }; return <> @@ -116,7 +116,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial , this.node diff --git a/src/cdc/CDCRangeFilter.tsx b/src/cdc/CDCRangeFilter.tsx index 540e6f0ce..d35e63ed4 100644 --- a/src/cdc/CDCRangeFilter.tsx +++ b/src/cdc/CDCRangeFilter.tsx @@ -8,11 +8,11 @@ export interface ICDCRangeFilterValue { maxValue: number; label: string; field: string; - } + }; value: { min: number; max: number; - } + }; } export const CDCRangeFilterId = 'range'; diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index 0d68934dc..e75f93ddb 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -32,7 +32,7 @@ export function createCDCTextFilter(id: string, name: string, value: ICDCTextFil function CDCTextFilterToString(value: ICDCTextFilterValue): string { // Generate filter from value return `(${value.filter - .map((v) => `${v.field.value} in (${v.value.map((vV => vV.value)).join(',')})`) + .map((v) => `${v.field.value} in (${v.value.map(((vV) => vV.value)).join(',')})`) .join(' and ')})`; } From b74afb18244ad28d3fee30268b2bd45fe61ddf0a Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Tue, 2 Nov 2021 13:33:16 +0100 Subject: [PATCH 15/40] UI improvements --- dist/cdc/CDCCreateAlert.js | 59 +++++++++++++------ dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.js | 71 ++++++++++++++++------- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterComponent.d.ts | 3 +- dist/cdc/CDCFilterComponent.js | 4 +- dist/cdc/CDCFilterComponent.js.map | 2 +- dist/cdc/CDCFilterDialog.d.ts | 4 +- dist/cdc/CDCFilterDialog.js | 10 ++-- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/FilterCard.d.ts | 3 +- dist/cdc/FilterCard.js | 56 +++++++++--------- dist/cdc/FilterCard.js.map | 2 +- dist/cdc/interface.d.ts | 4 +- src/cdc/CDCCreateAlert.tsx | 80 +++++++++++++++++-------- src/cdc/CDCEditAlert.tsx | 93 +++++++++++++++++++++--------- src/cdc/CDCFilterComponent.tsx | 4 +- src/cdc/CDCFilterDialog.tsx | 8 ++- src/cdc/FilterCard.tsx | 14 +++-- src/cdc/interface.ts | 4 +- 20 files changed, 282 insertions(+), 145 deletions(-) diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index 953a1006d..456f15422 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -1,26 +1,33 @@ import React from 'react'; import Select from 'react-select'; -import { accordionItem } from '.'; import { runAlert } from '..'; import { saveAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs }) { - const generalInformation = (React.createElement(React.Fragment, null, - React.createElement("div", { className: "mb-3" }, - React.createElement("label", { className: "form-label" }, "Name"), - React.createElement("input", { type: "text", className: "form-control", value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }) })), - React.createElement("div", { className: "mb-3" }, - React.createElement("label", { className: "form-label" }, "CDC"), - React.createElement(Select, { options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), - React.createElement("input", { className: "form-check-input", type: "checkbox", checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), - React.createElement("label", { className: "form-check-label ms-2" }, "Email notification"), - React.createElement("div", { className: "mb-3 form-check" }))); + const [validFilter, setValidFilter] = React.useState(true); + const [validName, setValidName] = React.useState(true); + React.useEffect(() => { + setValidFilter((filter === null || filter === void 0 ? void 0 : filter.children.length) > 0); + }, [filter]); + React.useEffect(() => { + var _a; + setValidName(((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0); + }, [alertData.name]); const onSave = async () => { - const newAlert = await saveAlert({ ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - runAlert(newAlert.id); - onAlertChanged(newAlert.id); - setCreationMode(false); + if (validFilter && validName) { + const newAlert = await saveAlert({ + ...alertData, + filter_dump: JSON.stringify(filter), + filter_query: getTreeQuery(filter, filterComponents) + }).then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + onAlertChanged(newAlert.id); + setCreationMode(false); + } }; return (React.createElement(React.Fragment, null, React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, @@ -30,8 +37,24 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement("i", { className: "fas fa-save" })), React.createElement("button", { title: "Discard changes", className: "btn btn-text-secondary ms-1", onClick: () => setCreationMode(false) }, React.createElement("i", { className: "fas fa-times" })))), - React.createElement("div", { className: "accordion", id: "createAlert" }, - accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true), - accordionItem(2, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter })) : React.createElement("p", null, "No filters available for this cdc"))))); + React.createElement("div", { className: "card p-3" }, + React.createElement("div", { className: "row mb-3" }, + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "Name"), + React.createElement("input", { type: "text", className: `form-control${validName ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }), required: true }), + validName ? null : + React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!")), + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "CDC"), + React.createElement(Select, { options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "Email notification"), + React.createElement("div", { className: "form-check" }, + React.createElement("input", { className: "form-check-input", type: "checkbox", checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), + React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), + React.createElement("div", null, filterSelection || !filter ? + React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) + : + React.createElement("p", null, "No filters available for this cdc"))))); } //# sourceMappingURL=CDCCreateAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index d0297196a..1c66d53ce 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,GAAG,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAc1F,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAkB;IAEpK,MAAM,kBAAkB,GACtB,CAAC;QACC,6BAAK,SAAS,EAAC,MAAM;YACnB,+BAAO,SAAS,EAAC,YAAY,WAAa;YAC1C,+BAAO,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAC,CAAC,GAAI,CACtI;QACN,6BAAK,SAAS,EAAC,MAAM;YACnB,+BAAO,SAAS,EAAC,YAAY,UAAY;YACzC,oBAAC,MAAM,IACL,OAAO,EAAE,I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C,EACxD,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,EAAC,EACzD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,EAAC,CAAC,GAC9D,CACE;gBACN,6BAAK,SAAS,EAAC,UAAU;oBACvB,+BAAO,SAAS,EAAC,YAAY,yBAA2B;oBACxD,6BAAK,SAAS,EAAC,YAAY;wBACzB,+BAAO,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;wBAC9L,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;YACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3B,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;gBAC3J,CAAC;oBACD,mEAAwC,CAEtC,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index ef9debd16..c6d70f093 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -5,22 +5,40 @@ import { confirmAlertById, deleteAlert, editAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs }) { - var _a; + var _a, _b; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); + const [validName, setValidName] = React.useState(true); + const [validFilter, setValidFilter] = React.useState(true); React.useEffect(() => { setEditMode(false); setDeleteMode(false); }, [selectedAlert]); + React.useEffect(() => { + setValidFilter((filter === null || filter === void 0 ? void 0 : filter.children.length) > 0); + }, [filter]); + React.useEffect(() => { + var _a; + setValidName(((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0); + }, [alertData.name]); const confirmChanges = async (id) => { const alert = await confirmAlertById(id); onAlertChanged(alert.id); }; const onSave = async () => { - setEditMode(false); - const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); - runAlert(newAlert.id); - onAlertChanged(newAlert.id); + if (validFilter && validName) { + const newAlert = await editAlert(selectedAlert.id, { + ...alertData, + filter_dump: JSON.stringify(filter), + filter_query: getTreeQuery(filter, filterComponents) + }).then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + onAlertChanged(newAlert.id); + setEditMode(false); + } }; const onDiscard = () => { setEditMode(false); @@ -33,25 +51,37 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, onAlertChanged(); }; const generalInformation = (React.createElement(React.Fragment, null, - React.createElement("div", { className: "mb-3" }, - React.createElement("label", { className: "form-label" }, "Name"), - !editMode ? - React.createElement("p", null, alertData.name) - : - React.createElement("input", { type: "text", className: "form-control", value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }) })), - React.createElement("div", { className: "mb-3" }, - React.createElement("label", { className: "form-label" }, "CDC"), - React.createElement(Select, { isDisabled: !editMode, options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), - React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: !editMode, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), - React.createElement("label", { className: "form-check-label ms-2" }, "Email notification"), - React.createElement("div", { className: "mb-3 form-check" }))); + React.createElement("div", { className: "row mb-3" }, + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "Name"), + !editMode ? + React.createElement("p", null, alertData.name) + : + React.createElement(React.Fragment, null, + React.createElement("input", { type: "text", className: `form-control${validName ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }) }), + validName ? null : + React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!"))), + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "CDC"), + React.createElement(Select, { isDisabled: !editMode, options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "Email notification"), + React.createElement("div", { className: "form-check" }, + React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: !editMode, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), + React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), + React.createElement("div", null, filterSelection || !filter ? + React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode, isInvalid: !validFilter }) + : + React.createElement("p", null, "No filters available for this cdc")))); const literature = () => { var _a; const data = (_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added; return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.length) > 0 ? (React.createElement(React.Fragment, null, React.createElement("h6", null, "Literature:"), data.map((d, i) => React.createElement("p", { key: i }, d)), - React.createElement("button", { title: "Confirm changes", className: "btn btn-text-secondary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm Changes"))) : (React.createElement("p", null, "No new data available")))); + React.createElement("button", { title: "Confirm changes", className: "btn btn-secondary", onClick: () => confirmChanges(selectedAlert.id) }, + React.createElement("i", { className: "far fa-eye" }), + " Confirm"))) : (React.createElement("p", null, "No new data available")))); }; const editButton = !editMode && !deleteMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, @@ -71,8 +101,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("h5", null, "Your options"), React.createElement("small", null, editButton)), React.createElement("div", { className: "accordion", id: "editAlert" }, - !editMode ? accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? 'Latest revision from: ' + selectedAlert.latest_compare_date : 'No new data'}`, 'editAlert', literature(), true) : null, - accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode), - accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode })) : React.createElement("p", null, "No filters available for this cdc"))))); + !editMode ? accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? 'Latest revision from: ' + ((_b = new Date(selectedAlert.latest_compare_date)) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()) : 'No new data'}`, 'editAlert', literature(), true) : null, + accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)))); } //# sourceMappingURL=CDCEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index 0d29886fc..8e1b088e9 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.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C;YAAE,2BAAG,SAAS,EAAC,cAAc,GAAK,CAAS,CAC/I,CAAC,CAAC;IAEL,OAAO,CAAC;QACN,6BAAK,SAAS,EAAC,2CAA2C;YACxD,+CAAqB;YACrB,mCAAQ,UAAU,CAAS,CACvB;QACN,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAC,WAAW;YACtC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,GAAG,OAAA,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,0CAAE,qBAAqB,EAAC,CAAC,CAAC,wBAAwB,UAAG,IAAI,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,0CAAE,kBAAkB,GAAE,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACtP,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAC1E,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.d.ts b/dist/cdc/CDCFilterComponent.d.ts index 99bc2e96f..299b3a943 100644 --- a/dist/cdc/CDCFilterComponent.d.ts +++ b/dist/cdc/CDCFilterComponent.d.ts @@ -8,6 +8,7 @@ interface ICDCFilterComponentProps { [key: string]: IFilterComponent; }; disableFilter?: boolean; + isInvalid?: boolean; } -export declare function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter }: ICDCFilterComponentProps): JSX.Element; +export declare function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }: ICDCFilterComponentProps): JSX.Element; export {}; diff --git a/dist/cdc/CDCFilterComponent.js b/dist/cdc/CDCFilterComponent.js index 28098ae64..d2b5f6756 100644 --- a/dist/cdc/CDCFilterComponent.js +++ b/dist/cdc/CDCFilterComponent.js @@ -5,7 +5,7 @@ import { HTML5Backend } from 'react-dnd-html5-backend'; import { FilterCard } from './FilterCard'; import { getFilterFromTree } from './interface'; import { v4 as uuidv4 } from 'uuid'; -export function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter }) { +export function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }) { const onDelete = (newFilter) => { setFilter((filter) => produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); @@ -74,7 +74,7 @@ export function CDCFilterComponent({ filterSelection, filter, setFilter, filterC React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "Your filters"), - React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged, filterComponents: filterComponents, disableFilter: disableFilter })), + React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged, filterComponents: filterComponents, disableFilter: disableFilter, isInvalid: isInvalid })), filterSelection ? React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "New filters"), diff --git a/dist/cdc/CDCFilterComponent.js.map b/dist/cdc/CDCFilterComponent.js.map index 075d227ab..9d9f6c041 100644 --- a/dist/cdc/CDCFilterComponent.js.map +++ b/dist/cdc/CDCFilterComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAA4B,MAAM,aAAa,CAAC;AACzE,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MA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c,GAAG,CAAC,MAAe,EAAE,KAAU,EAAE,EAAE;QACrD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YACrB,CAAC,CAAC,cAAc,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAClB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,+CAAqB;gBACrB,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAA4B,MAAM,a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;aACrB;QACH,CAAC,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,MAAe,EAAE,KAAU,EAAE,EAAE;QACrD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YACrB,CAAC,CAAC,cAAc,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAClB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,+CAAqB;gBACrB,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,GACpB,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index fe705e655..7dcb2c20e 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter, IFilterComponent, IUploadAlert } from './interface'; +import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interface'; interface ICDCFilterDialogProps { filterComponents: { [key: string]: IFilterComponent; @@ -21,7 +21,7 @@ export declare const DEFAULTFILTER: { children?: IFilter[]; }; export declare const accordionItem: (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => JSX.Element; -export declare const runAlert: (id: number) => void; +export declare const runAlert: (id: number) => Promise; export declare function CDCFilterDialog({ filterComponents, filtersByCDC }: ICDCFilterDialogProps): JSX.Element; export declare class CDCFilterDialogClass { private node; diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 0cb13e469..62fa94714 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -18,10 +18,12 @@ export const accordionItem = (index, title, parentId, child, show) => { React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); }; -export const runAlert = (id) => { - runAlertById(id).catch((e) => { +export const runAlert = async (id) => { + const runAlert = runAlertById(id).then((alert) => { return alert; }).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); + return null; }); + return runAlert; }; export function CDCFilterDialog({ filterComponents, filtersByCDC }) { const [selectedAlert, setSelectedAlert] = React.useState(); @@ -84,7 +86,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { "Error ", alertError.toString()) : null, alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => { - var _a, _b; + var _a, _b, _c, _d, _e; return React.createElement("div", { key: alert.id }, React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, React.createElement("div", { className: "d-flex w-100 justify-content-between" }, @@ -96,7 +98,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { alert.cdc_id)), ((_b = (_a = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.length) > 0 ? React.createElement("small", null, React.createElement("i", { className: "fas fa-circle text-primary" })) : null), - React.createElement("small", null, !alert.latest_diff && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${alert.confirmation_date}`))); + React.createElement("small", null, !((_c = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _c === void 0 ? void 0 : _c.dictionary_item_added) && !alert.confirmed_data ? 'No data revision yet' : ((_d = JSON.parse(alert.latest_diff)) === null || _d === void 0 ? void 0 : _d.dictionary_item_added) ? 'Pending data revision' : `Last confirmed: ${(_e = new Date(alert.confirmation_date)) === null || _e === void 0 ? void 0 : _e.toLocaleDateString()}`))); })) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert ? React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, onAlertChanged: onAlertChanged, selectedAlert: selectedAlert, cdcs: cdcs }) diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 2db9a2147..5cebc70a4 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EA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ard.d.ts b/dist/cdc/FilterCard.d.ts index bd81ae071..0d880e8fc 100644 --- a/dist/cdc/FilterCard.d.ts +++ b/dist/cdc/FilterCard.d.ts @@ -10,6 +10,7 @@ interface IFilterCardProps { [key: string]: IFilterComponent; }; disableFilter: boolean; + isInvalid?: boolean; } -export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter }: IFilterCardProps): JSX.Element; +export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter, isInvalid }: IFilterCardProps): JSX.Element; export {}; diff --git a/dist/cdc/FilterCard.js b/dist/cdc/FilterCard.js index a7bf441c7..a86c716e7 100644 --- a/dist/cdc/FilterCard.js +++ b/dist/cdc/FilterCard.js @@ -2,7 +2,7 @@ import * as React from 'react'; import { itemTypes } from './interface'; import { useDrag } from 'react-dnd'; import { DropZone } from './DropZone'; -export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter }) { +export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter, isInvalid }) { var _a, _b, _c; const [{ isDragging, draggedItem }, drag, preview] = useDrag(() => ({ type: itemTypes.FILTERCARD, @@ -17,30 +17,34 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, if (!filterComponent) { return React.createElement(React.Fragment, null, "ERROR!!"); } - return (React.createElement("div", { className: `card mb-2 ${isDragging ? 'bg-light' : ''}`, ref: preview, style: filter.disableRemoving && filter.disableDragging ? { height: '93%' } : {} }, - React.createElement("div", { className: "card-body" }, - React.createElement("h6", { ref: filter.disableDragging || disableFilter ? undefined : drag, className: "card-title d-flex", style: filter.disableDragging || disableFilter ? {} : { cursor: 'move' } }, - filter.disableDragging || disableFilter ? null : (React.createElement("i", { style: { marginRight: 5 }, className: "fas fa-arrows-alt" })), - React.createElement("span", { className: "flex-fill" }, filter.name), - React.createElement("div", null, - React.createElement("div", { className: "input-group" }, - onChange && hasChildren && ((_a = filter === null || filter === void 0 ? void 0 : filter.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? (React.createElement("select", { className: "form-select form-select-sm", style: { width: '6em' }, value: filter.operator || 'AND', disabled: disableFilter, onChange: (e) => { - onChange(filter, (f) => { - f.operator = e.currentTarget.value; - }); - } }, - React.createElement("option", { value: "AND" }, "AND"), - React.createElement("option", { value: "OR" }, "OR"), - React.createElement("option", { value: "NOT" }, "NOT (AND)"))) : null, - !filter.disableRemoving && onDelete && !disableFilter ? (React.createElement("button", { className: "btn btn-text-secondary btn-sm", onClick: () => onDelete(filter) }, - React.createElement("i", { className: "fas fa-times" }))) : null))), - filterComponent ? (React.createElement("div", null, - React.createElement(filterComponent.clazz, { disabled: disableFilter, value: filter.componentValue, onValueChanged: onValueChanged - ? (value) => onValueChanged(filter, value) - : undefined }))) : null, - onDrop && (hasChildren || !filter.disableDropping) && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: 0, canDrop: draggedItem !== ((_b = filter.children) === null || _b === void 0 ? void 0 : _b[0]) })) : null, (_c = filter.children) === null || _c === void 0 ? void 0 : - _c.map((child, i, allChildren) => (React.createElement(React.Fragment, { key: child.id }, - React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onChange: onChange, filterComponents: filterComponents, disableFilter: disableFilter }), - onDrop && hasChildren && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: i + 1, canDrop: draggedItem !== allChildren[i + 1] && draggedItem !== child && !disableFilter })) : null)))))); + return (React.createElement(React.Fragment, null, + React.createElement("div", { className: `card mb-2 ${isDragging ? 'bg-light' : ''}${isInvalid ? ' form-control is-invalid' : ''}`, ref: preview, style: filter.disableRemoving && filter.disableDragging ? { height: '93%' } : {} }, + React.createElement("div", { className: "card-body" }, + React.createElement("h6", { ref: filter.disableDragging || disableFilter ? undefined : drag, className: "card-title d-flex", style: filter.disableDragging || disableFilter ? {} : { cursor: 'move' } }, + filter.disableDragging || disableFilter ? null : (React.createElement("i", { style: { marginRight: 5 }, className: "fas fa-arrows-alt" })), + React.createElement("span", { className: "flex-fill" }, filter.name), + React.createElement("div", null, + React.createElement("div", { className: "input-group" }, + onChange && hasChildren && ((_a = filter === null || filter === void 0 ? void 0 : filter.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? (React.createElement("select", { className: "form-select form-select-sm", style: { width: '6em' }, value: filter.operator || 'AND', disabled: disableFilter, onChange: (e) => { + onChange(filter, (f) => { + f.operator = e.currentTarget.value; + }); + } }, + React.createElement("option", { value: "AND" }, "AND"), + React.createElement("option", { value: "OR" }, "OR"), + React.createElement("option", { value: "NOT" }, "NOT (AND)"))) : null, + !filter.disableRemoving && onDelete && !disableFilter ? (React.createElement("button", { className: "btn btn-text-secondary btn-sm", onClick: () => onDelete(filter) }, + React.createElement("i", { className: "fas fa-times" }))) : null))), + filterComponent ? (React.createElement("div", null, + React.createElement(filterComponent.clazz, { disabled: disableFilter, value: filter.componentValue, onValueChanged: onValueChanged + ? (value) => onValueChanged(filter, value) + : undefined }))) : null, + onDrop && (hasChildren || !filter.disableDropping) && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: 0, canDrop: draggedItem !== ((_b = filter.children) === null || _b === void 0 ? void 0 : _b[0]) })) : null, (_c = filter.children) === null || _c === void 0 ? void 0 : + _c.map((child, i, allChildren) => (React.createElement(React.Fragment, { key: child.id }, + React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onChange: onChange, filterComponents: filterComponents, disableFilter: disableFilter }), + onDrop && hasChildren && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: i + 1, canDrop: draggedItem !== allChildren[i + 1] && draggedItem !== child && !disableFilter })) : null))))), + isInvalid ? + React.createElement("div", { className: "invalid-feedback mb-2" }, "Filter must not be empty!") : + null)); } //# sourceMappingURL=FilterCard.js.map \ No newline at end of file diff --git a/dist/cdc/FilterCard.js.map b/dist/cdc/FilterCard.js.map index e7cc8d23c..a0e78577c 100644 --- a/dist/cdc/FilterCard.js.map +++ b/dist/cdc/FilterCard.js.map @@ -1 +1 @@ -{"version":3,"file":"FilterCard.js","sourceRoot":"","sources":["../../src/cdc/FilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA4B,SAAS,EAAC,MAAM,aAAa,CAAC;AACjE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAYpC,MAAM,UAAU,UAAU,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAmB;;IAChI,MAAM,CAAC,EAAC,UAAU,EAAE,WAAW,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChE,IAAI,EAAE,SAAS,CAAC,UAAU;QAC1B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE;YAClC,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,CAAC,CAAC;IAEJ,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC;IACnE,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE7D,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,oDAAY,CAAC;KACrB;IAED,OAAO,CACL,6BACE,SAAS,EAAE,aAAa,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EACtD,GAAG,EAAE,OA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AC,CAAC,CAAC,CACtE,oBAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,WAAW,YAAK,MAAM,CAAC,QAAQ,0CAAG,CAAC,EAAC,GAC7C,CACH,CAAC,CAAC,CAAC,IAAI,QACP,MAAM,CAAC,QAAQ;mBAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC,CAC/C,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,EAAE;oBAC3B,oBAAC,UAAU,IACT,GAAG,EAAE,KAAK,CAAC,EAAE,EACb,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B;oBACD,MAAM,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CACzC,oBAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GAAG,CAAC,EACZ,OAAO,EACL,WAAW,KAAK,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,IAAI,CAAC,aAAa,GAE/E,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF;QACL,SAAS,CAAC,CAAC;YACV,6BAAK,SAAS,EAAC,uBAAuB,gCAEhC,CAAC,CAAC;YACR,IAAI,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index 34c5ffa97..8e8f834d7 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -37,10 +37,10 @@ export interface IAlert { enable_mail_notification: boolean; latest_diff: any; latest_fetched_data: string; - latest_compare_date: string; + latest_compare_date: Date; modification_date: string; confirmed_data: string; - confirmation_date: string; + confirmation_date: Date; } export interface IUploadAlert extends Pick { } diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index 5c8ad1472..d40d5bb1e 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -19,31 +19,31 @@ interface ICDCCreateAlert { } export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs}: ICDCCreateAlert) { + const [validFilter, setValidFilter] = React.useState(true); + const [validName, setValidName] = React.useState(true); - const generalInformation = - (<> -
    - - setAlertData({...alertData, name: e.target.value})} /> -
    -
    - - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    - ); + React.useEffect(() => { + setValidFilter(filter?.children.length > 0); + }, [filter]); + + React.useEffect(() => { + setValidName(alertData?.name?.trim().length > 0); + }, [alertData.name]); const onSave = async () => { - const newAlert = await saveAlert({...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - runAlert(newAlert.id); - onAlertChanged(newAlert.id); - setCreationMode(false); + if (validFilter && validName) { + const newAlert = await saveAlert({ + ...alertData, + filter_dump: JSON.stringify(filter), + filter_query: getTreeQuery(filter, filterComponents) + }).then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + onAlertChanged(newAlert.id); + setCreationMode(false); + } }; return (<> @@ -54,9 +54,39 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter
    -
    - {accordionItem(1, 'Alert overview', 'createAlert', generalInformation, true)} - {accordionItem(2, 'Filter settings', 'createAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )} +
    +
    +
    + + setAlertData({...alertData, name: e.target.value})} required /> + {validName ? null : +
    + Name must not be empty! +
    } +
    +
    + + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + +
    +
    +
    +
    + {filterSelection || !filter ? + + : +

    No filters available for this cdc

    + } +
    ); } diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index c6b044f45..52b8ec362 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -20,29 +20,51 @@ interface ICDCEditAlert { export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); + const [validName, setValidName] = React.useState(true); + const [validFilter, setValidFilter] = React.useState(true); + React.useEffect(() => { setEditMode(false); setDeleteMode(false); }, [selectedAlert]); + React.useEffect(() => { + setValidFilter(filter?.children.length > 0); + }, [filter]); + + React.useEffect(() => { + setValidName(alertData?.name?.trim().length > 0); + }, [alertData.name]); + const confirmChanges = async (id: number) => { const alert = await confirmAlertById(id); onAlertChanged(alert.id); }; - + const onSave = async () => { - setEditMode(false); - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); - runAlert(newAlert.id); - onAlertChanged(newAlert.id); + if (validFilter && validName) { + const newAlert = await editAlert( + selectedAlert.id, + { + ...alertData, + filter_dump: JSON.stringify(filter), + filter_query: getTreeQuery(filter, filterComponents) + }).then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + onAlertChanged(newAlert.id); + setEditMode(false); + } }; - + const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); setFilter(JSON.parse(selectedAlert.filter_dump)); }; - + const onDelete = async (id: number) => { setEditMode(false); await deleteAlert(id); @@ -51,26 +73,42 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const generalInformation = (<> -
    - - {!editMode ? -

    {alertData.name}

    - : - setAlertData({...alertData, name: e.target.value})} /> - } +
    +
    + + {!editMode ? +

    {alertData.name}

    + : + <> setAlertData({...alertData, name: e.target.value})} /> + {validName ? null : +
    + Name must not be empty! +
    } + } +
    +
    + + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + +
    +
    -
    - - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    ); const literature = () => { @@ -78,7 +116,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, return (<>{data?.length > 0 ? (<>
    Literature:
    {data.map((d, i) =>

    {d}

    )} - + ) : (

    No new data available

    )} @@ -102,9 +140,8 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, {editButton}
    - {!editMode ? accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? 'Latest revision from: ' + selectedAlert.latest_compare_date : 'No new data'}`, 'editAlert', literature(), true) : null} + {!editMode ? accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? 'Latest revision from: ' + new Date(selectedAlert.latest_compare_date)?.toLocaleDateString() : 'No new data'}`, 'editAlert', literature(), true) : null} {accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)} - {accordionItem(3, 'Filter settings', 'editAlert', filterSelection ? (!filter ? null : ) :

    No filters available for this cdc

    )}
    ); } diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx index 2377da4b8..b7761dff4 100644 --- a/src/cdc/CDCFilterComponent.tsx +++ b/src/cdc/CDCFilterComponent.tsx @@ -12,9 +12,10 @@ interface ICDCFilterComponentProps { setFilter: React.Dispatch>; filterComponents: {[key: string]: IFilterComponent}; disableFilter?: boolean; + isInvalid?: boolean; } -export function CDCFilterComponent({filterSelection, filter, setFilter, filterComponents, disableFilter}: ICDCFilterComponentProps) { +export function CDCFilterComponent({filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid}: ICDCFilterComponentProps) { const onDelete = (newFilter: IFilter) => { setFilter((filter) => produce(filter, (nextFilter) => { const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); @@ -102,6 +103,7 @@ export function CDCFilterComponent({filterSelection, filter, setFilter, filterCo onValueChanged={onValueChanged} filterComponents={filterComponents} disableFilter={disableFilter} + isInvalid={isInvalid} />
    {filterSelection ? diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index c4c63311a..933eb74ba 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -35,10 +35,12 @@ export const accordionItem = (index: number, title: string, parentId: string, ch ); }; -export const runAlert = (id: number) => { - runAlertById(id).catch((e) => { +export const runAlert = async (id: number): Promise => { + const runAlert = runAlertById(id).then((alert) => {return alert}).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); + return null; }); + return runAlert; }; export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDialogProps) { @@ -107,7 +109,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    {alert.name} for {alert.cdc_id}
    {JSON.parse(alert?.latest_diff)?.dictionary_item_added?.length > 0 ? : null}
    - {!alert.latest_diff && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${alert.confirmation_date}`} + {!JSON.parse(alert?.latest_diff)?.dictionary_item_added && !alert.confirmed_data ? 'No data revision yet' : JSON.parse(alert.latest_diff)?.dictionary_item_added ? 'Pending data revision' : `Last confirmed: ${new Date(alert.confirmation_date)?.toLocaleDateString()}`}
    )}
    : null}
    diff --git a/src/cdc/FilterCard.tsx b/src/cdc/FilterCard.tsx index 8d905517b..6d544aed1 100644 --- a/src/cdc/FilterCard.tsx +++ b/src/cdc/FilterCard.tsx @@ -11,9 +11,10 @@ interface IFilterCardProps { onValueChanged?: (filter: IFilter, value: any) => void; filterComponents: {[key: string]: IFilterComponent}; disableFilter: boolean; + isInvalid?: boolean; } -export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter}: IFilterCardProps) { +export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter, isInvalid}: IFilterCardProps) { const [{isDragging, draggedItem}, drag, preview] = useDrag(() => ({ type: itemTypes.FILTERCARD, item: filter, @@ -30,9 +31,9 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, return <>ERROR!!; } - return ( + return (<>
    @@ -132,5 +133,10 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, ))}
    - ); + {isInvalid ? +
    + Filter must not be empty! +
    : + null} + ); } diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index fdbaa66b9..c78d2194f 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -88,10 +88,10 @@ export interface IAlert { enable_mail_notification: boolean; latest_diff: any; latest_fetched_data: string; - latest_compare_date: string; + latest_compare_date: Date; modification_date: string; confirmed_data: string; - confirmation_date: string; + confirmation_date: Date; } export interface IUploadAlert extends Pick {} From 874b30feef76605fa25286310b85306ea8eba70e Mon Sep 17 00:00:00 2001 From: Markus Vogl Date: Tue, 2 Nov 2021 14:54:26 +0100 Subject: [PATCH 16/40] CDC filters --- src/cdc/CDCCreateAlert.tsx | 2 +- src/cdc/CDCEditAlert.tsx | 10 ++++---- src/cdc/CDCFilterDialog.tsx | 4 +-- src/cdc/interface.ts | 4 +-- tdp_core/cdc/CDCAlert.py | 4 +-- tdp_core/cdc/schema/FieldFilterMixin.py | 26 +++++++++++++++++++ tdp_core/cdc/schema/Filter.py | 34 +++++++++++++++++++++++++ tdp_core/cdc/schema/Group.py | 20 +++++++++++++++ tdp_core/cdc/schema/Range.py | 11 ++++++++ tdp_core/cdc/schema/Text.py | 18 +++++++++++++ 10 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 tdp_core/cdc/schema/FieldFilterMixin.py create mode 100644 tdp_core/cdc/schema/Filter.py create mode 100644 tdp_core/cdc/schema/Group.py create mode 100644 tdp_core/cdc/schema/Range.py create mode 100644 tdp_core/cdc/schema/Text.py diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index 5c8ad1472..9987ebe32 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -40,7 +40,7 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter ); const onSave = async () => { - const newAlert = await saveAlert({...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); + const newAlert = await saveAlert({...alertData, filter, filter_query: getTreeQuery(filter, filterComponents)}); runAlert(newAlert.id); onAlertChanged(newAlert.id); setCreationMode(false); diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index c6b044f45..433c6a26e 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -29,20 +29,20 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const alert = await confirmAlertById(id); onAlertChanged(alert.id); }; - + const onSave = async () => { setEditMode(false); - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents)}); + const newAlert = await editAlert(selectedAlert.id, {...alertData, filter, filter_query: getTreeQuery(filter, filterComponents)}); runAlert(newAlert.id); onAlertChanged(newAlert.id); }; - + const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); - setFilter(JSON.parse(selectedAlert.filter_dump)); + setFilter(selectedAlert.filter); }; - + const onDelete = async (id: number) => { setEditMode(false); await deleteAlert(id); diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index c4c63311a..99cacc092 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -16,7 +16,7 @@ interface ICDCFilterDialogProps { filtersByCDC: {[cdcId: string]: IFilter[]}; } -export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: '', filter_query: ''}; +export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: {}, filter_query: ''}; export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; export const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { @@ -65,7 +65,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial const onAlertClick = async (alert: IAlert) => { setAlertData(alert); - setFilter(JSON.parse(alert.filter_dump)); + setFilter(alert.filter); setCreationMode(false); setSelectedAlert(alert); }; diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index fdbaa66b9..3fde74a1e 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -83,7 +83,7 @@ export interface IAlert { id: number; name: string; cdc_id: string; - filter_dump: string; + filter: object; filter_query: string; enable_mail_notification: boolean; latest_diff: any; @@ -94,7 +94,7 @@ export interface IAlert { confirmation_date: string; } -export interface IUploadAlert extends Pick {} +export interface IUploadAlert extends Pick {} export function isAlert(obj: IAlert | IUploadAlert): obj is IAlert { return typeof (obj as any)?.id === 'number'; diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index c68eaf42c..b96f5422b 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -1,5 +1,5 @@ -from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, BLOB, PickleType +from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, BLOB, PickleType, JSON from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy.sql.schema import ForeignKey @@ -23,7 +23,7 @@ class CDCAlert(Base): name = Column(TEXT, nullable=False) cdc_id = Column(TEXT, nullable=False) # TODO: Change to JSONB in postgres - filter_dump = Column(PickleType, nullable=False) + filter = Column(JSON, nullable=False) filter_query = Column(TEXT, nullable=False) enable_mail_notification = Column(Boolean, nullable=False) diff --git a/tdp_core/cdc/schema/FieldFilterMixin.py b/tdp_core/cdc/schema/FieldFilterMixin.py new file mode 100644 index 000000000..a9ffc8fa2 --- /dev/null +++ b/tdp_core/cdc/schema/FieldFilterMixin.py @@ -0,0 +1,26 @@ +from re import match +from typing import Any + +from marshmallow.fields import String + + +class FieldFilterMixin: + """ Mixin for filters that access a field in the input-data. + Supports simple attributes, sub.attributes or indexed[0], as as well as .len """ + field = String(required=True) + + @staticmethod + def access(item, field) -> Any: + for field_name in field.split("."): + assert not field_name.startswith("_"), "Private access detected." + + # get array-calls + m = match("(.*)\[(.*)\\]", field) + if m: + field_name, field_idx = m.groups() + item = getattr(item, field_name).__getitem__(field_idx) + elif field_name == "len": + item = len(item) + else: + item = item.get(field_name) + return item diff --git a/tdp_core/cdc/schema/Filter.py b/tdp_core/cdc/schema/Filter.py new file mode 100644 index 000000000..f6fd4f210 --- /dev/null +++ b/tdp_core/cdc/schema/Filter.py @@ -0,0 +1,34 @@ +from typing import Dict, Callable, List + +from marshmallow import Schema, post_load, INCLUDE +from marshmallow.fields import String + +FILTERS = {f.__name__.lower(): f for f in Filter.__subclasses__()} # dict from classes + + +class Filter(Schema): + """ Filter baseclass to delegate to children """ + + class Meta: + unknown = INCLUDE + + id = String(required=True) + name = String(required=True) + type = String(required=True) + + @post_load() + def _postload(self, data, **kwargs) -> Callable: + """ Call a postload function in every sub-class """ + return self.postload(data, **data) + + def postload(self, data, type, **_) -> Callable: + """ Delegate to a subclass based on name/type field """ + assert type in FILTERS, f"Error: Filter type {type} doesn't exist in {FILTERS.values()}" + sub_cls = FILTERS[type] + return sub_cls().load(data) + + @staticmethod + def apply(items, filt) -> List[Dict]: + """ Apply a filter """ + filt = Filter().load(filt) + return list(filter(filt, items)) diff --git a/tdp_core/cdc/schema/Group.py b/tdp_core/cdc/schema/Group.py new file mode 100644 index 000000000..ce1077f34 --- /dev/null +++ b/tdp_core/cdc/schema/Group.py @@ -0,0 +1,20 @@ +import operator +from functools import reduce + +from marshmallow import fields +from marshmallow.fields import String + +from . import FieldFilterMixin, Filter + +ALLOWED_OPERATORS = {"and": operator.and_, "or": operator.or_} + + +class Group(Filter, FieldFilterMixin): + operator = String(required=True, validate=lambda o: o in ALLOWED_OPERATORS) + children = fields.List(fields.Dict) + + def postload(self, data, children, operator, **_): + if not children: + return lambda _: True + children = [Filter().load(child) for child in children] + return lambda d: reduce(ALLOWED_OPERATORS[operator], [child(d) for child in children]) diff --git a/tdp_core/cdc/schema/Range.py b/tdp_core/cdc/schema/Range.py new file mode 100644 index 000000000..4e7a08b3b --- /dev/null +++ b/tdp_core/cdc/schema/Range.py @@ -0,0 +1,11 @@ +from marshmallow.fields import String, Number + +from . import FieldFilterMixin, Filter + +class Range(Filter, FieldFilterMixin): + field = String(required=True, validate=lambda s: not s.startswith("_") and not "._" in s) + min = Number() + max = Number() + + def postload(self, data, field, min, max, **_): + return lambda item: min < FieldFilter.access(item, field) < max diff --git a/tdp_core/cdc/schema/Text.py b/tdp_core/cdc/schema/Text.py new file mode 100644 index 000000000..19635d920 --- /dev/null +++ b/tdp_core/cdc/schema/Text.py @@ -0,0 +1,18 @@ +import operator + +from marshmallow.fields import String, Boolean + +from . import Filter, FieldFilterMixin + + +class Text(Filter, FieldFilterMixin): + """ Filter for textfields to match """ + value = String(required=True) + match_case = Boolean(required=False, missing=False) + match_exact = Boolean(required=False, missing=False) + + def postload(self, data, field, value, match_case, match_exact, **_): + compare = operator.eq if match_exact else str.__contains__ + if match_case: + compare = lambda a, b: print(a, b) # compare(b.lower(), a.lower()) + return lambda item: compare(FieldFilter.access(item, field), value) From 8b41daed1ccbb8787c9bc07bc61edc50f9f5fba5 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Tue, 2 Nov 2021 15:15:34 +0100 Subject: [PATCH 17/40] filter error fix --- dist/cdc/CDCCreateAlert.js | 2 +- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.js | 4 ++-- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.js | 4 ++-- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/interface.d.ts | 4 ++-- src/cdc/CDCFilterDialog.tsx | 2 +- src/cdc/interface.ts | 2 +- tdp_core/cdc/CDCAlert.py | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index 953a1006d..30df8897b 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -17,7 +17,7 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement("label", { className: "form-check-label ms-2" }, "Email notification"), React.createElement("div", { className: "mb-3 form-check" }))); const onSave = async () => { - const newAlert = await saveAlert({ ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); + const newAlert = await saveAlert({ ...alertData, filter, filter_query: getTreeQuery(filter, filterComponents) }); runAlert(newAlert.id); onAlertChanged(newAlert.id); setCreationMode(false); diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index d0297196a..83f1b8028 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,GAAG,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAc1F,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,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K,CAAC;oBAAE,2BAAG,SAAS,EAAC,cAAc,GAAK,CAAS,CAClJ,CACJ;QACN,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAC,aAAa;YACxC,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,IAAI,CAAC;YAC3E,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CACnQ,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index ef9debd16..a566675bf 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -18,14 +18,14 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, }; const onSave = async () => { setEditMode(false); - const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter_dump: JSON.stringify(filter), filter_query: getTreeQuery(filter, filterComponents) }); + const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter, filter_query: getTreeQuery(filter, filterComponents) }); runAlert(newAlert.id); onAlertChanged(newAlert.id); }; const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); - setFilter(JSON.parse(selectedAlert.filter_dump)); + setFilter(selectedAlert.filter); }; const onDelete = async (id) => { setEditMode(false); diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index 0d29886fc..74b3d4a06 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.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wB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACtN,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,CAAC;YAC7E,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,kBAAkB,IAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,QAAQ,GAAI,CAAC,CAAC,CAAC,CAAC,mEAAwC,CAAC,CAC9S,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 0cb13e469..d34240fdd 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -9,7 +9,7 @@ import { CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter } from import { CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './CDCRangeFilter'; import { CDCCreateAlert } from './CDCCreateAlert'; import { CDCEditAlert } from './CDCEditAlert'; -export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: '', filter_query: '' }; +export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: '' }; export const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true }; export const accordionItem = (index, title, parentId, child, show) => { parentId = parentId.trim(); @@ -44,7 +44,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { }; const onAlertClick = async (alert) => { setAlertData(alert); - setFilter(JSON.parse(alert.filter_dump)); + setFilter(alert.filter); setCreationMode(false); setSelectedAlert(alert); }; diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 2db9a2147..a125e75de 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAO5C,MAAM,CAAC,MAAM,gBAAgB,GAAiB,EAAC,IAAI,EAAE,EAAE,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAA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AAE,KAAK,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,EAAC,CAAC;iBAClJ;aACF,GAAI,EACP,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index 34c5ffa97..f6165493c 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -32,7 +32,7 @@ export interface IAlert { id: number; name: string; cdc_id: string; - filter_dump: string; + filter: IFilter; filter_query: string; enable_mail_notification: boolean; latest_diff: any; @@ -42,6 +42,6 @@ export interface IAlert { confirmed_data: string; confirmation_date: string; } -export interface IUploadAlert extends Pick { +export interface IUploadAlert extends Pick { } export declare function isAlert(obj: IAlert | IUploadAlert): obj is IAlert; diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 99cacc092..6f6800948 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -16,7 +16,7 @@ interface ICDCFilterDialogProps { filtersByCDC: {[cdcId: string]: IFilter[]}; } -export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: {}, filter_query: ''}; +export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: ''}; export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; export const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index 3fde74a1e..8a3daf191 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -83,7 +83,7 @@ export interface IAlert { id: number; name: string; cdc_id: string; - filter: object; + filter: IFilter; filter_query: string; enable_mail_notification: boolean; latest_diff: any; diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index b96f5422b..710f93252 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -79,6 +79,6 @@ class Meta(CDCAlertSchema.Meta): from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:////:memory:') -#Base.metadata.drop_all(engine) +# Base.metadata.drop_all(engine) Base.metadata.create_all(engine) create_session = sessionmaker(engine) From 5fba0a4ebefcb1ee721164736b87a87f84cc00a1 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Wed, 3 Nov 2021 13:39:40 +0100 Subject: [PATCH 18/40] show all data changes in UI --- dist/cdc/CDCCreateAlert.js | 2 +- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.js | 103 ++++++++++++++++++++++++++++---- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.js | 10 ++-- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/interface.d.ts | 19 ++++-- src/cdc/CDCCreateAlert.tsx | 2 +- src/cdc/CDCEditAlert.tsx | 80 ++++++++++++++++++++++--- src/cdc/CDCFilterDialog.tsx | 8 +-- src/cdc/interface.ts | 10 ++-- tdp_core/cdc/CDCAlert.py | 12 ++-- tdp_core/cdc/CDCManager.py | 30 +++++++++- tdp_core/cdc/api.py | 4 ++ 14 files changed, 235 insertions(+), 51 deletions(-) diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index 456f15422..b9a64a0c8 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -18,7 +18,7 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte if (validFilter && validName) { const newAlert = await saveAlert({ ...alertData, - filter_dump: JSON.stringify(filter), + filter_dump: filter, filter_query: getTreeQuery(filter, filterComponents) }).then((alert) => { return runAlert(alert.id).then((a) => { diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index 1c66d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wB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;wBAC9L,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;YACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3B,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;gBAC3J,CAAC;oBACD,mEAAwC,CAEtC,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index c6d70f093..82d50b997 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -5,7 +5,7 @@ import { confirmAlertById, deleteAlert, editAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs }) { - var _a, _b; + var _a; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); const [validName, setValidName] = React.useState(true); @@ -29,7 +29,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, if (validFilter && validName) { const newAlert = await editAlert(selectedAlert.id, { ...alertData, - filter_dump: JSON.stringify(filter), + filter_dump: filter, filter_query: getTreeQuery(filter, filterComponents) }).then((alert) => { return runAlert(alert.id).then((a) => { @@ -43,7 +43,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); - setFilter(JSON.parse(selectedAlert.filter_dump)); + setFilter(selectedAlert.filter_dump); }; const onDelete = async (id) => { setEditMode(false); @@ -74,14 +74,93 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, : React.createElement("p", null, "No filters available for this cdc")))); const literature = () => { - var _a; - const data = (_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added; - return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.length) > 0 ? (React.createElement(React.Fragment, null, - React.createElement("h6", null, "Literature:"), - data.map((d, i) => React.createElement("p", { key: i }, d)), - React.createElement("button", { title: "Confirm changes", className: "btn btn-secondary", onClick: () => confirmChanges(selectedAlert.id) }, - React.createElement("i", { className: "far fa-eye" }), - " Confirm"))) : (React.createElement("p", null, "No new data available")))); + const diff = selectedAlert.latest_diff; + // const changedValues: Map = new Map(); + // if (diff.values_changed) { + // const dvc = diff.values_changed; + // Object.keys(dvc).map((key) => { + // const id = dvc[key].id + // if (changedValues.has(id)) { + // changedValues.set(id, [...changedValues.get(id), {field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); + // } else { + // changedValues.set(id, [{field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); + // } + // }); + // } + console.log(diff); + return (React.createElement(React.Fragment, null, diff ? (React.createElement(React.Fragment, null, + React.createElement("h6", null, "Changed data:"), + React.createElement("table", { className: "table table-light mt-4" }, + React.createElement("thead", null, + React.createElement("tr", null, + React.createElement("th", { scope: "col" }, "#"), + React.createElement("th", { scope: "col" }, "Name"), + React.createElement("th", { scope: "col" }, "Street"), + React.createElement("th", { scope: "col" }, "City"))), + React.createElement("tbody", null, + diff.dictionary_item_added ? + diff.dictionary_item_added.map((d) => { + var _a, _b; + const data = selectedAlert.latest_fetched_data.find(a => a.id === d); + return (React.createElement("tr", { key: d, className: "table-success" }, + React.createElement("td", null, data === null || data === void 0 ? void 0 : data.id), + React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), + React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), + React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); + }) : null, + diff.dictionary_item_removed ? + diff.dictionary_item_removed.map((d) => { + var _a, _b; + const data = selectedAlert.confirmed_data.find(a => a.id === d); + return (React.createElement("tr", { key: d, className: "table-danger" }, + React.createElement("td", null, data === null || data === void 0 ? void 0 : data.id), + React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), + React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), + React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); + }) : null, + diff.values_changed ? + Object.keys(diff.values_changed).map((d) => { + var _a, _b, _c, _d; + const cv = diff.values_changed[d]; + const data = selectedAlert.confirmed_data.find(a => a.id === cv.id); + return (React.createElement("tr", { key: d, className: "table-primary" }, + cv.field === 'id' ? React.createElement("td", null, + React.createElement("s", null, cv.old_value), + " ", + cv.new_value) : React.createElement("td", null, data === null || data === void 0 ? void 0 : data.id), + cv.field === 'name' ? React.createElement("td", null, + React.createElement("s", null, cv.old_value), + " ", + cv.new_value) : React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), + cv.field === 'address.street' ? React.createElement("td", null, + React.createElement("s", null, cv.old_value), + " ", + cv.new_value) : React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), + cv.field === 'address.zipcode' ? + React.createElement("td", null, + React.createElement("s", null, + cv.old_value, + " ", + data.address.city), + " ", + cv.new_value, + " ", (_a = selectedAlert.latest_fetched_data.find(a => a.id === cv.id)) === null || _a === void 0 ? void 0 : + _a.address.city) + : cv.field === 'address.city' ? + React.createElement("td", null, + React.createElement("s", null, + data.address.zipcode, + " ", + cv.old_value), + " ", (_b = selectedAlert.latest_fetched_data.find(a => a.id === cv.id)) === null || _b === void 0 ? void 0 : + _b.address.zipcode, + " ", + cv.new_value) + : + React.createElement("td", null, `${(_c = data === null || data === void 0 ? void 0 : data.address) === null || _c === void 0 ? void 0 : _c.zipcode} ${(_d = data === null || data === void 0 ? void 0 : data.address) === null || _d === void 0 ? void 0 : _d.city}`))); + }) : null)), + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))) : (React.createElement("p", null, "No new data available")))); }; const editButton = !editMode && !deleteMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, @@ -101,7 +180,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("h5", null, "Your options"), React.createElement("small", null, editButton)), React.createElement("div", { className: "accordion", id: "editAlert" }, - !editMode ? accordionItem(1, `${((_a = JSON.parse(selectedAlert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) ? 'Latest revision from: ' + ((_b = new Date(selectedAlert.latest_compare_date)) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()) : 'No new data'}`, 'editAlert', literature(), true) : null, + !editMode ? accordionItem(1, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_a = new Date(selectedAlert.latest_compare_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()) : 'No new data'}`, 'editAlert', literature(), true) : null, accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)))); } //# sourceMappingURL=CDCEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index 8e1b088e9..4de539c08 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc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mB,CAAC,0CAAE,kBAAkB,GAAE,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACnN,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAC1E,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 62fa94714..a1d737c61 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -9,7 +9,7 @@ import { CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter } from import { CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './CDCRangeFilter'; import { CDCCreateAlert } from './CDCCreateAlert'; import { CDCEditAlert } from './CDCEditAlert'; -export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: '', filter_query: '' }; +export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: null, filter_query: '' }; export const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true }; export const accordionItem = (index, title, parentId, child, show) => { parentId = parentId.trim(); @@ -46,7 +46,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { }; const onAlertClick = async (alert) => { setAlertData(alert); - setFilter(JSON.parse(alert.filter_dump)); + setFilter(alert.filter_dump); setCreationMode(false); setSelectedAlert(alert); }; @@ -86,7 +86,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { "Error ", alertError.toString()) : null, alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => { - var _a, _b, _c, _d, _e; + var _a; return React.createElement("div", { key: alert.id }, React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, React.createElement("div", { className: "d-flex w-100 justify-content-between" }, @@ -96,9 +96,9 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { React.createElement("small", { className: "text-muted" }, "for ", alert.cdc_id)), - ((_b = (_a = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.length) > 0 ? React.createElement("small", null, + (alert === null || alert === void 0 ? void 0 : alert.latest_diff) ? React.createElement("small", null, React.createElement("i", { className: "fas fa-circle text-primary" })) : null), - React.createElement("small", null, !((_c = JSON.parse(alert === null || alert === void 0 ? void 0 : alert.latest_diff)) === null || _c === void 0 ? void 0 : _c.dictionary_item_added) && !alert.confirmed_data ? 'No data revision yet' : ((_d = JSON.parse(alert.latest_diff)) === null || _d === void 0 ? void 0 : _d.dictionary_item_added) ? 'Pending data revision' : `Last confirmed: ${(_e = new Date(alert.confirmation_date)) === null || _e === void 0 ? void 0 : _e.toLocaleDateString()}`))); + React.createElement("small", null, !(alert === null || alert === void 0 ? void 0 : alert.latest_diff) && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${(_a = new Date(alert.confirmation_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()}`))); })) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert ? React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, onAlertChanged: onAlertChanged, selectedAlert: selectedAlert, cdcs: cdcs }) diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 5cebc70a4..905b4298b 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.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E,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;oBACpG,oBAAoB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAC,EAAE,KAAK,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,EAAC,CAAC;iBAClJ;aACF,GAAI,EACP,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index 8e8f834d7..a26c0d5c2 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -32,14 +32,25 @@ export interface IAlert { id: number; name: string; cdc_id: string; - filter_dump: string; + filter_dump: IFilter; filter_query: string; enable_mail_notification: boolean; - latest_diff: any; - latest_fetched_data: string; + latest_diff: { + dictionary_item_added?: number[]; + dictionary_item_removed?: number[]; + values_changed?: { + key: { + field: string; + id: number; + new_value: string; + old_value: string; + }; + }; + }; + latest_fetched_data: any; latest_compare_date: Date; modification_date: string; - confirmed_data: string; + confirmed_data: any; confirmation_date: Date; } export interface IUploadAlert extends Pick { diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index d40d5bb1e..196b76360 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -34,7 +34,7 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter if (validFilter && validName) { const newAlert = await saveAlert({ ...alertData, - filter_dump: JSON.stringify(filter), + filter_dump: filter, filter_query: getTreeQuery(filter, filterComponents) }).then((alert) => { return runAlert(alert.id).then((a) => { diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index 52b8ec362..e167515a3 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -1,3 +1,4 @@ +import {css} from 'jquery'; import React from 'react'; import Select from 'react-select'; import {accordionItem, runAlert} from '.'; @@ -47,7 +48,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, selectedAlert.id, { ...alertData, - filter_dump: JSON.stringify(filter), + filter_dump: filter, filter_query: getTreeQuery(filter, filterComponents) }).then((alert) => { return runAlert(alert.id).then((a) => { @@ -62,7 +63,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); - setFilter(JSON.parse(selectedAlert.filter_dump)); + setFilter(selectedAlert.filter_dump); }; const onDelete = async (id: number) => { @@ -112,11 +113,74 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, ); const literature = () => { - const data = JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added; - return (<>{data?.length > 0 ? (<> -
    Literature:
    - {data.map((d, i) =>

    {d}

    )} - + const diff = selectedAlert.latest_diff; + // const changedValues: Map = new Map(); + // if (diff.values_changed) { + // const dvc = diff.values_changed; + // Object.keys(dvc).map((key) => { + // const id = dvc[key].id + // if (changedValues.has(id)) { + // changedValues.set(id, [...changedValues.get(id), {field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); + // } else { + // changedValues.set(id, [{field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); + // } + // }); + // } + console.log(diff) + return (<>{diff ? (<> +
    Changed data:
    + + + + + + + + + + + {diff.dictionary_item_added ? + diff.dictionary_item_added.map((d) => { + const data = selectedAlert.latest_fetched_data.find(a => a.id === d); + return ( + + + + + ) + }) : null} + {diff.dictionary_item_removed ? + diff.dictionary_item_removed.map((d) => { + const data = selectedAlert.confirmed_data.find(a => a.id === d); + return ( + + + + + ) + }) : null} + {diff.values_changed ? + Object.keys(diff.values_changed).map((d) => { + const cv = diff.values_changed[d]; + const data = selectedAlert.confirmed_data.find(a => a.id === cv.id); + return ( + {cv.field === 'id' ? : } + {cv.field === 'name' ? : } + {cv.field === 'address.street' ? : } + {cv.field === 'address.zipcode' ? + + : cv.field === 'address.city' ? + + : + } + {/* TODO: zipcode and street not working yet + combine multiple changes from same id*/} + ) + }) : null} + +
    #NameStreetCity
    {data?.id}{data?.name}{data?.address.street}{`${data?.address?.zipcode} ${data?.address?.city}`}
    {data?.id}{data?.name}{data?.address.street}{`${data?.address?.zipcode} ${data?.address?.city}`}
    {cv.old_value} {cv.new_value}{data?.id}{cv.old_value} {cv.new_value}{data?.name}{cv.old_value} {cv.new_value}{data?.address.street}{cv.old_value} {data.address.city} {cv.new_value} {selectedAlert.latest_fetched_data.find(a => a.id === cv.id)?.address.city}{data.address.zipcode} {cv.old_value} {selectedAlert.latest_fetched_data.find(a => a.id === cv.id)?.address.zipcode} {cv.new_value}{`${data?.address?.zipcode} ${data?.address?.city}`}
    +
    + +
    ) : (

    No new data available

    )} @@ -140,7 +204,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, {editButton}
    - {!editMode ? accordionItem(1, `${JSON.parse(selectedAlert.latest_diff)?.dictionary_item_added ? 'Latest revision from: ' + new Date(selectedAlert.latest_compare_date)?.toLocaleDateString() : 'No new data'}`, 'editAlert', literature(), true) : null} + {!editMode ? accordionItem(1, `${selectedAlert.latest_diff ? 'Latest revision from: ' + new Date(selectedAlert.latest_compare_date)?.toLocaleDateString() : 'No new data'}`, 'editAlert', literature(), true) : null} {accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)}
    ); diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 933eb74ba..d552465e4 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -16,7 +16,7 @@ interface ICDCFilterDialogProps { filtersByCDC: {[cdcId: string]: IFilter[]}; } -export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: '', filter_query: ''}; +export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter_dump: null, filter_query: ''}; export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; export const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { @@ -67,7 +67,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial const onAlertClick = async (alert: IAlert) => { setAlertData(alert); - setFilter(JSON.parse(alert.filter_dump)); + setFilter(alert.filter_dump); setCreationMode(false); setSelectedAlert(alert); }; @@ -107,9 +107,9 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial )}
    : null}
    diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index c78d2194f..33482b241 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -83,16 +83,16 @@ export interface IAlert { id: number; name: string; cdc_id: string; - filter_dump: string; + filter_dump: IFilter; filter_query: string; enable_mail_notification: boolean; - latest_diff: any; - latest_fetched_data: string; + latest_diff: {dictionary_item_added?: number[], dictionary_item_removed?: number[], values_changed?: {key: {field: string, id: number, new_value: string, old_value: string}}}; + latest_fetched_data: any; latest_compare_date: Date; modification_date: string; - confirmed_data: string; + confirmed_data: any; confirmation_date: Date; -} +} //TODO: remove any export interface IUploadAlert extends Pick {} diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index c68eaf42c..f99f4f61a 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -1,5 +1,5 @@ -from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, BLOB, PickleType +from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, BLOB, PickleType, JSON from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy.sql.schema import ForeignKey @@ -23,16 +23,16 @@ class CDCAlert(Base): name = Column(TEXT, nullable=False) cdc_id = Column(TEXT, nullable=False) # TODO: Change to JSONB in postgres - filter_dump = Column(PickleType, nullable=False) + filter_dump = Column(JSON, nullable=False) filter_query = Column(TEXT, nullable=False) enable_mail_notification = Column(Boolean, nullable=False) latest_compare_date = Column(DateTime, nullable=True) - latest_diff = Column(PickleType, nullable=True) - latest_fetched_data = Column(PickleType, nullable=True) + latest_diff = Column(JSON, nullable=True) + latest_fetched_data = Column(JSON, nullable=True) confirmation_date = Column(DateTime, nullable=True) # date of confirmation - confirmed_data = Column(PickleType, nullable=True) # your confirmed data + confirmed_data = Column(JSON, nullable=True) # your confirmed data #security creator = Column(TEXT, nullable=False) # NOQA: N815 creation_date = Column(DateTime, nullable=False) # NOQA: N815 @@ -79,6 +79,6 @@ class Meta(CDCAlertSchema.Meta): from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:////:memory:') -#Base.metadata.drop_all(engine) +# Base.metadata.drop_all(engine) Base.metadata.create_all(engine) create_session = sessionmaker(engine) diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py index cfadbc4e9..6b4f67ead 100644 --- a/tdp_core/cdc/CDCManager.py +++ b/tdp_core/cdc/CDCManager.py @@ -4,6 +4,7 @@ from .BaseCDC import BaseCDC from .CDCAlert import CDCAlert import logging +import json _log = logging.getLogger(__name__) @@ -53,8 +54,33 @@ def run_alert(self, alert: CDCAlert): # new_df = new_df.query('name == ["test123", "asdfasdf"] or age > 40 and ...') # Compare confirmed with new entry - diff = cdc.compare(alert.confirmed_data, new) - + diff = json.loads(cdc.compare(alert.confirmed_data, new)) + + if "dictionary_item_removed" in diff: + diff["dictionary_item_removed"] = [int(rm[(rm.find('[') + 1):rm.find(']')]) for rm in diff["dictionary_item_removed"]] + + if "dictionary_item_added" in diff: + diff["dictionary_item_added"] = [int(add[(add.find('[') + 1):add.find(']')]) for add in diff["dictionary_item_added"]] + + if "values_changed" in diff: + keys = diff["values_changed"].keys() + newDict = {} + i = 1 + for key in keys: + newKey = "key" + str(i) + newDict[newKey] = {} + field = key[(key.find('\'') + 1):key.find('\']')] + rest = key[key.find('\']')+1:] + while len(rest) > 2: + field = field + '.' + rest[(rest.find('\'') + 1):rest.find('\']')] + rest = rest[rest.find('\']')+1:] + newDict[newKey]["field"] = field + newDict[newKey]["id"] = int(key[(key.find('[') + 1):key.find(']')]) + newDict[newKey]["new_value"] = diff["values_changed"][key]['new_value'] + newDict[newKey]["old_value"] = diff["values_changed"][key]['old_value'] + i = i + 1 + diff["values_changed"] = newDict + return new, diff def registerCDC(self, cdc: BaseCDC): diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 79f90663c..96869fc75 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -160,6 +160,10 @@ def confirm_alert_by_id(id: str): # TODO: How to confirm this override? alert.confirmation_date = datetime.utcnow() alert.confirmed_data = alert.latest_fetched_data + alert.confirmed_data[1]['name'] = 'Herbert' + alert.confirmed_data[2]['name'] = 'Herbert' + alert.confirmed_data[1]['address']['street'] = 'Dornach' + alert.confirmed_data[2]['address']['city'] = 'Lünz' alert.latest_compare_date = None alert.latest_fetched_data = None From 06577229fee70e45c25e73afb6cabc8b4bfe1e4f Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Thu, 4 Nov 2021 10:53:20 +0100 Subject: [PATCH 19/40] improve deep_diff and visualization of cdc_data in UI --- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.js | 80 +++++++++++++++++----------------- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.js | 2 +- dist/cdc/interface.d.ts | 16 +++---- src/cdc/CDCCreateAlert.tsx | 1 - src/cdc/CDCEditAlert.tsx | 52 +++++++++++----------- src/cdc/CDCFilterDialog.tsx | 2 +- src/cdc/interface.ts | 2 +- tdp_core/cdc/BaseCDC.py | 2 +- tdp_core/cdc/CDCManager.py | 35 ++++++--------- 11 files changed, 92 insertions(+), 104 deletions(-) diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index 6360cf793..8022343cf 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAc1F,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAkB;IACpK,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,cAAc,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,MAAM,IAAG,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;;QACnB,YAAY,CAAC,OAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,IAAI,GAAG,MAAM,IAAG,CAAC,CAAC,CAAC;IACnD,CAAC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EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;wBAC9L,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;YACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3B,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;gBAC3J,CAAC;oBACD,mEAAwC,CAEtC,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index 82d50b997..30b72adf9 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -75,22 +75,22 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("p", null, "No filters available for this cdc")))); const literature = () => { const diff = selectedAlert.latest_diff; - // const changedValues: Map = new Map(); - // if (diff.values_changed) { - // const dvc = diff.values_changed; - // Object.keys(dvc).map((key) => { - // const id = dvc[key].id - // if (changedValues.has(id)) { - // changedValues.set(id, [...changedValues.get(id), {field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); - // } else { - // changedValues.set(id, [{field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); - // } - // }); - // } - console.log(diff); + const change = new Map(); + if (diff === null || diff === void 0 ? void 0 : diff.values_changed) { + const dvc = diff.values_changed; + dvc.map((d) => { + const nestedField = d.field.map((f) => f).join("."); + if (change.has(d.id)) { + change.set(d.id, change.get(d.id).set(nestedField, { old: d.old_value, new: d.new_value })); + } + else { + change.set(d.id, new Map().set(nestedField, { old: d.old_value, new: d.new_value })); + } + }); + } return (React.createElement(React.Fragment, null, diff ? (React.createElement(React.Fragment, null, React.createElement("h6", null, "Changed data:"), - React.createElement("table", { className: "table table-light mt-4" }, + React.createElement("table", { className: "table table-light mt-2" }, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", { scope: "col" }, "#"), @@ -119,45 +119,45 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); }) : null, diff.values_changed ? - Object.keys(diff.values_changed).map((d) => { + [...change.keys()].map((id, i) => { var _a, _b, _c, _d; - const cv = diff.values_changed[d]; - const data = selectedAlert.confirmed_data.find(a => a.id === cv.id); - return (React.createElement("tr", { key: d, className: "table-primary" }, - cv.field === 'id' ? React.createElement("td", null, - React.createElement("s", null, cv.old_value), + const oldData = (_a = selectedAlert.confirmed_data) === null || _a === void 0 ? void 0 : _a.find(a => a.id === id); + const newData = (_b = selectedAlert.latest_fetched_data) === null || _b === void 0 ? void 0 : _b.find(a => a.id === id); + return (React.createElement("tr", { key: i, className: "table-primary" }, + change.get(id).has('id') ? React.createElement("td", null, + React.createElement("s", null, change.get(id).get('id').old), " ", - cv.new_value) : React.createElement("td", null, data === null || data === void 0 ? void 0 : data.id), - cv.field === 'name' ? React.createElement("td", null, - React.createElement("s", null, cv.old_value), + change.get(id).get('id').new) : React.createElement("td", null, oldData.id), + change.get(id).has('name') ? React.createElement("td", null, + React.createElement("s", null, change.get(id).get('name').old), " ", - cv.new_value) : React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), - cv.field === 'address.street' ? React.createElement("td", null, - React.createElement("s", null, cv.old_value), + change.get(id).get('name').new) : React.createElement("td", null, oldData.name), + change.get(id).has('address.street') ? React.createElement("td", null, + React.createElement("s", null, change.get(id).get('address.street').old), " ", - cv.new_value) : React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), - cv.field === 'address.zipcode' ? + change.get(id).get('address.street').new) : React.createElement("td", null, oldData.address.street), + change.get(id).has('address.zipcode') ? React.createElement("td", null, React.createElement("s", null, - cv.old_value, + change.get(id).get('address.zipcode').old, " ", - data.address.city), + oldData.address.city), " ", - cv.new_value, - " ", (_a = selectedAlert.latest_fetched_data.find(a => a.id === cv.id)) === null || _a === void 0 ? void 0 : - _a.address.city) - : cv.field === 'address.city' ? + change.get(id).get('address.zipcode').new, + " ", + newData.address.city) + : change.get(id).has('address.city') ? React.createElement("td", null, React.createElement("s", null, - data.address.zipcode, + oldData.address.zipcode, " ", - cv.old_value), - " ", (_b = selectedAlert.latest_fetched_data.find(a => a.id === cv.id)) === null || _b === void 0 ? void 0 : - _b.address.zipcode, + change.get(id).get('address.city').old), + " ", + newData.address.zipcode, " ", - cv.new_value) + change.get(id).get('address.city').new) : - React.createElement("td", null, `${(_c = data === null || data === void 0 ? void 0 : data.address) === null || _c === void 0 ? void 0 : _c.zipcode} ${(_d = data === null || data === void 0 ? void 0 : data.address) === null || _d === void 0 ? void 0 : _d.city}`))); + React.createElement("td", null, `${(_c = oldData.address) === null || _c === void 0 ? void 0 : _c.zipcode} ${(_d = oldData.address) === null || _d === void 0 ? void 0 : _d.city}`))); }) : null)), React.createElement("div", { className: "d-md-flex justify-content-md-end" }, React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))) : (React.createElement("p", null, "No new data available")))); diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index 4de539c08..21fca19fa 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa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"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index a1d737c61..66fe69e9b 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -16,7 +16,7 @@ export const accordionItem = (index, title, parentId, child, show) => { return (React.createElement("div", { key: index, className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); + React.createElement("div", { id: `collapse${index}`, className: `p-4 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); }; export const runAlert = async (id) => { const runAlert = runAlertById(id).then((alert) => { return alert; }).catch((e) => { diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index a26c0d5c2..18a4f80c6 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -36,16 +36,14 @@ export interface IAlert { filter_query: string; enable_mail_notification: boolean; latest_diff: { - dictionary_item_added?: number[]; - dictionary_item_removed?: number[]; + dictionary_item_added?: string[]; + dictionary_item_removed?: string[]; values_changed?: { - key: { - field: string; - id: number; - new_value: string; - old_value: string; - }; - }; + id: string; + field: []; + old_value: string; + new_value: string; + }[]; }; latest_fetched_data: any; latest_compare_date: Date; diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index 196b76360..f5513c5b4 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -1,6 +1,5 @@ import React from 'react'; import Select from 'react-select'; -import {accordionItem} from '.'; import {runAlert} from '..'; import {saveAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index e167515a3..9f476123c 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -114,22 +114,21 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const literature = () => { const diff = selectedAlert.latest_diff; - // const changedValues: Map = new Map(); - // if (diff.values_changed) { - // const dvc = diff.values_changed; - // Object.keys(dvc).map((key) => { - // const id = dvc[key].id - // if (changedValues.has(id)) { - // changedValues.set(id, [...changedValues.get(id), {field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); - // } else { - // changedValues.set(id, [{field: dvc[key].field, oldValue: dvc[key].old_value, newValue: dvc[key].new_value}]); - // } - // }); - // } - console.log(diff) + const change: Map> = new Map(); + if (diff?.values_changed) { + const dvc = diff.values_changed; + dvc.map((d) => { + const nestedField = d.field.map((f) => f).join("."); + if (change.has(d.id)) { + change.set(d.id, change.get(d.id).set(nestedField, {old: d.old_value, new: d.new_value})); + } else { + change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); + } + }) + } return (<>{diff ? (<>
    Changed data:
    - +
    @@ -160,20 +159,19 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, ) }) : null} {diff.values_changed ? - Object.keys(diff.values_changed).map((d) => { - const cv = diff.values_changed[d]; - const data = selectedAlert.confirmed_data.find(a => a.id === cv.id); - return ( - {cv.field === 'id' ? : } - {cv.field === 'name' ? : } - {cv.field === 'address.street' ? : } - {cv.field === 'address.zipcode' ? - - : cv.field === 'address.city' ? - + [...change.keys()].map((id, i) => { + const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); + const newData = selectedAlert.latest_fetched_data?.find(a => a.id === id); + return ( + {change.get(id).has('id') ? : } + {change.get(id).has('name') ? : } + {change.get(id).has('address.street') ? : } + {change.get(id).has('address.zipcode') ? + + : change.get(id).has('address.city') ? + : - } - {/* TODO: zipcode and street not working yet + combine multiple changes from same id*/} + } ) }) : null} diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index d552465e4..c07e72b57 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -28,7 +28,7 @@ export const accordionItem = (index: number, title: string, parentId: string, ch {title} -
    +
    {child}
    diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index 33482b241..fb70be3e0 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -86,7 +86,7 @@ export interface IAlert { filter_dump: IFilter; filter_query: string; enable_mail_notification: boolean; - latest_diff: {dictionary_item_added?: number[], dictionary_item_removed?: number[], values_changed?: {key: {field: string, id: number, new_value: string, old_value: string}}}; + latest_diff: {dictionary_item_added?: string[], dictionary_item_removed?: string[], values_changed?: {id: string, field: [], old_value: string, new_value: string}[]}; latest_fetched_data: any; latest_compare_date: Date; modification_date: string; diff --git a/tdp_core/cdc/BaseCDC.py b/tdp_core/cdc/BaseCDC.py index ec04bcf8b..d47155bff 100644 --- a/tdp_core/cdc/BaseCDC.py +++ b/tdp_core/cdc/BaseCDC.py @@ -33,7 +33,7 @@ def compare(self, old: List[T], new: List[T]): new = new or [] old_lookup = {self.get_id(item): item for item in old} new_lookup = {self.get_id(item): item for item in new} - return DeepDiff(old_lookup, new_lookup).to_json() + return DeepDiff(old_lookup, new_lookup, view='tree') # @abstractproperty # ? # @property diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py index 6b4f67ead..8f8e1ee19 100644 --- a/tdp_core/cdc/CDCManager.py +++ b/tdp_core/cdc/CDCManager.py @@ -54,33 +54,26 @@ def run_alert(self, alert: CDCAlert): # new_df = new_df.query('name == ["test123", "asdfasdf"] or age > 40 and ...') # Compare confirmed with new entry - diff = json.loads(cdc.compare(alert.confirmed_data, new)) + diff = cdc.compare(alert.confirmed_data, new) if "dictionary_item_removed" in diff: - diff["dictionary_item_removed"] = [int(rm[(rm.find('[') + 1):rm.find(']')]) for rm in diff["dictionary_item_removed"]] + diff["dictionary_item_removed"] = [rm.path(output_format='list')[0] for rm in diff["dictionary_item_removed"]] if "dictionary_item_added" in diff: - diff["dictionary_item_added"] = [int(add[(add.find('[') + 1):add.find(']')]) for add in diff["dictionary_item_added"]] + diff["dictionary_item_added"] = [add.path(output_format='list')[0] for add in diff["dictionary_item_added"]] if "values_changed" in diff: - keys = diff["values_changed"].keys() - newDict = {} - i = 1 - for key in keys: - newKey = "key" + str(i) - newDict[newKey] = {} - field = key[(key.find('\'') + 1):key.find('\']')] - rest = key[key.find('\']')+1:] - while len(rest) > 2: - field = field + '.' + rest[(rest.find('\'') + 1):rest.find('\']')] - rest = rest[rest.find('\']')+1:] - newDict[newKey]["field"] = field - newDict[newKey]["id"] = int(key[(key.find('[') + 1):key.find(']')]) - newDict[newKey]["new_value"] = diff["values_changed"][key]['new_value'] - newDict[newKey]["old_value"] = diff["values_changed"][key]['old_value'] - i = i + 1 - diff["values_changed"] = newDict - + new_values_changed = [] + for changed in diff["values_changed"]: + new_obj = {} + change_path = changed.path(output_format='list') + new_obj["id"] = change_path[0] + new_obj["field"] = change_path[1:len(change_path)] + new_obj["old_value"] = changed.t1 + new_obj["new_value"] = changed.t2 + new_values_changed.append(new_obj) + diff["values_changed"] = new_values_changed + return new, diff def registerCDC(self, cdc: BaseCDC): From db5634d39952d146a32e85e21a81227029534c2d Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Mon, 8 Nov 2021 09:02:54 +0100 Subject: [PATCH 20/40] code improvements --- dist/cdc/CDCEditAlert.js | 51 +++++++++++------------ dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.js | 2 +- dist/cdc/CDCFilterDialog.js.map | 2 +- src/cdc/CDCEditAlert.tsx | 73 +++++++++++++++------------------ src/cdc/CDCFilterDialog.tsx | 2 +- 6 files changed, 61 insertions(+), 71 deletions(-) diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index 30b72adf9..10ca75ee9 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -74,11 +74,10 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, : React.createElement("p", null, "No filters available for this cdc")))); const literature = () => { - const diff = selectedAlert.latest_diff; - const change = new Map(); - if (diff === null || diff === void 0 ? void 0 : diff.values_changed) { - const dvc = diff.values_changed; - dvc.map((d) => { + var _a, _b, _c, _d, _e; + if (selectedAlert.latest_diff) { + const change = new Map(); + (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.values_changed) === null || _b === void 0 ? void 0 : _b.map((d) => { const nestedField = d.field.map((f) => f).join("."); if (change.has(d.id)) { change.set(d.id, change.get(d.id).set(nestedField, { old: d.old_value, new: d.new_value })); @@ -87,19 +86,17 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, change.set(d.id, new Map().set(nestedField, { old: d.old_value, new: d.new_value })); } }); - } - return (React.createElement(React.Fragment, null, diff ? (React.createElement(React.Fragment, null, - React.createElement("h6", null, "Changed data:"), - React.createElement("table", { className: "table table-light mt-2" }, - React.createElement("thead", null, - React.createElement("tr", null, - React.createElement("th", { scope: "col" }, "#"), - React.createElement("th", { scope: "col" }, "Name"), - React.createElement("th", { scope: "col" }, "Street"), - React.createElement("th", { scope: "col" }, "City"))), - React.createElement("tbody", null, - diff.dictionary_item_added ? - diff.dictionary_item_added.map((d) => { + return (React.createElement(React.Fragment, null, + React.createElement("h6", null, "Changed data:"), + React.createElement("table", { className: "table table-light mt-2" }, + React.createElement("thead", null, + React.createElement("tr", null, + React.createElement("th", { scope: "col" }, "#"), + React.createElement("th", { scope: "col" }, "Name"), + React.createElement("th", { scope: "col" }, "Street"), + React.createElement("th", { scope: "col" }, "City"))), + React.createElement("tbody", null, (_c = selectedAlert.latest_diff.dictionary_item_added) === null || _c === void 0 ? void 0 : + _c.map((d) => { var _a, _b; const data = selectedAlert.latest_fetched_data.find(a => a.id === d); return (React.createElement("tr", { key: d, className: "table-success" }, @@ -107,9 +104,8 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); - }) : null, - diff.dictionary_item_removed ? - diff.dictionary_item_removed.map((d) => { + }), (_d = selectedAlert.latest_diff.dictionary_item_removed) === null || _d === void 0 ? void 0 : + _d.map((d) => { var _a, _b; const data = selectedAlert.confirmed_data.find(a => a.id === d); return (React.createElement("tr", { key: d, className: "table-danger" }, @@ -117,9 +113,8 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); - }) : null, - diff.values_changed ? - [...change.keys()].map((id, i) => { + }), (_e = [...change.keys()]) === null || _e === void 0 ? void 0 : + _e.map((id, i) => { var _a, _b, _c, _d; const oldData = (_a = selectedAlert.confirmed_data) === null || _a === void 0 ? void 0 : _a.find(a => a.id === id); const newData = (_b = selectedAlert.latest_fetched_data) === null || _b === void 0 ? void 0 : _b.find(a => a.id === id); @@ -158,9 +153,11 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, change.get(id).get('address.city').new) : React.createElement("td", null, `${(_c = oldData.address) === null || _c === void 0 ? void 0 : _c.zipcode} ${(_d = oldData.address) === null || _d === void 0 ? void 0 : _d.city}`))); - }) : null)), - React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))) : (React.createElement("p", null, "No new data available")))); + }))), + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))); + } + return React.createElement("p", null, "No new data available"); }; const editButton = !editMode && !deleteMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index 21fca19fa..7c5114fb0 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAc1F,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAgB;;IAC9J,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC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C,wBAAwB,UAAG,IAAI,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,0CAAE,kBAAkB,GAAE,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACnN,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAC1E,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 66fe69e9b..74c8b2ce2 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -109,7 +109,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", onClick: () => { - Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlert(alert.id))).then(() => fetchAlerts()); + Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlert(alert.id))).then(() => onAlertChanged(selectedAlert.id)); }, className: "btn btn-secondary" }, "Sync"))))))); } export class CDCFilterDialogClass { diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 905b4298b..2861dcaa2 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,Y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f476123c..dbcd29f27 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -113,53 +113,47 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, ); const literature = () => { - const diff = selectedAlert.latest_diff; - const change: Map> = new Map(); - if (diff?.values_changed) { - const dvc = diff.values_changed; - dvc.map((d) => { + if (selectedAlert.latest_diff) { + const change: Map> = new Map(); + selectedAlert.latest_diff?.values_changed?.map((d) => { const nestedField = d.field.map((f) => f).join("."); if (change.has(d.id)) { change.set(d.id, change.get(d.id).set(nestedField, {old: d.old_value, new: d.new_value})); } else { change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); } - }) - } - return (<>{diff ? (<> -
    Changed data:
    -
    #
    {cv.old_value} {cv.new_value}{data?.id}{cv.old_value} {cv.new_value}{data?.name}{cv.old_value} {cv.new_value}{data?.address.street}{cv.old_value} {data.address.city} {cv.new_value} {selectedAlert.latest_fetched_data.find(a => a.id === cv.id)?.address.city}{data.address.zipcode} {cv.old_value} {selectedAlert.latest_fetched_data.find(a => a.id === cv.id)?.address.zipcode} {cv.new_value}
    {change.get(id).get('id').old} {change.get(id).get('id').new}{oldData.id}{change.get(id).get('name').old} {change.get(id).get('name').new}{oldData.name}{change.get(id).get('address.street').old} {change.get(id).get('address.street').new}{oldData.address.street}{change.get(id).get('address.zipcode').old} {oldData.address.city} {change.get(id).get('address.zipcode').new} {newData.address.city}{oldData.address.zipcode} {change.get(id).get('address.city').old} {newData.address.zipcode} {change.get(id).get('address.city').new}{`${data?.address?.zipcode} ${data?.address?.city}`}{`${oldData.address?.zipcode} ${oldData.address?.city}`}
    - - - - - - - - - - {diff.dictionary_item_added ? - diff.dictionary_item_added.map((d) => { + }); + return (<> +
    Changed data:
    +
    #NameStreetCity
    + + + + + + + + + + {selectedAlert.latest_diff.dictionary_item_added?.map((d) => { const data = selectedAlert.latest_fetched_data.find(a => a.id === d); return ( - ) - }) : null} - {diff.dictionary_item_removed ? - diff.dictionary_item_removed.map((d) => { + ); + })} + {selectedAlert.latest_diff.dictionary_item_removed?.map((d) => { const data = selectedAlert.confirmed_data.find(a => a.id === d); return ( - ) - }) : null} - {diff.values_changed ? - [...change.keys()].map((id, i) => { + ); + })} + {[...change.keys()]?.map((id, i) => { const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); const newData = selectedAlert.latest_fetched_data?.find(a => a.id === id); return ( @@ -172,17 +166,16 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, : } - ) - }) : null} - -
    #NameStreetCity
    {data?.id} {data?.name} {data?.address.street} {`${data?.address?.zipcode} ${data?.address?.city}`}
    {data?.id} {data?.name} {data?.address.street} {`${data?.address?.zipcode} ${data?.address?.city}`}
    {oldData.address.zipcode} {change.get(id).get('address.city').old} {newData.address.zipcode} {change.get(id).get('address.city').new}{`${oldData.address?.zipcode} ${oldData.address?.city}`}
    -
    - -
    - ) : ( -

    No new data available

    - )} - ); + ); + })} + + +
    + +
    + ); + } + return

    No new data available

    ; }; const editButton = !editMode && !deleteMode ? (<> diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index c07e72b57..2dd70f549 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -147,7 +147,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    From e84d3de24e798689c63f38c6f7325da049909eca Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Mon, 8 Nov 2021 14:19:15 +0100 Subject: [PATCH 21/40] add compare_columns to UI --- dist/cdc/CDCCreateAlert.d.ts | 6 +- dist/cdc/CDCCreateAlert.js | 5 +- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.d.ts | 6 +- dist/cdc/CDCEditAlert.js | 108 ++++++++++++-------------------- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterDialog.d.ts | 7 ++- dist/cdc/CDCFilterDialog.js | 19 ++---- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/interface.d.ts | 6 +- dist/cdc/interface.js.map | 2 +- src/cdc/CDCCreateAlert.tsx | 15 ++++- src/cdc/CDCEditAlert.tsx | 78 ++++++++++++++--------- src/cdc/CDCFilterDialog.tsx | 29 +++------ src/cdc/interface.ts | 3 +- tdp_core/cdc/CDCAlert.py | 1 + tdp_core/cdc/CDCManager.py | 32 +++++++++- 17 files changed, 179 insertions(+), 144 deletions(-) diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/CDCCreateAlert.d.ts index 0bc307ef6..b80eede9d 100644 --- a/dist/cdc/CDCCreateAlert.d.ts +++ b/dist/cdc/CDCCreateAlert.d.ts @@ -12,6 +12,10 @@ interface ICDCCreateAlert { onAlertChanged: (id?: number) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; + compareColumnOptions: { + label: string; + value: string; + }[]; } -export declare function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs }: ICDCCreateAlert): JSX.Element; +export declare function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions }: ICDCCreateAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index fd9eb14e4..e9f48236b 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -4,7 +4,7 @@ import { runAlert } from '..'; import { saveAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; -export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs }) { +export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions }) { const [validFilter, setValidFilter] = React.useState(true); const [validName, setValidName] = React.useState(true); React.useEffect(() => { @@ -47,6 +47,9 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "CDC"), React.createElement(Select, { options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), + React.createElement("div", { className: "mb-3 col" }, + React.createElement("label", { className: "form-label" }, "Change Fields"), + React.createElement(Select, { isMulti: true, closeMenuOnSelect: false, options: compareColumnOptions, value: alertData.compare_columns, onChange: (e) => setAlertData({ ...alertData, compare_columns: e }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index 1235727de..3c53bd6d0 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAc1F,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAkB;IACpK,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CA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file diff --git a/dist/cdc/CDCEditAlert.d.ts b/dist/cdc/CDCEditAlert.d.ts index 8858f00c9..fbf887a42 100644 --- a/dist/cdc/CDCEditAlert.d.ts +++ b/dist/cdc/CDCEditAlert.d.ts @@ -12,6 +12,10 @@ interface ICDCEditAlert { onAlertChanged: (id?: number) => void; selectedAlert: IAlert; cdcs: string[]; + compareColumnOptions: { + label: string; + value: string; + }[]; } -export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs }: ICDCEditAlert): JSX.Element; +export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions }: ICDCEditAlert): JSX.Element; export {}; diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index 102045293..dd8713d9b 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -1,10 +1,10 @@ import React from 'react'; import Select from 'react-select'; -import { accordionItem, runAlert } from '.'; +import { runAlert } from '.'; import { confirmAlertById, deleteAlert, editAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; import { getTreeQuery } from './interface'; -export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs }) { +export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions }) { var _a; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); @@ -50,20 +50,38 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, await deleteAlert(id); onAlertChanged(); }; - const generalInformation = (React.createElement(React.Fragment, null, + const getNestedValue = (obj, key) => { + const keys = key.split("."); + let value = obj; + keys.forEach((k) => { + value = value[k]; + }); + return value; + }; + const accordionItem = (index, title, parentId, child, show) => { + parentId = parentId.trim(); + return (React.createElement("div", { key: index, className: "accordion-item" }, + React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), + React.createElement("div", { id: `collapse${index}`, className: `p-4 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); + }; + const generalInformation = React.createElement(React.Fragment, null, React.createElement("div", { className: "row mb-3" }, React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Name"), !editMode ? - React.createElement("p", null, alertData.name) + React.createElement("h6", null, alertData.name) : React.createElement(React.Fragment, null, React.createElement("input", { type: "text", className: `form-control${validName ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }) }), validName ? null : React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!"))), - React.createElement("div", { className: "mb-3 col" }, + React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "CDC"), React.createElement(Select, { isDisabled: !editMode, options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), + React.createElement("div", { className: "mb-3 col pe-2" }, + React.createElement("label", { className: "form-label" }, "Change Fields"), + React.createElement(Select, { isDisabled: !editMode, isMulti: true, closeMenuOnSelect: false, options: compareColumnOptions, value: alertData.compare_columns, onChange: (e) => setAlertData({ ...alertData, compare_columns: e }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, @@ -72,9 +90,9 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("div", null, filterSelection || !filter ? React.createElement(CDCFilterComponent, { filterSelection: !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, disableFilter: !editMode, isInvalid: !validFilter }) : - React.createElement("p", null, "No filters available for this cdc")))); + React.createElement("p", null, "No filters available for this cdc"))); const literature = () => { - var _a, _b, _c, _d, _e; + var _a, _b, _c, _d, _e, _f; if (selectedAlert.latest_diff) { const change = new Map(); (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.values_changed) === null || _b === void 0 ? void 0 : _b.map((d) => { @@ -90,69 +108,25 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("h6", null, "Changed data:"), React.createElement("table", { className: "table table-light mt-2" }, React.createElement("thead", null, - React.createElement("tr", null, - React.createElement("th", { scope: "col" }, "#"), - React.createElement("th", { scope: "col" }, "Name"), - React.createElement("th", { scope: "col" }, "Street"), - React.createElement("th", { scope: "col" }, "City"))), - React.createElement("tbody", null, (_c = selectedAlert.latest_diff.dictionary_item_added) === null || _c === void 0 ? void 0 : - _c.map((d) => { - var _a, _b; - const data = selectedAlert.latest_fetched_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-success" }, - React.createElement("td", null, data === null || data === void 0 ? void 0 : data.id), - React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), - React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), - React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); - }), (_d = selectedAlert.latest_diff.dictionary_item_removed) === null || _d === void 0 ? void 0 : + React.createElement("tr", null, (_c = selectedAlert.compare_columns) === null || _c === void 0 ? void 0 : _c.map((field, i) => React.createElement("th", { key: `header-${i}`, scope: "col" }, field.label)))), + React.createElement("tbody", null, (_d = selectedAlert.latest_diff.dictionary_item_added) === null || _d === void 0 ? void 0 : _d.map((d) => { - var _a, _b; + var _a; + const data = selectedAlert.latest_fetched_data.find(a => a.id === d); + return (React.createElement("tr", { key: d, className: "table-success" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `added-${i}` }, getNestedValue(data, field.value))))); + }), (_e = selectedAlert.latest_diff.dictionary_item_removed) === null || _e === void 0 ? void 0 : + _e.map((d) => { + var _a; const data = selectedAlert.confirmed_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-danger" }, - React.createElement("td", null, data === null || data === void 0 ? void 0 : data.id), - React.createElement("td", null, data === null || data === void 0 ? void 0 : data.name), - React.createElement("td", null, data === null || data === void 0 ? void 0 : data.address.street), - React.createElement("td", null, `${(_a = data === null || data === void 0 ? void 0 : data.address) === null || _a === void 0 ? void 0 : _a.zipcode} ${(_b = data === null || data === void 0 ? void 0 : data.address) === null || _b === void 0 ? void 0 : _b.city}`))); - }), (_e = [...change.keys()]) === null || _e === void 0 ? void 0 : - _e.map((id, i) => { - var _a, _b, _c, _d; + return (React.createElement("tr", { key: d, className: "table-danger" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `removed-${i}` }, getNestedValue(data, field.value))))); + }), (_f = [...change.keys()]) === null || _f === void 0 ? void 0 : + _f.map((id, i) => { + var _a, _b; const oldData = (_a = selectedAlert.confirmed_data) === null || _a === void 0 ? void 0 : _a.find(a => a.id === id); - const newData = (_b = selectedAlert.latest_fetched_data) === null || _b === void 0 ? void 0 : _b.find(a => a.id === id); - return (React.createElement("tr", { key: i, className: "table-primary" }, - change.get(id).has('id') ? React.createElement("td", null, - React.createElement("s", null, change.get(id).get('id').old), - " ", - change.get(id).get('id').new) : React.createElement("td", null, oldData.id), - change.get(id).has('name') ? React.createElement("td", null, - React.createElement("s", null, change.get(id).get('name').old), - " ", - change.get(id).get('name').new) : React.createElement("td", null, oldData.name), - change.get(id).has('address.street') ? React.createElement("td", null, - React.createElement("s", null, change.get(id).get('address.street').old), - " ", - change.get(id).get('address.street').new) : React.createElement("td", null, oldData.address.street), - change.get(id).has('address.zipcode') ? - React.createElement("td", null, - React.createElement("s", null, - change.get(id).get('address.zipcode').old, - " ", - oldData.address.city), - " ", - change.get(id).get('address.zipcode').new, - " ", - newData.address.city) - : change.get(id).has('address.city') ? - React.createElement("td", null, - React.createElement("s", null, - oldData.address.zipcode, - " ", - change.get(id).get('address.city').old), - " ", - newData.address.zipcode, - " ", - change.get(id).get('address.city').new) - : - React.createElement("td", null, `${(_c = oldData.address) === null || _c === void 0 ? void 0 : _c.zipcode} ${(_d = oldData.address) === null || _d === void 0 ? void 0 : _d.city}`))); + return (React.createElement("tr", { key: `tr-changed-${i}`, className: "table-primary" }, (_b = selectedAlert.compare_columns) === null || _b === void 0 ? void 0 : _b.map((field, index) => change.get(id).has(field.value) ? React.createElement("td", { key: `changed-${i}-${index}` }, + React.createElement("s", null, change.get(id).get(field.value).old), + " ", + change.get(id).get(field.value).new) : React.createElement("td", { key: `changed-${i}-${index}` }, getNestedValue(oldData, field.value))))); }))), React.createElement("div", { className: "d-md-flex justify-content-md-end" }, React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))); diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index ecbb6d3ba..6c25727fd 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa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7,6 +7,10 @@ interface ICDCFilterDialogProps { filtersByCDC: { [cdcId: string]: IFilter[]; }; + compareColumnOptions: { + label: string; + value: string; + }[]; } export declare const DEFAULTALERTDATA: IUploadAlert; export declare const DEFAULTFILTER: { @@ -20,9 +24,8 @@ export declare const DEFAULTFILTER: { componentValue: null; children?: IFilter[]; }; -export declare const accordionItem: (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => JSX.Element; export declare const runAlert: (id: number) => Promise; -export declare function CDCFilterDialog({ filterComponents, filtersByCDC }: ICDCFilterDialogProps): JSX.Element; +export declare function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnOptions }: ICDCFilterDialogProps): JSX.Element; export declare class CDCFilterDialogClass { private node; constructor(parent: HTMLElement); diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 211d42816..db1109fbe 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -9,15 +9,8 @@ import { CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter } from import { CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './CDCRangeFilter'; import { CDCCreateAlert } from './CDCCreateAlert'; import { CDCEditAlert } from './CDCEditAlert'; -export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: '' }; +export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: '', compare_columns: null }; export const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true }; -export const accordionItem = (index, title, parentId, child, show) => { - parentId = parentId.trim(); - return (React.createElement("div", { key: index, className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-4 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); -}; export const runAlert = async (id) => { const runAlert = runAlertById(id).then((alert) => { return alert; }).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); @@ -25,7 +18,7 @@ export const runAlert = async (id) => { }); return runAlert; }; -export function CDCFilterDialog({ filterComponents, filtersByCDC }) { +export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnOptions }) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); @@ -101,15 +94,15 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC }) { React.createElement("small", null, !(alert === null || alert === void 0 ? void 0 : alert.latest_diff) && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${(_a = new Date(alert.confirmation_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()}`))); })) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert ? - React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, onAlertChanged: onAlertChanged, selectedAlert: selectedAlert, cdcs: cdcs }) + React.createElement(CDCEditAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterSelection: filtersByCDC['demo'], filterComponents: filterComponents, onAlertChanged: onAlertChanged, selectedAlert: selectedAlert, cdcs: cdcs, compareColumnOptions: compareColumnOptions }) : creationMode ? - React.createElement(CDCCreateAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, cdcs: cdcs }) + React.createElement(CDCCreateAlert, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, cdcs: cdcs, compareColumnOptions: compareColumnOptions }) : null))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", onClick: () => { - Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlert(alert.id))).then(() => onAlertChanged(selectedAlert.id)); + Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlert(alert === null || alert === void 0 ? void 0 : alert.id))).then(() => onAlertChanged(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id)); }, className: "btn btn-secondary" }, "Sync"))))))); } export class CDCFilterDialogClass { @@ -131,7 +124,7 @@ export class CDCFilterDialogClass { createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), createCDCRangeFilter(uuidv4(), 'Range Filter', { config: { minValue: 1, maxValue: 10, label: 'ID', field: `item["id"]` }, value: { min: 1, max: 10 } }), ] - } }), this.node); + }, compareColumnOptions: [{ label: "name", value: "name" }, { label: "street", value: "address.street" }, { label: "zipcode", value: "address.zipcode" }, { label: "city", value: "address.city" }, { label: "id", value: "id" }] }), this.node); } } //# sourceMappingURL=CDCFilterDialog.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 05ed87366..60ed8b54a 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAA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EAAE,KAAK,EAAE,gBAAgB,EAAC,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,mBAAmB,EAAC,EAAE,EAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,sBAAsB,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC;oBACp6B,uBAAuB,CAAC,MAAM,EAAE,EAAE,iBAAiB,EAAE,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;oBACpG,oBAAoB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAC,EAAE,KAAK,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,EAAC,CAAC;iBAClJ;aACF,EACD,oBAAoB,EAAE,CAAC,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAC,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAC,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,GACpN,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts index a38bfdcbe..49386feee 100644 --- a/dist/cdc/interface.d.ts +++ b/dist/cdc/interface.d.ts @@ -50,7 +50,11 @@ export interface IAlert { modification_date: string; confirmed_data: any; confirmation_date: Date; + compare_columns: { + label: string; + value: string; + }[]; } -export interface IUploadAlert extends Pick { +export interface IUploadAlert extends Pick { } export declare function isAlert(obj: IAlert | IUploadAlert): obj is IAlert; diff --git a/dist/cdc/interface.js.map b/dist/cdc/interface.js.map index 6da3c2775..858825a56 100644 --- a/dist/cdc/interface.js.map +++ b/dist/cdc/interface.js.map @@ -1 +1 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/cdc/interface.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE;YACX,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;SAClC;QACD,wCAAwC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;SACF;KACF;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,UAAkD,EAAE,EAAE;;IAClG,IAAI,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CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;SACvE;aAAM;YACL,OAAO,EAAE,CAAC;SACX;KACF;SAAM;QACL,wBAAwB;QACxB,IAAI,WAAW,GAAG,GAAG,CAAC;QACtB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;;YACnC,WAAW,IAAI,GAAG,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;gBACnG,CAAC,CAAC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAK,KAAK;oBAC9B,CAAC,CAAC,SAAS;oBACX,CAAC,OAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,WAAW,EACjC,GAAG;gBACH,CAAC,CAAC,EACF,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;QACH,WAAW,IAAI,GAAG,CAAC;QACnB,OAAO,WAAW,CAAC;KACpB;AACH,CAAC,CAAC;AAoBF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index ceb0a4450..d5704d5d4 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -3,7 +3,7 @@ import Select from 'react-select'; import {runAlert} from '..'; import {saveAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; -import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; +import {getTreeQuery, IFilter, IFilterComponent, IUploadAlert} from './interface'; interface ICDCCreateAlert { alertData: IUploadAlert; @@ -15,9 +15,10 @@ interface ICDCCreateAlert { onAlertChanged: (id?: number) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; + compareColumnOptions: {label: string, value: string}[]; } -export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs}: ICDCCreateAlert) { +export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions}: ICDCCreateAlert) { const [validFilter, setValidFilter] = React.useState(true); const [validName, setValidName] = React.useState(true); @@ -71,6 +72,16 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter onChange={(e) => setAlertData({...alertData, cdc_id: e.value})} />
    +
    + + setAlertData({...alertData, name: e.target.value})} /> {validName ? null : @@ -87,7 +112,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter,
    } }
    -
    +
    setAlertData({...alertData, compare_columns: e as {value: string, label: string}[]})} + /> +
    @@ -110,7 +146,7 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, :

    No filters available for this cdc

    }
    - ); + ; const literature = () => { if (selectedAlert.latest_diff) { @@ -128,44 +164,26 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, - - - - + {selectedAlert.compare_columns?.map((field, i) => )} {selectedAlert.latest_diff.dictionary_item_added?.map((d) => { const data = selectedAlert.latest_fetched_data.find(a => a.id === d); return ( - - - - + {selectedAlert.compare_columns?.map((field, i) => )} ); })} {selectedAlert.latest_diff.dictionary_item_removed?.map((d) => { const data = selectedAlert.confirmed_data.find(a => a.id === d); return ( - - - - + {selectedAlert.compare_columns?.map((field, i) => )} ); })} {[...change.keys()]?.map((id, i) => { const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); - const newData = selectedAlert.latest_fetched_data?.find(a => a.id === id); - return ( - {change.get(id).has('id') ? : } - {change.get(id).has('name') ? : } - {change.get(id).has('address.street') ? : } - {change.get(id).has('address.zipcode') ? - - : change.get(id).has('address.city') ? - - : - } + return ( + {selectedAlert.compare_columns?.map((field, index) => change.get(id).has(field.value) ? : )} ); })} diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 12b89b2bc..eed04dc54 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -14,27 +14,12 @@ import {CDCEditAlert} from './CDCEditAlert'; interface ICDCFilterDialogProps { filterComponents: {[key: string]: IFilterComponent}; filtersByCDC: {[cdcId: string]: IFilter[]}; + compareColumnOptions: {label: string, value: string}[]; } -export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: ''}; +export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: '', compare_columns: null}; export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; -export const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { - parentId = parentId.trim(); - return ( -
    -

    - -

    -
    - {child} -
    -
    - ); -}; - export const runAlert = async (id: number): Promise => { const runAlert = runAlertById(id).then((alert) => {return alert}).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); @@ -43,7 +28,7 @@ export const runAlert = async (id: number): Promise => { return runAlert; }; -export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDialogProps) { +export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOptions}: ICDCFilterDialogProps) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); @@ -125,6 +110,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial onAlertChanged={onAlertChanged} selectedAlert={selectedAlert} cdcs={cdcs} + compareColumnOptions={compareColumnOptions} /> : creationMode ? @@ -138,6 +124,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial onAlertChanged={onAlertChanged} setCreationMode={setCreationMode} cdcs={cdcs} + compareColumnOptions={compareColumnOptions} /> : null } @@ -147,7 +134,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC}: ICDCFilterDial
    @@ -182,7 +169,9 @@ export class CDCFilterDialogClass { createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', {fields: ['Eins', 'zwei', 'dRei'], filter: []}), createCDCRangeFilter(uuidv4(), 'Range Filter', {config: {minValue: 1, maxValue: 10, label: 'ID', field: `item["id"]`}, value: {min: 1, max: 10}}), ] - }} />, + }} + compareColumnOptions={[{label: "name", value: "name"}, {label: "street", value: "address.street"}, {label: "zipcode", value: "address.zipcode"}, {label: "city", value: "address.city"}, {label: "id", value: "id"}]} + />, this.node ); } diff --git a/src/cdc/interface.ts b/src/cdc/interface.ts index f2cb1b41d..a015d7b2e 100644 --- a/src/cdc/interface.ts +++ b/src/cdc/interface.ts @@ -92,9 +92,10 @@ export interface IAlert { modification_date: string; confirmed_data: any; confirmation_date: Date; + compare_columns: {label: string, value: string}[]; } //TODO: remove any -export interface IUploadAlert extends Pick {} +export interface IUploadAlert extends Pick {} export function isAlert(obj: IAlert | IUploadAlert): obj is IAlert { return typeof (obj as any)?.id === 'number'; diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index 756e8766a..eb07d32b6 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -30,6 +30,7 @@ class CDCAlert(Base): latest_compare_date = Column(DateTime, nullable=True) latest_diff = Column(JSON, nullable=True) latest_fetched_data = Column(JSON, nullable=True) + compare_columns = Column(JSON, nullable=True) confirmation_date = Column(DateTime, nullable=True) # date of confirmation confirmed_data = Column(JSON, nullable=True) # your confirmed data diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py index 8f8e1ee19..b5ce5f95a 100644 --- a/tdp_core/cdc/CDCManager.py +++ b/tdp_core/cdc/CDCManager.py @@ -29,10 +29,40 @@ def run_alert(self, alert: CDCAlert): new = cdc.load_data({ # TODO: Define options like username? }) + new = [item for item in new if eval(alert.filter_query)] + + import functools + def rsetattr(obj, attr, val): + pre, _, post = attr.rpartition('.') + return setattr(rgetattr(obj, pre) if pre else obj, post, val) + + def rgetattr(obj, attr, *args): + def _getattr(obj, attr): + # return getattr(obj, attr, *args) + return obj.get(attr, None) + return functools.reduce(_getattr, [obj] + attr.split('.')) + + # fields = [col["value"] for col in alert.compare_columns] + + # for i, item in enumerate(new): + # print("----------------------") + # print("----------------------") + # print(item) + # testii = 'name' + # print(item[testii]) + # print(item.get(testii, None)) + # print("----------------------") + # print("----------------------") + # new_item = {} + # for field in fields: + # rsetattr(new_item, field, rgetattr(item, field)) + + # new[i] = new_item + + # {address: {plz: 'asdf'}} # Filter new entry # '(item["id"] in (4, 5, 6, 7, 8) and not (item["id"] == 5 and item["id"] == 4 or item["id"] == 8)) or ((item["address"]["city"] == "Gwenborough") and (item["id"] > 0 and item["id"] < 5))' - new = [item for item in new if eval(alert.filter_query)] # filter = { From 36ddb11ff58bf2f2580e0a61b781c488666c37d8 Mon Sep 17 00:00:00 2001 From: Markus Vogl Date: Mon, 8 Nov 2021 22:40:49 +0100 Subject: [PATCH 22/40] Unify filters into one class to clear cyclic dependencies Add test method to api with same signature as /alert Adapt schemas --- tdp_core/cdc/CDCAlert.py | 38 ++++------ tdp_core/cdc/api.py | 32 ++++++--- tdp_core/cdc/filter.py | 96 +++++++++++++++++++++++++ tdp_core/cdc/schema/FieldFilterMixin.py | 26 ------- tdp_core/cdc/schema/Filter.py | 34 --------- tdp_core/cdc/schema/Group.py | 20 ------ tdp_core/cdc/schema/Range.py | 11 --- tdp_core/cdc/schema/Text.py | 18 ----- 8 files changed, 130 insertions(+), 145 deletions(-) create mode 100644 tdp_core/cdc/filter.py delete mode 100644 tdp_core/cdc/schema/FieldFilterMixin.py delete mode 100644 tdp_core/cdc/schema/Filter.py delete mode 100644 tdp_core/cdc/schema/Group.py delete mode 100644 tdp_core/cdc/schema/Range.py delete mode 100644 tdp_core/cdc/schema/Text.py diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index eb07d32b6..5f6608270 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -1,12 +1,10 @@ - -from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, BLOB, PickleType, JSON -from sqlalchemy.ext.hybrid import hybrid_property -from sqlalchemy.dialects.postgresql import UUID, JSONB -from sqlalchemy.sql.schema import ForeignKey +from tdp_core.cdc.filter import Filter +from sqlalchemy import Column, Integer, DateTime, TEXT, Boolean, JSON from marshmallow_sqlalchemy import SQLAlchemyAutoSchema -from marshmallow import EXCLUDE, fields +from marshmallow import EXCLUDE, post_load, Schema from sqlalchemy.ext.declarative import declarative_base +from marshmallow import fields Base = declarative_base() @@ -24,7 +22,6 @@ class CDCAlert(Base): cdc_id = Column(TEXT, nullable=False) # TODO: Change to JSONB in postgres filter = Column(JSON, nullable=False) - filter_query = Column(TEXT, nullable=False) enable_mail_notification = Column(Boolean, nullable=False) latest_compare_date = Column(DateTime, nullable=True) @@ -55,25 +52,14 @@ class Meta: unknown = EXCLUDE -class CDCAlertArgsSchema(CDCAlertSchema): - class Meta(CDCAlertSchema.Meta): - load_instance = False - # TODO: Update to include all read-only fields - exclude = ( - 'id', - 'latest_compare_date', - 'latest_diff', - 'latest_fetched_data', - 'confirmation_date', - 'confirmed_data', - # Security fields - 'creator', - 'creation_date', - 'modifier', - 'modification_date', - 'permissions', - 'group' - ) +class CDCAlertArgsSchema(Schema): + id = fields.String() + name = fields.String() + enable_mail_notification = fields.Boolean() + cdc_id = fields.String() + filter = fields.Nested(Filter, required=True) + compare_columns = fields.List(fields.String()) + # TODO: Remove and use postgres from sqlalchemy import create_engine diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 96869fc75..099f9a636 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -1,13 +1,14 @@ +import logging +from datetime import datetime + +import requests +from flask_smorest import Api, Blueprint + from phovea_server.ns import Namespace, abort, no_cache from phovea_server.security import login_required, can_write, can_read, current_username from phovea_server.util import jsonify -from .CDCManager import CDCManager, cdc_manager from .CDCAlert import CDCAlert, CDCAlertSchema, create_session, CDCAlertArgsSchema -from flask_smorest import Api, Blueprint -import logging -import uuid -from datetime import datetime - +from .CDCManager import cdc_manager app = Namespace(__name__) app.config['OPENAPI_VERSION'] = '3.0.2' @@ -58,14 +59,25 @@ def get_alerts(): alerts = session.query(CDCAlert).all() return sorted([p for p in alerts if can_read(p)], key=lambda item: item.id) + +@no_cache +@login_required +@blp.route('/test', methods=["POST"]) +@blp.arguments(CDCAlertArgsSchema) +# @blp.response(CDCAlertSchema, code=200) +def test(data): + users = requests.get('https://jsonplaceholder.typicode.com/users').json() + fusers = data["filter"]["apply"](users) + return jsonify(fusers) + + @no_cache @login_required @blp.route('/alert', methods=["POST"]) -@blp.arguments(CDCAlertArgsSchema(), location='json', description='Create an alert') -@blp.response(CDCAlertSchema(), code=200) +@blp.arguments(CDCAlertArgsSchema) +@blp.response(CDCAlertSchema, code=200) def create_alert(data): session = create_session() - alert = CDCAlertSchema().load(data, partial=True, session=session) # Security alert.creator = current_username() @@ -164,7 +176,7 @@ def confirm_alert_by_id(id: str): alert.confirmed_data[2]['name'] = 'Herbert' alert.confirmed_data[1]['address']['street'] = 'Dornach' alert.confirmed_data[2]['address']['city'] = 'Lünz' - + alert.latest_compare_date = None alert.latest_fetched_data = None alert.latest_diff = None diff --git a/tdp_core/cdc/filter.py b/tdp_core/cdc/filter.py new file mode 100644 index 000000000..242284536 --- /dev/null +++ b/tdp_core/cdc/filter.py @@ -0,0 +1,96 @@ +from re import match +from operator import and_, or_, eq +from functools import reduce +from typing import Dict, Callable, List, Any + +from marshmallow import Schema, post_load, INCLUDE, fields + + +# This class contains all filters to avoid cyclic dependencies +class Filter(Schema): + """ Filter baseclass to delegate to children """ + class Meta: + unknown = INCLUDE + + id = fields.String(required=True) + name = fields.String(required=True) + componentId = fields.String(required=False) # "type" of the filter: group, checkbox, text... + + @post_load() + def _postload(self, data, **_) -> Callable: + """ Call a postload function in every sub-class """ + return self.postload(data, **data) + + # noinspection PyMethodMayBeStatic + def postload(self, data, componentId, **_) -> Callable: + """ Delegate to a subclass based on componentId field """ + filters = {f.__name__.lower(): f for f in Filter.__subclasses__()} + assert componentId in filters, f"Error: Filter type {componentId} doesn't exist in {filters.values()}" + sub_cls = filters[componentId] + data["filt"] = sub_cls().load(data) + data["apply"] = lambda items: list(filter(data["filt"], items)) + return data + + +class FieldFilterMixin: + """ Mixin for filters that access a field in the input-data. + Supports simple attributes, sub.attributes or indexed[0], as as well as .len """ + field = fields.String(required=True) + + @staticmethod + def access(item, field) -> Any: + for field_name in field.split("."): + assert not field_name.startswith("_"), "Private access detected." + + # get array-calls + m = match("(.*)\[(.*)\\]", field) + if m: + field_name, field_idx = m.groups() + item = getattr(item, field_name).__getitem__(field_idx) + elif field_name == "len": + item = len(item) + else: + item = item.get(field_name) + return item + + + +ALLOWED_OPERATORS = {"AND": and_, "OR": or_} +class Group(Filter): + operator = fields.String(required=True, validate=lambda o: o in ALLOWED_OPERATORS) + children = fields.Nested(Filter, many=True) + + # noinspection PyMethodMayBeStatic + def postload(self, data, children, operator, **_): + if not children: + return lambda _: True + children = [Filter().load(child)["filt"] for child in children] + op = ALLOWED_OPERATORS[operator] + return lambda d: reduce(op, [child(d) for child in children]) + + +class Range(Filter, FieldFilterMixin): + min = fields.Number() + max = fields.Number() + + # noinspection PyMethodMayBeStatic + def postload(self, data, field, min, max, **_): + return lambda item: min <= FieldFilterMixin.access(item, field) <= max + + +class Text(Filter, FieldFilterMixin): + """ Filter for textfields to match """ + values = fields.List(fields.String(), required=True) + match_case = fields.Boolean(required=False, missing=False) + match_exact = fields.Boolean(required=False, missing=False) + + # noinspection PyMethodMayBeStatic + def postload(self, data, field, values, match_case, match_exact, **_): + compare = eq if match_exact else str.__contains__ + if match_case: + compare = compare(b.lower(), a.lower()) + return lambda item: any(compare(FieldFilterMixin.access(item, field), value) for value in values) + + +class Checkbox(Filter): + """ TODO: not sure for what? """ diff --git a/tdp_core/cdc/schema/FieldFilterMixin.py b/tdp_core/cdc/schema/FieldFilterMixin.py deleted file mode 100644 index a9ffc8fa2..000000000 --- a/tdp_core/cdc/schema/FieldFilterMixin.py +++ /dev/null @@ -1,26 +0,0 @@ -from re import match -from typing import Any - -from marshmallow.fields import String - - -class FieldFilterMixin: - """ Mixin for filters that access a field in the input-data. - Supports simple attributes, sub.attributes or indexed[0], as as well as .len """ - field = String(required=True) - - @staticmethod - def access(item, field) -> Any: - for field_name in field.split("."): - assert not field_name.startswith("_"), "Private access detected." - - # get array-calls - m = match("(.*)\[(.*)\\]", field) - if m: - field_name, field_idx = m.groups() - item = getattr(item, field_name).__getitem__(field_idx) - elif field_name == "len": - item = len(item) - else: - item = item.get(field_name) - return item diff --git a/tdp_core/cdc/schema/Filter.py b/tdp_core/cdc/schema/Filter.py deleted file mode 100644 index f6fd4f210..000000000 --- a/tdp_core/cdc/schema/Filter.py +++ /dev/null @@ -1,34 +0,0 @@ -from typing import Dict, Callable, List - -from marshmallow import Schema, post_load, INCLUDE -from marshmallow.fields import String - -FILTERS = {f.__name__.lower(): f for f in Filter.__subclasses__()} # dict from classes - - -class Filter(Schema): - """ Filter baseclass to delegate to children """ - - class Meta: - unknown = INCLUDE - - id = String(required=True) - name = String(required=True) - type = String(required=True) - - @post_load() - def _postload(self, data, **kwargs) -> Callable: - """ Call a postload function in every sub-class """ - return self.postload(data, **data) - - def postload(self, data, type, **_) -> Callable: - """ Delegate to a subclass based on name/type field """ - assert type in FILTERS, f"Error: Filter type {type} doesn't exist in {FILTERS.values()}" - sub_cls = FILTERS[type] - return sub_cls().load(data) - - @staticmethod - def apply(items, filt) -> List[Dict]: - """ Apply a filter """ - filt = Filter().load(filt) - return list(filter(filt, items)) diff --git a/tdp_core/cdc/schema/Group.py b/tdp_core/cdc/schema/Group.py deleted file mode 100644 index ce1077f34..000000000 --- a/tdp_core/cdc/schema/Group.py +++ /dev/null @@ -1,20 +0,0 @@ -import operator -from functools import reduce - -from marshmallow import fields -from marshmallow.fields import String - -from . import FieldFilterMixin, Filter - -ALLOWED_OPERATORS = {"and": operator.and_, "or": operator.or_} - - -class Group(Filter, FieldFilterMixin): - operator = String(required=True, validate=lambda o: o in ALLOWED_OPERATORS) - children = fields.List(fields.Dict) - - def postload(self, data, children, operator, **_): - if not children: - return lambda _: True - children = [Filter().load(child) for child in children] - return lambda d: reduce(ALLOWED_OPERATORS[operator], [child(d) for child in children]) diff --git a/tdp_core/cdc/schema/Range.py b/tdp_core/cdc/schema/Range.py deleted file mode 100644 index 4e7a08b3b..000000000 --- a/tdp_core/cdc/schema/Range.py +++ /dev/null @@ -1,11 +0,0 @@ -from marshmallow.fields import String, Number - -from . import FieldFilterMixin, Filter - -class Range(Filter, FieldFilterMixin): - field = String(required=True, validate=lambda s: not s.startswith("_") and not "._" in s) - min = Number() - max = Number() - - def postload(self, data, field, min, max, **_): - return lambda item: min < FieldFilter.access(item, field) < max diff --git a/tdp_core/cdc/schema/Text.py b/tdp_core/cdc/schema/Text.py deleted file mode 100644 index 19635d920..000000000 --- a/tdp_core/cdc/schema/Text.py +++ /dev/null @@ -1,18 +0,0 @@ -import operator - -from marshmallow.fields import String, Boolean - -from . import Filter, FieldFilterMixin - - -class Text(Filter, FieldFilterMixin): - """ Filter for textfields to match """ - value = String(required=True) - match_case = Boolean(required=False, missing=False) - match_exact = Boolean(required=False, missing=False) - - def postload(self, data, field, value, match_case, match_exact, **_): - compare = operator.eq if match_exact else str.__contains__ - if match_case: - compare = lambda a, b: print(a, b) # compare(b.lower(), a.lower()) - return lambda item: compare(FieldFilter.access(item, field), value) From d3078e5681515228799b9fe577d6138b4e0802eb Mon Sep 17 00:00:00 2001 From: Markus Vogl Date: Tue, 9 Nov 2021 10:41:36 +0100 Subject: [PATCH 23/40] Add checckbox filter Fix errors/warnings, add typing info --- tdp_core/cdc/filter.py | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/tdp_core/cdc/filter.py b/tdp_core/cdc/filter.py index 242284536..b5990435c 100644 --- a/tdp_core/cdc/filter.py +++ b/tdp_core/cdc/filter.py @@ -1,14 +1,15 @@ -from re import match -from operator import and_, or_, eq from functools import reduce -from typing import Dict, Callable, List, Any +from operator import and_, or_, eq +from re import match +from typing import Dict, List, Any from marshmallow import Schema, post_load, INCLUDE, fields -# This class contains all filters to avoid cyclic dependencies +# This method contains all filter classes to avoid cyclic dependencies class Filter(Schema): """ Filter baseclass to delegate to children """ + class Meta: unknown = INCLUDE @@ -17,12 +18,11 @@ class Meta: componentId = fields.String(required=False) # "type" of the filter: group, checkbox, text... @post_load() - def _postload(self, data, **_) -> Callable: + def _postload(self, data: Dict, **_) -> Dict: """ Call a postload function in every sub-class """ return self.postload(data, **data) - # noinspection PyMethodMayBeStatic - def postload(self, data, componentId, **_) -> Callable: + def postload(self, data: Dict, componentId: str, **_) -> Dict: """ Delegate to a subclass based on componentId field """ filters = {f.__name__.lower(): f for f in Filter.__subclasses__()} assert componentId in filters, f"Error: Filter type {componentId} doesn't exist in {filters.values()}" @@ -38,12 +38,12 @@ class FieldFilterMixin: field = fields.String(required=True) @staticmethod - def access(item, field) -> Any: + def access(item, field: str) -> Any: for field_name in field.split("."): assert not field_name.startswith("_"), "Private access detected." # get array-calls - m = match("(.*)\[(.*)\\]", field) + m = match(r"(.*)\[(.*)\\]", field) if m: field_name, field_idx = m.groups() item = getattr(item, field_name).__getitem__(field_idx) @@ -54,14 +54,15 @@ def access(item, field) -> Any: return item - ALLOWED_OPERATORS = {"AND": and_, "OR": or_} + + class Group(Filter): operator = fields.String(required=True, validate=lambda o: o in ALLOWED_OPERATORS) children = fields.Nested(Filter, many=True) - # noinspection PyMethodMayBeStatic - def postload(self, data, children, operator, **_): + # noinspection PyMethodOverriding + def postload(self, data: Dict, children: List, operator: str, **_): if not children: return lambda _: True children = [Filter().load(child)["filt"] for child in children] @@ -73,8 +74,8 @@ class Range(Filter, FieldFilterMixin): min = fields.Number() max = fields.Number() - # noinspection PyMethodMayBeStatic - def postload(self, data, field, min, max, **_): + # noinspection PyMethodOverriding, PyShadowingBuiltins + def postload(self, data, field: str, min: float, max: float, **_): return lambda item: min <= FieldFilterMixin.access(item, field) <= max @@ -84,13 +85,18 @@ class Text(Filter, FieldFilterMixin): match_case = fields.Boolean(required=False, missing=False) match_exact = fields.Boolean(required=False, missing=False) - # noinspection PyMethodMayBeStatic - def postload(self, data, field, values, match_case, match_exact, **_): + # noinspection PyMethodOverriding + def postload(self, data: Dict, field: str, values: List[str], match_case: bool, match_exact: bool, **_): compare = eq if match_exact else str.__contains__ if match_case: - compare = compare(b.lower(), a.lower()) + compare = lambda a, b: compare(b.lower(), a.lower()) # nopep8 # ignore lambda assign return lambda item: any(compare(FieldFilterMixin.access(item, field), value) for value in values) class Checkbox(Filter): - """ TODO: not sure for what? """ + values = fields.Dict(fields.String(), fields.Boolean(), required=True) + + # noinspection PyMethodOverriding + def postload(self, data, values: Dict[str, bool], **_): + return lambda item: all([FieldFilterMixin.access(item, key) == value + for key, value in values.items()]) From 281602c11e8430cab7575211c5c356913dfde32e Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Tue, 9 Nov 2021 13:01:59 +0100 Subject: [PATCH 24/40] align filter-components that they fit the new backend implementation --- dist/cdc/CDCCheckboxFilter.d.ts | 11 +- dist/cdc/CDCCheckboxFilter.js | 28 ++--- dist/cdc/CDCCheckboxFilter.js.map | 2 +- dist/cdc/CDCCreateAlert.d.ts | 7 +- dist/cdc/CDCCreateAlert.js | 8 +- dist/cdc/CDCCreateAlert.js.map | 2 +- dist/cdc/CDCEditAlert.d.ts | 7 +- dist/cdc/CDCEditAlert.js | 24 ++--- dist/cdc/CDCEditAlert.js.map | 2 +- dist/cdc/CDCFilterComponent.d.ts | 7 +- dist/cdc/CDCFilterComponent.js | 15 ++- dist/cdc/CDCFilterComponent.js.map | 2 +- dist/cdc/CDCFilterDialog.d.ts | 18 ++-- dist/cdc/CDCFilterDialog.js | 21 ++-- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CDCGroupingFilter.d.ts | 4 +- dist/cdc/CDCGroupingFilter.js | 8 +- dist/cdc/CDCGroupingFilter.js.map | 2 +- dist/cdc/CDCRangeFilter.d.ts | 7 +- dist/cdc/CDCRangeFilter.js | 22 ++-- dist/cdc/CDCRangeFilter.js.map | 2 +- dist/cdc/CDCTextFilter.d.ts | 29 ++---- dist/cdc/CDCTextFilter.js | 70 +++---------- dist/cdc/CDCTextFilter.js.map | 2 +- dist/cdc/DropZone.d.ts | 2 +- dist/cdc/DropZone.js | 2 +- dist/cdc/DropZone.js.map | 2 +- dist/cdc/FilterCard.d.ts | 12 ++- dist/cdc/FilterCard.js | 28 ++--- dist/cdc/FilterCard.js.map | 2 +- dist/cdc/api.d.ts | 2 +- dist/cdc/interfaces.d.ts | 56 ++++++++++ dist/cdc/interfaces.js | 28 +++++ dist/cdc/interfaces.js.map | 1 + src/cdc/CDCCheckboxFilter.tsx | 39 +++---- src/cdc/CDCCreateAlert.tsx | 19 ++-- src/cdc/CDCEditAlert.tsx | 31 ++---- src/cdc/CDCFilterComponent.tsx | 18 +++- src/cdc/CDCFilterDialog.tsx | 26 ++--- src/cdc/CDCGroupingFilter.tsx | 10 +- src/cdc/CDCRangeFilter.tsx | 30 +++--- src/cdc/CDCTextFilter.tsx | 133 +++++------------------- src/cdc/DropZone.tsx | 2 +- src/cdc/FilterCard.tsx | 39 ++++--- src/cdc/api.ts | 2 +- src/cdc/{interface.ts => interfaces.ts} | 81 +++++++-------- tdp_core/cdc/BaseCDC.py | 4 +- tdp_core/cdc/CDCManager.py | 44 +++----- tdp_core/cdc/schema/FieldFilterMixin.py | 7 +- 49 files changed, 418 insertions(+), 504 deletions(-) create mode 100644 dist/cdc/interfaces.d.ts create mode 100644 dist/cdc/interfaces.js create mode 100644 dist/cdc/interfaces.js.map rename src/cdc/{interface.ts => interfaces.ts} (58%) diff --git a/dist/cdc/CDCCheckboxFilter.d.ts b/dist/cdc/CDCCheckboxFilter.d.ts index 7be408bee..51a4fb84a 100644 --- a/dist/cdc/CDCCheckboxFilter.d.ts +++ b/dist/cdc/CDCCheckboxFilter.d.ts @@ -1,15 +1,16 @@ /// -import { IFilter, IFilterComponent } from './interface'; +import { IFilter, IFilterComponent } from './interfaces'; interface ICDCCheckboxFilterValue { - fields: string[]; - filter: string[]; + [field: string]: boolean; } export declare const CDCCheckboxFilterId = "checkbox"; export declare const CDCCheckboxFilter: IFilterComponent; -export declare function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter; -export declare function CDCCheckboxFilterComponent({ value, onValueChanged, disabled }: { +export declare function createCDCCheckboxFilter(id: string, value: ICDCCheckboxFilterValue): IFilter; +export declare function CDCCheckboxFilterComponent({ value, onValueChanged, disabled, config, field }: { value: any; onValueChanged: any; disabled: any; + config: any; + field: any; }): JSX.Element; export {}; diff --git a/dist/cdc/CDCCheckboxFilter.js b/dist/cdc/CDCCheckboxFilter.js index a0200190e..30655feb7 100644 --- a/dist/cdc/CDCCheckboxFilter.js +++ b/dist/cdc/CDCCheckboxFilter.js @@ -2,34 +2,24 @@ import * as React from 'react'; export const CDCCheckboxFilterId = 'checkbox'; export const CDCCheckboxFilter = { clazz: CDCCheckboxFilterComponent, - toFilter: CDCCheckboxFilterToString + disableDropping: true }; -export function createCDCCheckboxFilter(id, name, value) { +export function createCDCCheckboxFilter(id, value) { return { id, - name, - disableDropping: true, - componentId: CDCCheckboxFilterId, - componentValue: value + type: CDCCheckboxFilterId, + value: value }; } -function CDCCheckboxFilterToString(value) { - // Generate filter from value - return `(${value === null || value === void 0 ? void 0 : value.fields.map((v) => { return `${v} == ${value.filter.filter((f) => f === v).length > 0}`; }).join(' and ')})`; -} -//checkbox1 == true and checkbox2 == false and item["address"] == true -export function CDCCheckboxFilterComponent({ value, onValueChanged, disabled }) { - return React.createElement(React.Fragment, null, value.fields.map((v, i) => { +export function CDCCheckboxFilterComponent({ value, onValueChanged, disabled, config, field }) { + return React.createElement(React.Fragment, null, Object.entries(value).map(([field, flag], i) => { return (React.createElement("div", { key: i, className: "input-group m-1" }, React.createElement("div", { className: "form-check" }, - React.createElement("input", { className: "form-check-input", type: "checkbox", id: "flexCheckDefault", checked: value.filter.filter((f) => f === v).length > 0, disabled: !onValueChanged || disabled, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ + React.createElement("input", { className: "form-check-input", type: "checkbox", id: "flexCheckDefault", checked: flag ? true : false, disabled: !onValueChanged || disabled, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, - fields: value.fields, - filter: value.filter.filter((f) => f === v).length > 0 - ? value.filter.filter((f) => f !== v) - : [...value.filter, v] + [field]: e }) }), - React.createElement("label", { className: "form-check-label", htmlFor: "flexCheckDefault" }, v)))); + React.createElement("label", { className: "form-check-label", htmlFor: "flexCheckDefault" }, field)))); })); } //# sourceMappingURL=CDCCheckboxFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CDCCheckboxFilter.js.map b/dist/cdc/CDCCheckboxFilter.js.map index 5fb7ba72b..7cd8944fa 100644 --- a/dist/cdc/CDCCheckboxFilter.js.map +++ b/dist/cdc/CDCCheckboxFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,yBAAyB;CACpC,CAAC;AAEF,MAAM,UAAU,uBAA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K,SAAS,EAAC,YAAY;gBACzB,+BACE,SAAS,EAAC,kBAAkB,EAC5B,IAAI,EAAC,UAAU,EACf,EAAE,EAAC,kBAAkB,EACrB,OAAO,EAAE,IAAI,CAAA,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAC3B,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;wBACf,GAAG,KAAK;wBACR,CAAC,KAAK,CAAC,EAAE,CAAC;qBACX,CAAC,GACJ;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,KAAK,CACA,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/CDCCreateAlert.d.ts index b80eede9d..a8250adc3 100644 --- a/dist/cdc/CDCCreateAlert.d.ts +++ b/dist/cdc/CDCCreateAlert.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter, IFilterComponent, IUploadAlert } from './interface'; +import { IFilter, IFilterComponent, IUploadAlert } from './interfaces'; interface ICDCCreateAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; @@ -7,7 +7,10 @@ interface ICDCCreateAlert { filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: { - [key: string]: IFilterComponent; + [key: string]: { + component: IFilterComponent; + config?: any; + }; }; onAlertChanged: (id?: number) => void; setCreationMode: (mode: boolean) => void; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/CDCCreateAlert.js index e9f48236b..cfe7fe3ef 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/CDCCreateAlert.js @@ -3,7 +3,6 @@ import Select from 'react-select'; import { runAlert } from '..'; import { saveAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; -import { getTreeQuery } from './interface'; export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions }) { const [validFilter, setValidFilter] = React.useState(true); const [validName, setValidName] = React.useState(true); @@ -16,11 +15,8 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte }, [alertData.name]); const onSave = async () => { if (validFilter && validName) { - const newAlert = await saveAlert({ - ...alertData, - filter, - filter_query: getTreeQuery(filter, filterComponents) - }).then((alert) => { + const newAlert = await saveAlert({ ...alertData, filter }) + .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; }); diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map index 3c53bd6d0..3944fbf62 100644 --- a/dist/cdc/CDCCreateAlert.js.map +++ b/dist/cdc/CDCCreateAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAA0C,MAAM,aAAa,CAAC;AAelF,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAE,oBAAoB,EAAkB;IAC1L,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IA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AAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;gBAC3J,CAAC;oBACD,mEAAwC,CAEtC,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.d.ts b/dist/cdc/CDCEditAlert.d.ts index fbf887a42..c8bc61c7c 100644 --- a/dist/cdc/CDCEditAlert.d.ts +++ b/dist/cdc/CDCEditAlert.d.ts @@ -1,5 +1,5 @@ /// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interface'; +import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interfaces'; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; @@ -7,7 +7,10 @@ interface ICDCEditAlert { filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: { - [key: string]: IFilterComponent; + [key: string]: { + component: IFilterComponent; + config?: any; + }; }; onAlertChanged: (id?: number) => void; selectedAlert: IAlert; diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js index dd8713d9b..a8e091afe 100644 --- a/dist/cdc/CDCEditAlert.js +++ b/dist/cdc/CDCEditAlert.js @@ -1,9 +1,9 @@ +import get from 'lodash.get'; import React from 'react'; import Select from 'react-select'; import { runAlert } from '.'; import { confirmAlertById, deleteAlert, editAlert } from './api'; import { CDCFilterComponent } from './CDCFilterComponent'; -import { getTreeQuery } from './interface'; export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions }) { var _a; const [editMode, setEditMode] = React.useState(false); @@ -27,11 +27,8 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, }; const onSave = async () => { if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, { - ...alertData, - filter, - filter_query: getTreeQuery(filter, filterComponents) - }).then((alert) => { + const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter }) + .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; }); @@ -50,14 +47,6 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, await deleteAlert(id); onAlertChanged(); }; - const getNestedValue = (obj, key) => { - const keys = key.split("."); - let value = obj; - keys.forEach((k) => { - value = value[k]; - }); - return value; - }; const accordionItem = (index, title, parentId, child, show) => { parentId = parentId.trim(); return (React.createElement("div", { key: index, className: "accordion-item" }, @@ -65,6 +54,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), React.createElement("div", { id: `collapse${index}`, className: `p-4 accordion-collapse collapse${show ? ' show' : ''}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); }; + console.log(selectedAlert.latest_diff); const generalInformation = React.createElement(React.Fragment, null, React.createElement("div", { className: "row mb-3" }, React.createElement("div", { className: "mb-3 col" }, @@ -113,12 +103,12 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, _d.map((d) => { var _a; const data = selectedAlert.latest_fetched_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-success" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `added-${i}` }, getNestedValue(data, field.value))))); + return (React.createElement("tr", { key: d, className: "table-success" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `added-${i}` }, get(data, field.value))))); }), (_e = selectedAlert.latest_diff.dictionary_item_removed) === null || _e === void 0 ? void 0 : _e.map((d) => { var _a; const data = selectedAlert.confirmed_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-danger" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `removed-${i}` }, getNestedValue(data, field.value))))); + return (React.createElement("tr", { key: d, className: "table-danger" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `removed-${i}` }, get(data, field.value))))); }), (_f = [...change.keys()]) === null || _f === void 0 ? void 0 : _f.map((id, i) => { var _a, _b; @@ -126,7 +116,7 @@ export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, return (React.createElement("tr", { key: `tr-changed-${i}`, className: "table-primary" }, (_b = selectedAlert.compare_columns) === null || _b === void 0 ? void 0 : _b.map((field, index) => change.get(id).has(field.value) ? React.createElement("td", { key: `changed-${i}-${index}` }, React.createElement("s", null, change.get(id).get(field.value).old), " ", - change.get(id).get(field.value).new) : React.createElement("td", { key: `changed-${i}-${index}` }, getNestedValue(oldData, field.value))))); + change.get(id).get(field.value).new) : React.createElement("td", { key: `changed-${i}-${index}` }, get(oldData, field.value))))); }))), React.createElement("div", { className: "d-md-flex justify-content-md-end" }, React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))); diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map index 6c25727fd..21a004e64 100644 --- a/dist/cdc/CDCEditAlert.js.map +++ b/dist/cdc/CDCEditAlert.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAkD,MAAM,aAAa,CAAC;AAe1F,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE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CAAC,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACnN,aAAa,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAC1E,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.d.ts b/dist/cdc/CDCFilterComponent.d.ts index 299b3a943..4aef36125 100644 --- a/dist/cdc/CDCFilterComponent.d.ts +++ b/dist/cdc/CDCFilterComponent.d.ts @@ -1,11 +1,14 @@ import React from 'react'; -import { IFilter, IFilterComponent } from './interface'; +import { IFilter, IFilterComponent } from './interfaces'; interface ICDCFilterComponentProps { filterSelection?: IFilter[]; filter: IFilter; setFilter: React.Dispatch>; filterComponents: { - [key: string]: IFilterComponent; + [key: string]: { + component: IFilterComponent; + config?: any; + }; }; disableFilter?: boolean; isInvalid?: boolean; diff --git a/dist/cdc/CDCFilterComponent.js b/dist/cdc/CDCFilterComponent.js index d2b5f6756..8521bfda6 100644 --- a/dist/cdc/CDCFilterComponent.js +++ b/dist/cdc/CDCFilterComponent.js @@ -3,7 +3,7 @@ import React from 'react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import { FilterCard } from './FilterCard'; -import { getFilterFromTree } from './interface'; +import { getFilterFromTree } from './interfaces'; import { v4 as uuidv4 } from 'uuid'; export function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }) { const onDelete = (newFilter) => { @@ -67,14 +67,23 @@ export function CDCFilterComponent({ filterSelection, filter, setFilter, filterC }; const onValueChanged = (filter, value) => { onChange(filter, (f) => { - f.componentValue = value; + f.value = value; }); }; + const onFieldChanged = (filter, field) => { + console.log(field, filter); + onChange(filter, (f) => { + f.field = field; + }); + }; + if (filter.type !== 'group') { + throw Error('First filter always has to be a group filter'); + } return (React.createElement(DndProvider, { backend: HTML5Backend }, React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "Your filters"), - React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged, filterComponents: filterComponents, disableFilter: disableFilter, isInvalid: isInvalid })), + React.createElement(FilterCard, { filter: filter, onDrop: onDrop, onDelete: onDelete, onChange: onChange, onValueChanged: onValueChanged, onFieldChanged: onFieldChanged, filterComponents: filterComponents, disableFilter: disableFilter, isInvalid: isInvalid })), filterSelection ? React.createElement("div", { className: "col-md" }, React.createElement("h6", null, "New filters"), diff --git a/dist/cdc/CDCFilterComponent.js.map b/dist/cdc/CDCFilterComponent.js.map index 9d9f6c041..0fcea0f0d 100644 --- a/dist/cdc/CDCFilterComponent.js.map +++ b/dist/cdc/CDCFilterComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAA4B,MAAM,aAAa,CAAC;AACzE,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAWlC,MAAM,UAAU,kBAAkB,CAAC,EAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAA2B;IAC3I,MAAM,QAAQ,GAAG,CAAC,SAAkB,EAAE,EAAE;QACtC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;YACnD,MAAM,EAAC,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CFilterDialog.d.ts @@ -1,8 +1,11 @@ /// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interface'; +import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interfaces'; interface ICDCFilterDialogProps { filterComponents: { - [key: string]: IFilterComponent; + [key: string]: { + component: IFilterComponent; + config?: any; + }; }; filtersByCDC: { [cdcId: string]: IFilter[]; @@ -14,14 +17,11 @@ interface ICDCFilterDialogProps { } export declare const DEFAULTALERTDATA: IUploadAlert; export declare const DEFAULTFILTER: { - disableDragging: boolean; - disableRemoving: boolean; id: string; - name: string; - disableDropping?: boolean; - operator?: "AND" | "OR" | "NOT"; - componentId: string; - componentValue: null; + operator?: "AND" | "OR"; + type: string; + value?: any; + field?: string; children?: IFilter[]; }; export declare const runAlert: (id: number) => Promise; diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index db1109fbe..5237dde38 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -9,8 +9,8 @@ import { CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter } from import { CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './CDCRangeFilter'; import { CDCCreateAlert } from './CDCCreateAlert'; import { CDCEditAlert } from './CDCEditAlert'; -export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: '', compare_columns: null }; -export const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true }; +export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, compare_columns: null }; +export const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4()) }; export const runAlert = async (id) => { const runAlert = runAlertById(id).then((alert) => { return alert; }).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); @@ -55,6 +55,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnO } }).catch((e) => console.error(e)); }; + console.log(filter); return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), @@ -113,16 +114,16 @@ export class CDCFilterDialogClass { } init() { ReactDOM.render(React.createElement(CDCFilterDialog, { filterComponents: { - [CDCGroupingFilterId]: CDCGroupingFilter, - [CDCTextFilterId]: CDCTextFilter, - [CDCCheckboxFilterId]: CDCCheckboxFilter, - [CDCRangeFilterId]: CDCRangeFilter + [CDCGroupingFilterId]: { component: CDCGroupingFilter }, + [CDCTextFilterId]: { component: CDCTextFilter, config: [{ field: 'address.city', options: ['Gwenborough', 'Wisokyburgh', 'McKenziehaven', 'Roscoeview', 'Aliyaview', 'Howemouth'] }, { field: 'address.zipcode', options: ['33263', '23505-1337', '58804-1099'] }, { field: 'name', options: ['Leanne Graham', 'Ervin Howell', 'Glenna Reichert', 'Clementina DuBuque'] }] }, + [CDCCheckboxFilterId]: { component: CDCCheckboxFilter, config: { fields: ['Eins', 'Zwei', 'Drei'] } }, + [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 10 } } }, filtersByCDC: { 'demo': [ - createCDCGroupingFilter(uuidv4(), 'Grouping Filter'), - createCDCTextFilter(uuidv4(), 'Text Filter', { filter: [{ field: null, value: [] }], fields: [{ field: { label: 'City', value: `item["address"]["city"]` }, options: [{ label: 'Gwenborough', value: `"Gwenborough"` }, { label: 'Wisokyburgh', value: `"Wisokyburgh"` }, { label: 'McKenziehaven', value: `"McKenziehaven"` }, { label: 'Roscoeview', value: `"Roscoeview"` }, { label: 'Aliyaview', value: `"Aliyaview"` }, { label: 'Howemouth', value: `"Howemouth"` }] }, { field: { label: 'Zip Code', value: `item["address"]["zipcode"]` }, options: [{ label: '33263', value: `"33263"` }, { label: '23505-1337', value: `"23505-1337"` }, { label: '58804-1099', value: `"58804-1099"` }] }, { field: { label: 'Name', value: `item["name"]` }, options: [{ label: 'Leanne Graham', value: `"Leanne Graham"` }, { label: 'Ervin Howell', value: `"Ervin Howell"` }, { label: 'Glenna Reichert', value: `"Glenna Reichert"` }, { label: 'Clementina DuBuque', value: `"Clementina DuBuque"` }] }] }), - createCDCCheckboxFilter(uuidv4(), 'Checkbox Filter', { fields: ['Eins', 'zwei', 'dRei'], filter: [] }), - createCDCRangeFilter(uuidv4(), 'Range Filter', { config: { minValue: 1, maxValue: 10, label: 'ID', field: `item["id"]` }, value: { min: 1, max: 10 } }), + createCDCGroupingFilter(uuidv4()), + createCDCTextFilter(uuidv4(), 'Select...', null), + createCDCCheckboxFilter(uuidv4(), { ['Eins']: undefined, ['Zwei']: undefined, ['Drei']: undefined }), + createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 10 }), ] }, compareColumnOptions: [{ label: "name", value: "name" }, { label: "street", value: "address.street" }, { label: "zipcode", value: "address.zipcode" }, { label: "city", value: "address.city" }, { label: "id", value: "id" }] }), this.node); } diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 60ed8b54a..67532aca0 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,mB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AAC,EAAC;gBACjG,CAAC,gBAAgB,CAAC,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAC,EAAC;aACrF,EACD,YAAY,EAAE;gBACZ,MAAM,EAAE;oBACN,uBAAuB,CAAC,MAAM,EAAE,CAAC;oBACjC,mBAAmB,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC;oBAChD,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAC,CAAC;oBAClG,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,CAAC;iBACxD;aACF,EACD,oBAAoB,EAAE,CAAC,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAC,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAC,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,GACpN,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CDCGroupingFilter.d.ts b/dist/cdc/CDCGroupingFilter.d.ts index e80966b68..c2c1a7c49 100644 --- a/dist/cdc/CDCGroupingFilter.d.ts +++ b/dist/cdc/CDCGroupingFilter.d.ts @@ -1,4 +1,4 @@ -import { IFilter, IFilterComponent } from './interface'; +import { IFilter, IFilterComponent } from './interfaces'; export declare const CDCGroupingFilterId = "group"; export declare const CDCGroupingFilter: IFilterComponent; -export declare function createCDCGroupingFilter(id: string, name: string): IFilter; +export declare function createCDCGroupingFilter(id: string): IFilter; diff --git a/dist/cdc/CDCGroupingFilter.js b/dist/cdc/CDCGroupingFilter.js index a7ecb3acd..016fe4d5c 100644 --- a/dist/cdc/CDCGroupingFilter.js +++ b/dist/cdc/CDCGroupingFilter.js @@ -2,16 +2,14 @@ import * as React from 'react'; export const CDCGroupingFilterId = 'group'; export const CDCGroupingFilter = { clazz: CDCGroupingFilterComponent, + disableDropping: true }; -export function createCDCGroupingFilter(id, name) { +export function createCDCGroupingFilter(id) { return { id, - name, - disableDropping: true, operator: 'AND', children: [], - componentId: CDCGroupingFilterId, - componentValue: null + type: CDCGroupingFilterId, }; } function CDCGroupingFilterComponent() { diff --git a/dist/cdc/CDCGroupingFilter.js.map b/dist/cdc/CDCGroupingFilter.js.map index aa68c86ba..d041a7488 100644 --- a/dist/cdc/CDCGroupingFilter.js.map +++ b/dist/cdc/CDCGroupingFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCGroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCGroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;CAClC,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY;IAC9D,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,mBAAmB;QAChC,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B;IACjC,OAAO;QAAK,+BAAM,CAAM,CAAC;AAC3B,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCGroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCGroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;IACjC,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAAU;IAChD,OAAO;QACL,EAAE;QACF,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,mBAAmB;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B;IACjC,OAAO;QAAK,+BAAM,CAAM,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.d.ts b/dist/cdc/CDCRangeFilter.d.ts index 070c3dcc4..5f04c86c4 100644 --- a/dist/cdc/CDCRangeFilter.d.ts +++ b/dist/cdc/CDCRangeFilter.d.ts @@ -1,4 +1,4 @@ -import { IFilter, IFilterComponent } from './interface'; +import { IFilter, IFilterComponent } from './interfaces'; export interface ICDCRangeFilterValue { config: { minValue: number; @@ -13,4 +13,7 @@ export interface ICDCRangeFilterValue { } export declare const CDCRangeFilterId = "range"; export declare const CDCRangeFilter: IFilterComponent; -export declare function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter; +export declare function createCDCRangeFilter(id: string, field: string, value: { + min: number; + max: number; +}): IFilter; diff --git a/dist/cdc/CDCRangeFilter.js b/dist/cdc/CDCRangeFilter.js index 3e5143660..defe0997d 100644 --- a/dist/cdc/CDCRangeFilter.js +++ b/dist/cdc/CDCRangeFilter.js @@ -3,25 +3,19 @@ import InputRange from 'react-input-range'; export const CDCRangeFilterId = 'range'; export const CDCRangeFilter = { clazz: CDCRangeFilterComponent, - toFilter: CDCRangeFilterToString + disableDropping: true }; -export function createCDCRangeFilter(id, name, value) { +export function createCDCRangeFilter(id, field, value) { return { id, - name, - disableDropping: true, - componentId: CDCRangeFilterId, - componentValue: value + type: CDCRangeFilterId, + field: field, + value: value, }; } -function CDCRangeFilterToString(value) { - // Generate filter from value - return `(${value.config.field} >= ${value.value.min} and ${value.config.field} <= ${value.value.max})`; -} -function CDCRangeFilterComponent({ value, onValueChanged, disabled }) { - var _a; +function CDCRangeFilterComponent({ value, onValueChanged, disabled, config, field }) { return React.createElement("div", { className: "t360-input-range-wrapper", style: { margin: '10px', paddingTop: '10px', minHeight: '50px' } }, - React.createElement("h6", null, (_a = value === null || value === void 0 ? void 0 : value.config) === null || _a === void 0 ? void 0 : _a.label), - React.createElement(InputRange, { disabled: !onValueChanged || disabled, minValue: value.config.minValue, maxValue: value.config.maxValue, value: value.value, onChange: (v) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ ...value, value: v }) })); + React.createElement("h6", null, field), + React.createElement(InputRange, { disabled: !onValueChanged || disabled, minValue: config.minValue, maxValue: config.maxValue, value: value, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged(e) })); } //# sourceMappingURL=CDCRangeFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.js.map b/dist/cdc/CDCRangeFilter.js.map index 7e218e47c..d882faa58 100644 --- a/dist/cdc/CDCRangeFilter.js.map +++ b/dist/cdc/CDCRangeFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAe3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AAEF,MAAM,UAAU,oBAAoB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;AAe3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAiC;IAC/F,OAAO;QACL,EAAE;QACF,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;KACb,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAC;IAC/E,OAAO,6BAAK,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QAC7G,gCAAK,KAAK,CAAM;QAChB,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACpC,CACE,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.d.ts b/dist/cdc/CDCTextFilter.d.ts index 43c81b589..032f72b8f 100644 --- a/dist/cdc/CDCTextFilter.d.ts +++ b/dist/cdc/CDCTextFilter.d.ts @@ -1,32 +1,15 @@ /// -import { IFilter, IFilterComponent } from './interface'; +import { IFilter, IFilterComponent } from './interfaces'; export interface ICDCTextFilterValue { - fields: { - field: { - label: string; - value: string; - }; - options: { - label: string; - value: string; - }[]; - }[]; - filter: { - field: { - label: string; - value: string; - }; - value: { - label: string; - value: string; - }[]; - }[]; } export declare const CDCTextFilterId = "text"; export declare const CDCTextFilter: IFilterComponent; -export declare function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter; -export declare function CDCTextFilterComponent({ value, onValueChanged, disabled }: { +export declare function createCDCTextFilter(id: string, field: string, value: string[]): IFilter; +export declare function CDCTextFilterComponent({ value, onValueChanged, onFieldChanged, disabled, field, config }: { value: any; onValueChanged: any; + onFieldChanged: any; disabled: any; + field: any; + config: any; }): JSX.Element; diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/CDCTextFilter.js index 38ce04a93..b17ce61b1 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/CDCTextFilter.js @@ -3,69 +3,23 @@ import Select from 'react-select'; export const CDCTextFilterId = 'text'; export const CDCTextFilter = { clazz: CDCTextFilterComponent, - toFilter: CDCTextFilterToString + disableDropping: true }; -export function createCDCTextFilter(id, name, value) { +export function createCDCTextFilter(id, field, value) { return { id, - name, - disableDropping: true, - componentId: CDCTextFilterId, - componentValue: value + type: CDCTextFilterId, + field: field, + value: value, }; } -function CDCTextFilterToString(value) { - // Generate filter from value - return `(${value.filter - .map((v) => `${v.field.value} in (${v.value.map(((vV) => vV.value)).join(',')})`) - .join(' and ')})`; -} -export function CDCTextFilterComponent({ value, onValueChanged, disabled }) { +export function CDCTextFilterComponent({ value, onValueChanged, onFieldChanged, disabled, field, config }) { + var _a; return React.createElement(React.Fragment, null, - value.filter.map((v, i) => { - var _a; - return (React.createElement("div", { key: i, className: "input-group m-1 row" }, - React.createElement("div", { className: "col-3 p-0" }, - React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: v.field, options: [...value.fields.map((field) => field.field)], onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.map((oldV) => oldV === v - ? { - ...v, - field: e, - value: [] - } - : oldV) - }) })), - React.createElement("div", { className: "col-7 p-0" }, - React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !v.field, isMulti: true, value: v.value, options: (_a = value.fields.find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.map((oldV) => oldV === v - ? { - ...v, - value: e - } - : oldV) - }) })), - disabled ? null : - React.createElement("div", { className: "col-1 p-0" }, - React.createElement("button", { disabled: !onValueChanged, onClick: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.filter((oldV) => oldV !== v) - }), className: "btn btn-text-secondary" }, - React.createElement("i", { className: "fas fa-trash" }))))); - }), - onValueChanged && !disabled ? (React.createElement("button", { className: "btn btn-text-secondary m-1", onClick: () => { - onValueChanged({ - ...value, - filter: [ - ...value.filter, - { - field: '', - value: [] - } - ] - }); - } }, - React.createElement("i", { className: "fas fa-plus" }))) : null); + React.createElement("div", { className: "input-group m-1 row" }, + React.createElement("div", { className: "col-4 p-0" }, + React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: { label: field, value: field }, options: [...config === null || config === void 0 ? void 0 : config.map((conf) => { return { label: conf.field, value: conf.field }; })], onChange: (e) => onFieldChanged === null || onFieldChanged === void 0 ? void 0 : onFieldChanged(e.value) })), + React.createElement("div", { className: "col-8 p-0" }, + React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !field, isMulti: true, value: value === null || value === void 0 ? void 0 : value.map((v) => { return { label: v, value: v }; }), options: (_a = config === null || config === void 0 ? void 0 : config.find((f) => (f === null || f === void 0 ? void 0 : f.field) === field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { return { label: o, value: o }; }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged([...e.map((v) => v.value)]) })))); } //# sourceMappingURL=CDCTextFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map index 1ecfd74c7..366997712 100644 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E;gBACL,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;oBAChB,6BAAK,SAAS,EAAC,WAAW;wBACxB,gCACE,QAAQ,EAAE,CAAC,cAAc,EACzB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG;gCACf,GAAG,KAAK;gCACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC;6BAClD,CAAC,EAEJ,SAAS,EAAC,wBAAwB;4BAElC,2BAAG,SAAS,EAAC,cAAc,GAAK,CACzB,CACL,CAEJ,CACP,CAAA;SAAA,CAAC;QACD,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7B,gCACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,cAAc,CAAC;oBACb,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,GAAG,KAAK,CAAC,MAAM;wBACf;4BACE,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,EAAE;yBACV;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAED,2BAAG,SAAS,EAAC,aAAa,GAAK,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACP,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAIlC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAe;IAC5E,O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AAC,CAAE,KAAK,MAAK,KAAK,2CAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAA,CAAA,CAAC,GAClG,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC7D,CACE,CACF,CACL,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/DropZone.d.ts b/dist/cdc/DropZone.d.ts index 5de295783..7f5c2d27b 100644 --- a/dist/cdc/DropZone.d.ts +++ b/dist/cdc/DropZone.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter } from './interface'; +import { IFilter } from './interfaces'; interface IDropZoneProps { onDrop: any; canDrop: boolean; diff --git a/dist/cdc/DropZone.js b/dist/cdc/DropZone.js index 5b69d5534..10c4c289b 100644 --- a/dist/cdc/DropZone.js +++ b/dist/cdc/DropZone.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { getFilterFromTree, itemTypes } from './interface'; +import { getFilterFromTree, itemTypes } from './interfaces'; import { useDrop } from 'react-dnd'; export function DropZone({ canDrop, onDrop, filter, index }) { // TODO: Add proper types such that draggedItem can be infered diff --git a/dist/cdc/DropZone.js.map b/dist/cdc/DropZone.js.map index 614bed392..f191bd882 100644 --- a/dist/cdc/DropZone.js.map +++ b/dist/cdc/DropZone.js.map @@ -1 +1 @@ -{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../src/cdc/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAW,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,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AC,mBAAmB,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,IAAI,OAAO,CAAC;IAE3E,OAAO,CACL,6BACE,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EACvB,SAAS,EAAE,oBACT,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC/D,EAAE;QAEF,mDAAW,CACP,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/FilterCard.d.ts b/dist/cdc/FilterCard.d.ts index 0d880e8fc..2a5ecf21f 100644 --- a/dist/cdc/FilterCard.d.ts +++ b/dist/cdc/FilterCard.d.ts @@ -1,16 +1,22 @@ /// -import { IFilter, IFilterComponent } from './interface'; +import { IFilter, IFilterComponent } from './interfaces'; interface IFilterCardProps { filter: IFilter; onDrop?: any; onDelete?: (filter: IFilter) => void; onChange?: (filter: IFilter, changeFunc: (filter: IFilter) => void) => void; onValueChanged?: (filter: IFilter, value: any) => void; + onFieldChanged?: (filter: IFilter, field: any) => void; filterComponents: { - [key: string]: IFilterComponent; + [key: string]: { + component: IFilterComponent; + config?: any; + }; }; disableFilter: boolean; isInvalid?: boolean; + disableRemoving?: boolean; + disableDragging?: boolean; } -export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter, isInvalid }: IFilterCardProps): JSX.Element; +export declare function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, onFieldChanged, filterComponents, disableFilter, isInvalid, disableDragging, disableRemoving }: IFilterCardProps): JSX.Element; export {}; diff --git a/dist/cdc/FilterCard.js b/dist/cdc/FilterCard.js index a86c716e7..f59a89f89 100644 --- a/dist/cdc/FilterCard.js +++ b/dist/cdc/FilterCard.js @@ -1,8 +1,8 @@ import * as React from 'react'; -import { itemTypes } from './interface'; +import { itemTypes } from './interfaces'; import { useDrag } from 'react-dnd'; import { DropZone } from './DropZone'; -export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter, isInvalid }) { +export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, onFieldChanged, filterComponents, disableFilter, isInvalid, disableDragging, disableRemoving }) { var _a, _b, _c; const [{ isDragging, draggedItem }, drag, preview] = useDrag(() => ({ type: itemTypes.FILTERCARD, @@ -13,16 +13,15 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, }) })); const hasChildren = filter.children && filter.children.length >= 0; - const filterComponent = filterComponents[filter.componentId]; + const filterComponent = filterComponents[filter.type]; if (!filterComponent) { return React.createElement(React.Fragment, null, "ERROR!!"); } return (React.createElement(React.Fragment, null, - React.createElement("div", { className: `card mb-2 ${isDragging ? 'bg-light' : ''}${isInvalid ? ' form-control is-invalid' : ''}`, ref: preview, style: filter.disableRemoving && filter.disableDragging ? { height: '93%' } : {} }, + React.createElement("div", { className: `card mb-2 ${isDragging ? 'bg-light' : ''}${isInvalid ? ' form-control is-invalid' : ''}`, ref: preview, style: disableRemoving && disableDragging ? { height: '93%' } : {} }, React.createElement("div", { className: "card-body" }, - React.createElement("h6", { ref: filter.disableDragging || disableFilter ? undefined : drag, className: "card-title d-flex", style: filter.disableDragging || disableFilter ? {} : { cursor: 'move' } }, - filter.disableDragging || disableFilter ? null : (React.createElement("i", { style: { marginRight: 5 }, className: "fas fa-arrows-alt" })), - React.createElement("span", { className: "flex-fill" }, filter.name), + React.createElement("h6", { ref: disableDragging || disableFilter ? undefined : drag, className: "card-title d-flex", style: disableDragging || disableFilter ? {} : { cursor: 'move' } }, + disableDragging || disableFilter ? null : (React.createElement("i", { style: { marginRight: 5 }, className: "fas fa-arrows-alt" })), React.createElement("div", null, React.createElement("div", { className: "input-group" }, onChange && hasChildren && ((_a = filter === null || filter === void 0 ? void 0 : filter.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? (React.createElement("select", { className: "form-select form-select-sm", style: { width: '6em' }, value: filter.operator || 'AND', disabled: disableFilter, onChange: (e) => { @@ -31,17 +30,18 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, }); } }, React.createElement("option", { value: "AND" }, "AND"), - React.createElement("option", { value: "OR" }, "OR"), - React.createElement("option", { value: "NOT" }, "NOT (AND)"))) : null, - !filter.disableRemoving && onDelete && !disableFilter ? (React.createElement("button", { className: "btn btn-text-secondary btn-sm", onClick: () => onDelete(filter) }, + React.createElement("option", { value: "OR" }, "OR"))) : null, + !disableRemoving && onDelete && !disableFilter ? (React.createElement("button", { className: "btn btn-text-secondary btn-sm", onClick: () => onDelete(filter) }, React.createElement("i", { className: "fas fa-times" }))) : null))), - filterComponent ? (React.createElement("div", null, - React.createElement(filterComponent.clazz, { disabled: disableFilter, value: filter.componentValue, onValueChanged: onValueChanged + (filterComponent === null || filterComponent === void 0 ? void 0 : filterComponent.component) ? (React.createElement("div", null, + React.createElement(filterComponent.component.clazz, { disabled: disableFilter, value: filter.value, config: filterComponent.config, field: filter.field, onFieldChanged: onFieldChanged + ? (field) => onFieldChanged(filter, field) + : undefined, onValueChanged: onValueChanged ? (value) => onValueChanged(filter, value) : undefined }))) : null, - onDrop && (hasChildren || !filter.disableDropping) && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: 0, canDrop: draggedItem !== ((_b = filter.children) === null || _b === void 0 ? void 0 : _b[0]) })) : null, (_c = filter.children) === null || _c === void 0 ? void 0 : + onDrop && (hasChildren || !filterComponent.component.disableDropping) && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: 0, canDrop: draggedItem !== ((_b = filter.children) === null || _b === void 0 ? void 0 : _b[0]) })) : null, (_c = filter.children) === null || _c === void 0 ? void 0 : _c.map((child, i, allChildren) => (React.createElement(React.Fragment, { key: child.id }, - React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onChange: onChange, filterComponents: filterComponents, disableFilter: disableFilter }), + React.createElement(FilterCard, { key: child.id, filter: child, onDrop: onDrop, onDelete: onDelete, onValueChanged: onValueChanged, onFieldChanged: onFieldChanged, onChange: onChange, filterComponents: filterComponents, disableFilter: disableFilter }), onDrop && hasChildren && !disableFilter ? (React.createElement(DropZone, { onDrop: onDrop, filter: filter, index: i + 1, canDrop: draggedItem !== allChildren[i + 1] && draggedItem !== child && !disableFilter })) : null))))), isInvalid ? React.createElement("div", { className: "invalid-feedback mb-2" }, "Filter must not be empty!") : diff --git a/dist/cdc/FilterCard.js.map b/dist/cdc/FilterCard.js.map index a0e78577c..dd82311cb 100644 --- a/dist/cdc/FilterCard.js.map +++ b/dist/cdc/FilterCard.js.map @@ -1 +1 @@ -{"version":3,"file":"FilterCard.js","sourceRoot":"","sources":["../../src/cdc/FilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA4B,SAAS,EAAC,MAAM,aAAa,CAAC;AACjE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAapC,MAAM,UAAU,UAAU,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAmB;;IAC3I,MAAM,CAAC,EAAC,UAAU,EAAE,WAAW,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChE,IAAI,EAAE,SAAS,CAAC,UAAU;QAC1B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE;YAClC,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,CAAC,CAAC;IAEJ,MAAM,WAAW,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,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B;oBACD,MAAM,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CACzC,oBAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GAAG,CAAC,EACZ,OAAO,EACL,WAAW,KAAK,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,IAAI,CAAC,aAAa,GAE/E,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF;QACL,SAAS,CAAC,CAAC;YACV,6BAAK,SAAS,EAAC,uBAAuB,gCAEhC,CAAC,CAAC;YACR,IAAI,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/api.d.ts b/dist/cdc/api.d.ts index 5137bcfb4..0200fc73e 100644 --- a/dist/cdc/api.d.ts +++ b/dist/cdc/api.d.ts @@ -8,7 +8,7 @@ * Proprietary and confidential. No warranty. * *********************************************************/ -import { IAlert, IUploadAlert } from './interface'; +import { IAlert, IUploadAlert } from './interfaces'; export declare function getAlerts(): Promise; export declare function getAlertsById(id: number): Promise; export declare function editAlert(id: number, alert: Partial): Promise; diff --git a/dist/cdc/interfaces.d.ts b/dist/cdc/interfaces.d.ts new file mode 100644 index 000000000..752a94f89 --- /dev/null +++ b/dist/cdc/interfaces.d.ts @@ -0,0 +1,56 @@ +/// +export interface IFilterComponent { + clazz: (props: { + value: V; + onValueChanged?: (value: V) => void; + onFieldChanged?: (field: string) => void; + disabled: boolean; + config: any; + field: any; + }) => JSX.Element; + disableDropping?: boolean; +} +export interface IFilter { + id: string; + operator?: 'AND' | 'OR'; + type: string; + value?: any; + field?: string; + children?: IFilter[]; +} +export declare const itemTypes: { + FILTERCARD: string; +}; +export declare const getFilterFromTree: (filter: IFilter, id: string) => { + parent: IFilter | null; + current: IFilter | null; +}; +export interface IAlert { + id: number; + name: string; + cdc_id: string; + filter: IFilter; + enable_mail_notification: boolean; + latest_diff: { + dictionary_item_added?: string[]; + dictionary_item_removed?: string[]; + values_changed?: { + id: string; + field: []; + old_value: string; + new_value: string; + }[]; + }; + latest_fetched_data: any; + latest_compare_date: Date; + modification_date: string; + confirmed_data: any; + confirmation_date: Date; + compare_columns: { + label: string; + value: string; + }[]; +} +export interface IUploadAlert extends Pick { +} +export declare function isAlert(obj: IAlert | IUploadAlert): obj is IAlert; diff --git a/dist/cdc/interfaces.js b/dist/cdc/interfaces.js new file mode 100644 index 000000000..0f6928d22 --- /dev/null +++ b/dist/cdc/interfaces.js @@ -0,0 +1,28 @@ +export const itemTypes = { + FILTERCARD: 'filtercard' +}; +export const getFilterFromTree = (filter, id) => { + if ((filter === null || filter === void 0 ? void 0 : filter.id) === id) { + return { current: filter, parent: null }; + } + else if (filter && filter.children) { + // Is the id part of my children? + const current = filter.children.find((f) => f.id === id); + if (current) { + return { parent: filter, current }; + } + // Otherwise, continue with all children + for (const f of filter.children) { + const current = getFilterFromTree(f, id); + if (current.current) { + return current; + } + } + } + return { parent: null, current: null }; +}; +export function isAlert(obj) { + var _a; + return typeof ((_a = obj) === null || _a === void 0 ? void 0 : _a.id) === 'number'; +} +//# sourceMappingURL=interfaces.js.map \ No newline at end of file diff --git a/dist/cdc/interfaces.js.map b/dist/cdc/interfaces.js.map new file mode 100644 index 000000000..3bb5c6a56 --- /dev/null +++ b/dist/cdc/interfaces.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/cdc/interfaces.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE;YACX,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;SAClC;QACD,wCAAwC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;SACF;KACF;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AACvC,CAAC,CAAC;AAiDF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCCheckboxFilter.tsx b/src/cdc/CDCCheckboxFilter.tsx index 2c7cac77d..01d4102fb 100644 --- a/src/cdc/CDCCheckboxFilter.tsx +++ b/src/cdc/CDCCheckboxFilter.tsx @@ -1,37 +1,27 @@ -import {IFilter, IFilterComponent} from './interface'; +import {IFilter, IFilterComponent} from './interfaces'; import * as React from 'react'; interface ICDCCheckboxFilterValue { - fields: string[]; - filter: string[]; + [field: string]: boolean; } export const CDCCheckboxFilterId = 'checkbox'; export const CDCCheckboxFilter: IFilterComponent = { clazz: CDCCheckboxFilterComponent, - toFilter: CDCCheckboxFilterToString + disableDropping: true }; -export function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter { +export function createCDCCheckboxFilter(id: string, value: ICDCCheckboxFilterValue): IFilter { return { id, - name, - disableDropping: true, - componentId: CDCCheckboxFilterId, - componentValue: value + type: CDCCheckboxFilterId, + value: value }; } -function CDCCheckboxFilterToString(value: ICDCCheckboxFilterValue): string { - // Generate filter from value - return `(${value?.fields.map((v) => {return `${v} == ${value.filter.filter((f) => f === v).length > 0}`;}).join(' and ')})`; -} - -//checkbox1 == true and checkbox2 == false and item["address"] == true - -export function CDCCheckboxFilterComponent({value, onValueChanged, disabled}) { +export function CDCCheckboxFilterComponent({value, onValueChanged, disabled, config, field}) { return <> - {value.fields.map((v, i) => { + {Object.entries(value).map(([field, flag], i) => { return (
    @@ -39,24 +29,19 @@ export function CDCCheckboxFilterComponent({value, onValueChanged, disabled}) { className="form-check-input" type="checkbox" id="flexCheckDefault" - checked={value.filter.filter((f) => f === v).length > 0} + checked={flag? true : false} disabled={!onValueChanged || disabled} onChange={(e) => onValueChanged?.({ ...value, - fields: value.fields, - filter: - value.filter.filter((f) => f === v).length > 0 - ? value.filter.filter((f) => f !== v) - : [...value.filter, v] - }) - } + [field]: e + })} />
    diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/CDCCreateAlert.tsx index d5704d5d4..5fae84c98 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/CDCCreateAlert.tsx @@ -3,7 +3,7 @@ import Select from 'react-select'; import {runAlert} from '..'; import {saveAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; -import {getTreeQuery, IFilter, IFilterComponent, IUploadAlert} from './interface'; +import {IFilter, IFilterComponent, IUploadAlert} from './interfaces'; interface ICDCCreateAlert { alertData: IUploadAlert; @@ -11,7 +11,7 @@ interface ICDCCreateAlert { filterSelection: IFilter[] | undefined; filter: IFilter; setFilter: (filter: IFilter) => void; - filterComponents: {[key: string]: IFilterComponent}; + filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; onAlertChanged: (id?: number) => void; setCreationMode: (mode: boolean) => void; cdcs: string[]; @@ -32,15 +32,12 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter const onSave = async () => { if (validFilter && validName) { - const newAlert = await saveAlert({ - ...alertData, - filter, - filter_query: getTreeQuery(filter, filterComponents) - }).then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; + const newAlert = await saveAlert({...alertData, filter}) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); }); - }); onAlertChanged(newAlert.id); setCreationMode(false); } @@ -79,7 +76,7 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter closeMenuOnSelect={false} options={compareColumnOptions} value={alertData.compare_columns} - onChange={(e) => setAlertData({...alertData, compare_columns:e as {value: string, label: string}[]})} + onChange={(e) => setAlertData({...alertData, compare_columns: e as {value: string, label: string}[]})} />
    diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx index bb7a2ebec..64bcbdcca 100644 --- a/src/cdc/CDCEditAlert.tsx +++ b/src/cdc/CDCEditAlert.tsx @@ -1,9 +1,10 @@ +import get from 'lodash.get'; import React from 'react'; import Select from 'react-select'; import {runAlert} from '.'; import {confirmAlertById, deleteAlert, editAlert} from './api'; import {CDCFilterComponent} from './CDCFilterComponent'; -import {getTreeQuery, IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; +import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interfaces'; interface ICDCEditAlert { alertData: IUploadAlert; @@ -11,7 +12,7 @@ interface ICDCEditAlert { filterSelection: IFilter[] | undefined; filter: IFilter; setFilter: (filter: IFilter) => void; - filterComponents: {[key: string]: IFilterComponent}; + filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; onAlertChanged: (id?: number) => void; selectedAlert: IAlert; cdcs: string[]; @@ -44,13 +45,8 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, const onSave = async () => { if (validFilter && validName) { - const newAlert = await editAlert( - selectedAlert.id, - { - ...alertData, - filter, - filter_query: getTreeQuery(filter, filterComponents) - }).then((alert) => { + const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) + .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; }); @@ -72,15 +68,6 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, onAlertChanged(); }; - const getNestedValue = (obj: Object, key: string) => { - const keys = key.split("."); - let value = obj; - keys.forEach((k) => { - value = value[k]; - }); - return value; - } - const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { parentId = parentId.trim(); return ( @@ -97,6 +84,8 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, ); }; + console.log(selectedAlert.latest_diff) + const generalInformation = <>
    @@ -171,19 +160,19 @@ export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, {selectedAlert.latest_diff.dictionary_item_added?.map((d) => { const data = selectedAlert.latest_fetched_data.find(a => a.id === d); return (
    - {selectedAlert.compare_columns?.map((field, i) => )} + {selectedAlert.compare_columns?.map((field, i) => )} ); })} {selectedAlert.latest_diff.dictionary_item_removed?.map((d) => { const data = selectedAlert.confirmed_data.find(a => a.id === d); return ( - {selectedAlert.compare_columns?.map((field, i) => )} + {selectedAlert.compare_columns?.map((field, i) => )} ); })} {[...change.keys()]?.map((id, i) => { const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); return ( - {selectedAlert.compare_columns?.map((field, index) => change.get(id).has(field.value) ? : )} + {selectedAlert.compare_columns?.map((field, index) => change.get(id).has(field.value) ? : )} ); })} diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx index b7761dff4..1fa7ebf3e 100644 --- a/src/cdc/CDCFilterComponent.tsx +++ b/src/cdc/CDCFilterComponent.tsx @@ -3,14 +3,14 @@ import React from 'react'; import {DndProvider} from 'react-dnd'; import {HTML5Backend} from 'react-dnd-html5-backend'; import {FilterCard} from './FilterCard'; -import {getFilterFromTree, IFilter, IFilterComponent} from './interface'; +import {getFilterFromTree, IFilter, IFilterComponent} from './interfaces'; import {v4 as uuidv4} from 'uuid'; interface ICDCFilterComponentProps { filterSelection?: IFilter[]; filter: IFilter; setFilter: React.Dispatch>; - filterComponents: {[key: string]: IFilterComponent}; + filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; disableFilter?: boolean; isInvalid?: boolean; } @@ -86,10 +86,21 @@ export function CDCFilterComponent({filterSelection, filter, setFilter, filterCo const onValueChanged = (filter: IFilter, value: any) => { onChange(filter, (f) => { - f.componentValue = value; + f.value = value; }); }; + const onFieldChanged = (filter: IFilter, field: any) => { + console.log(field, filter) + onChange(filter, (f) => { + f.field = field; + }); + } + + if(filter.type !== 'group') { + throw Error('First filter always has to be a group filter'); + } + return (
    @@ -101,6 +112,7 @@ export function CDCFilterComponent({filterSelection, filter, setFilter, filterCo onDelete={onDelete} onChange={onChange} onValueChanged={onValueChanged} + onFieldChanged={onFieldChanged} filterComponents={filterComponents} disableFilter={disableFilter} isInvalid={isInvalid} diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index eed04dc54..e872dfb83 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interface'; +import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interfaces'; import {getAlerts, runAlertById} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter} from './CDCGroupingFilter'; import {v4 as uuidv4} from 'uuid'; @@ -12,13 +12,13 @@ import {CDCCreateAlert} from './CDCCreateAlert'; import {CDCEditAlert} from './CDCEditAlert'; interface ICDCFilterDialogProps { - filterComponents: {[key: string]: IFilterComponent}; + filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; filtersByCDC: {[cdcId: string]: IFilter[]}; compareColumnOptions: {label: string, value: string}[]; } -export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, filter_query: '', compare_columns: null}; -export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4(), 'Drop filters here'), disableDragging: true, disableRemoving: true}; +export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, compare_columns: null}; +export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4())}; export const runAlert = async (id: number): Promise => { const runAlert = runAlertById(id).then((alert) => {return alert}).catch((e) => { @@ -69,6 +69,8 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp }).catch((e) => console.error(e)); }; + console.log(filter) + return <> setShowDialog(true)}> Alert Filter @@ -157,17 +159,17 @@ export class CDCFilterDialogClass { ReactDOM.render( = { clazz: CDCGroupingFilterComponent, + disableDropping: true }; -export function createCDCGroupingFilter(id: string, name: string): IFilter { +export function createCDCGroupingFilter(id: string): IFilter { return { id, - name, - disableDropping: true, operator: 'AND', children: [], - componentId: CDCGroupingFilterId, - componentValue: null + type: CDCGroupingFilterId, }; } diff --git a/src/cdc/CDCRangeFilter.tsx b/src/cdc/CDCRangeFilter.tsx index d35e63ed4..62ab392f6 100644 --- a/src/cdc/CDCRangeFilter.tsx +++ b/src/cdc/CDCRangeFilter.tsx @@ -1,4 +1,4 @@ -import {IFilter, IFilterComponent} from './interface'; +import {IFilter, IFilterComponent} from './interfaces'; import * as React from 'react'; import InputRange from 'react-input-range'; @@ -18,33 +18,27 @@ export interface ICDCRangeFilterValue { export const CDCRangeFilterId = 'range'; export const CDCRangeFilter: IFilterComponent = { clazz: CDCRangeFilterComponent, - toFilter: CDCRangeFilterToString + disableDropping: true }; -export function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter { +export function createCDCRangeFilter(id: string, field: string, value: {min: number, max: number}): IFilter { return { id, - name, - disableDropping: true, - componentId: CDCRangeFilterId, - componentValue: value + type: CDCRangeFilterId, + field: field, + value: value, }; } -function CDCRangeFilterToString(value: ICDCRangeFilterValue): string { - // Generate filter from value - return `(${value.config.field} >= ${value.value.min} and ${value.config.field} <= ${value.value.max})`; -} - -function CDCRangeFilterComponent({value, onValueChanged, disabled}) { +function CDCRangeFilterComponent({value, onValueChanged, disabled, config, field}) { return
    -
    {value?.config?.label}
    +
    {field}
    onValueChanged?.({...value, value: v})} + minValue={config.minValue} + maxValue={config.maxValue} + value={value} + onChange={(e) => onValueChanged?.(e)} />
    ; } diff --git a/src/cdc/CDCTextFilter.tsx b/src/cdc/CDCTextFilter.tsx index e75f93ddb..1dd0b6b2f 100644 --- a/src/cdc/CDCTextFilter.tsx +++ b/src/cdc/CDCTextFilter.tsx @@ -1,124 +1,45 @@ -import {IFilter, IFilterComponent} from './interface'; +import {IFilter, IFilterComponent} from './interfaces'; import * as React from 'react'; import Select from 'react-select'; -export interface ICDCTextFilterValue { - fields: { - field: {label: string, value: string}; - options: {label: string, value: string}[]; - }[]; - filter: { - field: {label: string, value: string} - value: {label: string, value: string}[] - }[]; -} +export interface ICDCTextFilterValue {} export const CDCTextFilterId = 'text'; export const CDCTextFilter: IFilterComponent = { clazz: CDCTextFilterComponent, - toFilter: CDCTextFilterToString + disableDropping: true }; -export function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter { +export function createCDCTextFilter(id: string, field: string, value: string[]): IFilter { return { id, - name, - disableDropping: true, - componentId: CDCTextFilterId, - componentValue: value + type: CDCTextFilterId, + field: field, + value: value, }; } -function CDCTextFilterToString(value: ICDCTextFilterValue): string { - // Generate filter from value - return `(${value.filter - .map((v) => `${v.field.value} in (${v.value.map(((vV) => vV.value)).join(',')})`) - .join(' and ')})`; -} - -export function CDCTextFilterComponent({value, onValueChanged, disabled}) { +export function CDCTextFilterComponent({value, onValueChanged, onFieldChanged, disabled, field, config}) { return <> - {value.filter.map((v, i) => ( -
    -
    - f.field === v.field)?.options} - onChange={(e) => - onValueChanged?.({ - ...value, - filter: value.filter.map((oldV) => - oldV === v - ? { - ...v, - value: e - } - : oldV - ) - }) - } - /> -
    - {disabled ? null : -
    - -
    - } +
    +
    + {return {label: v, value: v}})} + options={config?.find((f) => f?.field === field)?.options.map((o) => {return {label: o, value: o}})} + onChange={(e) => onValueChanged?.([...e.map((v) => v.value)])} + />
    - ))} - {onValueChanged && !disabled ? ( - - ) : null} +
    ; } diff --git a/src/cdc/DropZone.tsx b/src/cdc/DropZone.tsx index 79af4cfae..ae705ef03 100644 --- a/src/cdc/DropZone.tsx +++ b/src/cdc/DropZone.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { getFilterFromTree, IFilter, itemTypes } from './interface'; +import { getFilterFromTree, IFilter, itemTypes } from './interfaces'; import { useDrop } from 'react-dnd'; interface IDropZoneProps { diff --git a/src/cdc/FilterCard.tsx b/src/cdc/FilterCard.tsx index 6d544aed1..33b146dd6 100644 --- a/src/cdc/FilterCard.tsx +++ b/src/cdc/FilterCard.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import {IFilter, IFilterComponent, itemTypes} from './interface'; +import {IFilter, IFilterComponent, itemTypes} from './interfaces'; import {useDrag} from 'react-dnd'; import {DropZone} from './DropZone'; @@ -9,12 +9,15 @@ interface IFilterCardProps { onDelete?: (filter: IFilter) => void; onChange?: (filter: IFilter, changeFunc: (filter: IFilter) => void) => void; onValueChanged?: (filter: IFilter, value: any) => void; - filterComponents: {[key: string]: IFilterComponent}; + onFieldChanged?: (filter: IFilter, field: any) => void; + filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; disableFilter: boolean; isInvalid?: boolean; + disableRemoving?: boolean; + disableDragging?: boolean; } -export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, filterComponents, disableFilter, isInvalid}: IFilterCardProps) { +export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, onFieldChanged, filterComponents, disableFilter, isInvalid, disableDragging, disableRemoving}: IFilterCardProps) { const [{isDragging, draggedItem}, drag, preview] = useDrag(() => ({ type: itemTypes.FILTERCARD, item: filter, @@ -25,7 +28,7 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, })); const hasChildren = filter.children && filter.children.length >= 0; - const filterComponent = filterComponents[filter.componentId]; + const filterComponent = filterComponents[filter.type]; if (!filterComponent) { return <>ERROR!!; @@ -35,21 +38,20 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged,
    - {filter.disableDragging || disableFilter ? null : ( + {disableDragging || disableFilter ? null : ( )} - {filter.name}
    {onChange && hasChildren && filter?.children?.length > 1 ? ( @@ -66,10 +68,9 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, > - ) : null} - {!filter.disableRemoving && onDelete && !disableFilter ? ( + {!disableRemoving && onDelete && !disableFilter ? (
    #NameStreetCity{field.label}
    {data?.id}{data?.name}{data?.address.street}{`${data?.address?.zipcode} ${data?.address?.city}`}{getNestedValue(data, field.value)}
    {data?.id}{data?.name}{data?.address.street}{`${data?.address?.zipcode} ${data?.address?.city}`}{getNestedValue(data, field.value)}
    {change.get(id).get('id').old} {change.get(id).get('id').new}{oldData.id}{change.get(id).get('name').old} {change.get(id).get('name').new}{oldData.name}{change.get(id).get('address.street').old} {change.get(id).get('address.street').new}{oldData.address.street}{change.get(id).get('address.zipcode').old} {oldData.address.city} {change.get(id).get('address.zipcode').new} {newData.address.city}{oldData.address.zipcode} {change.get(id).get('address.city').old} {newData.address.zipcode} {change.get(id).get('address.city').new}{`${oldData.address?.zipcode} ${oldData.address?.city}`}
    {change.get(id).get(field.value).old} {change.get(id).get(field.value).new}{getNestedValue(oldData, field.value)}
    {getNestedValue(data, field.value)}{get(data, field.value)}
    {getNestedValue(data, field.value)}{get(data, field.value)}
    {change.get(id).get(field.value).old} {change.get(id).get(field.value).new}{getNestedValue(oldData, field.value)}{change.get(id).get(field.value).old} {change.get(id).get(field.value).new}{get(oldData, field.value)}
    + + + {selectedAlert.compare_columns?.map((field, i) => )} + + + + {selectedAlert.latest_diff.dictionary_item_added?.map((d) => { + const data = selectedAlert.latest_fetched_data.find(a => a.id === d); + return ( + {selectedAlert.compare_columns?.map((field, i) => )} + ); + })} + {selectedAlert.latest_diff.dictionary_item_removed?.map((d) => { + const data = selectedAlert.confirmed_data.find(a => a.id === d); + return ( + {selectedAlert.compare_columns?.map((field, i) => )} + ); + })} + {[...change.keys()]?.map((id, i) => { + const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); + return ( + {selectedAlert.compare_columns?.map((field, index) => change.get(id).has(field) ? : )} + ); + })} + +
    {field}
    {get(data, field)}
    {get(data, field)}
    {change.get(id).get(field).old} {change.get(id).get(field).new}{get(oldData, field)}
    +
    + +
    + ); + } + return

    No new data available

    ; + }; + + const editButton = !editMode && !deleteMode && !creationMode ? (<> + + + ) : (editMode || creationMode ? <> + + + : <> + + + ); + + return (<> +
    +
    Your options
    + {editButton} +
    +
    + {!editMode && !creationMode ? +
    +

    + +

    +
    + {literature()} +
    +
    + : null} +
    +

    + +

    +
    +
    +
    + + {!creationMode && !editMode ? +
    {alertData.name}
    + : + <> setAlertData({...alertData, name: e.target.value})} required /> + {validName ? null : +
    + Name must not be empty! +
    } + } +
    +
    + + {return {label: col, value: col}})} + value={alertData.compare_columns?.map((col) => {return {label: col, value: col}})} + onChange={(e) => setAlertData({...alertData, compare_columns: [...e.map((col) => col.value)]})} + /> +
    +
    + +
    + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + +
    +
    +
    +
    + {filterSelection || !filter ? + + : +

    No filters available for this cdc

    } +
    +
    +
    +
    + ); +} + + +/* +const generalInformation = + <> +
    +
    + + {!editMode ? +
    {alertData.name}
    + : + <> setAlertData({...alertData, name: e.target.value})} /> + {validName ? null : +
    + Name must not be empty! +
    } + } +
    +
    + + setAlertData({...alertData, compare_columns: [...e]})} + /> +
    +
    + +
    + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + +
    +
    +
    +
    + {filterSelection || !filter ? + + : +

    No filters available for this cdc

    } +
    + ; + + +const alertInformation = +<> +
    +
    + +
    {alertData.name}
    +
    +
    + + +
    +
    + +
    + + +
    +
    +
    +
    + {filterSelection || !filter ? + + : +

    No filters available for this cdc

    } +
    +; + +const onCreateSave = async () => { + if (validFilter && validName) { + const newAlert = await saveAlert({...alertData, filter}) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + onAlertChanged(newAlert.id); + setCreationMode(false); + } +}; + + const onEditSave = async () => { + if (validFilter && validName) { + const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + onAlertChanged(newAlert.id); + setEditMode(false); + } +}; + +const alterAlert = +<> +
    +
    +
    + + setAlertData({...alertData, name: e.target.value})} required /> + {validName ? null : +
    + Name must not be empty! +
    } +
    +
    + + setAlertData({...alertData, compare_columns: [...e]})} + /> +
    +
    + +
    + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + +
    +
    +
    +
    + {filterSelection || !filter ? + + : +

    No filters available for this cdc

    + } +
    +
    +; + +*/ diff --git a/src/cdc/CDCCheckboxFilter.tsx b/src/cdc/CDCCheckboxFilter.tsx index fffd0ebd2..c57a1fcf6 100644 --- a/src/cdc/CDCCheckboxFilter.tsx +++ b/src/cdc/CDCCheckboxFilter.tsx @@ -1,5 +1,6 @@ import {IFilter, IFilterComponent} from './interfaces'; import * as React from 'react'; +import Checkbox from 'react-three-state-checkbox'; interface ICDCCheckboxFilterValue { [field: string]: boolean; @@ -19,22 +20,34 @@ export function createCDCCheckboxFilter(id: string, value: ICDCCheckboxFilterVal }; } -export function CDCCheckboxFilterComponent({value, onValueChanged, disabled, config, field}) { + +export function CDCCheckboxFilterComponent({value, onValueChanged, disabled, config}) { + const onChange = (value, field, e) => { + if (value[field] === false) { + const newVal = {}; + Object.keys(value).forEach((key) => { + if (key !== field) { + newVal[key] = value[key]; + } + }); + return newVal; + } else { + return {...value, [field]: e.target.checked} + } + } + return <> - {Object.entries(value).map(([field, flag], i) => { + {config.fields.map((field, i) => { return (
    - - onValueChanged?.({ - ...value, - [field]: e.target.checked - })} + onValueChanged?.(onChange(value, field, e))} />
    diff --git a/src/cdc/CDCEditAlert.tsx b/src/cdc/CDCEditAlert.tsx deleted file mode 100644 index 64bcbdcca..000000000 --- a/src/cdc/CDCEditAlert.tsx +++ /dev/null @@ -1,209 +0,0 @@ -import get from 'lodash.get'; -import React from 'react'; -import Select from 'react-select'; -import {runAlert} from '.'; -import {confirmAlertById, deleteAlert, editAlert} from './api'; -import {CDCFilterComponent} from './CDCFilterComponent'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interfaces'; - -interface ICDCEditAlert { - alertData: IUploadAlert; - setAlertData: (formData: IUploadAlert) => void; - filterSelection: IFilter[] | undefined; - filter: IFilter; - setFilter: (filter: IFilter) => void; - filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; - onAlertChanged: (id?: number) => void; - selectedAlert: IAlert; - cdcs: string[]; - compareColumnOptions: {label: string, value: string}[]; -} - -export function CDCEditAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions}: ICDCEditAlert) { - const [editMode, setEditMode] = React.useState(false); - const [deleteMode, setDeleteMode] = React.useState(false); - const [validName, setValidName] = React.useState(true); - const [validFilter, setValidFilter] = React.useState(true); - - React.useEffect(() => { - setEditMode(false); - setDeleteMode(false); - }, [selectedAlert]); - - React.useEffect(() => { - setValidFilter(filter?.children.length > 0); - }, [filter]); - - React.useEffect(() => { - setValidName(alertData?.name?.trim().length > 0); - }, [alertData.name]); - - const confirmChanges = async (id: number) => { - const alert = await confirmAlertById(id); - onAlertChanged(alert.id); - }; - - const onSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } - }; - - const onDiscard = () => { - setEditMode(false); - setAlertData(selectedAlert); - setFilter(selectedAlert.filter); - }; - - const onDelete = async (id: number) => { - setEditMode(false); - await deleteAlert(id); - onAlertChanged(); - }; - - const accordionItem = (index: number, title: string, parentId: string, child: JSX.Element, show?: boolean) => { - parentId = parentId.trim(); - return ( -
    -

    - -

    -
    - {child} -
    -
    - ); - }; - - console.log(selectedAlert.latest_diff) - - const generalInformation = - <> -
    -
    - - {!editMode ? -
    {alertData.name}
    - : - <> setAlertData({...alertData, name: e.target.value})} /> - {validName ? null : -
    - Name must not be empty! -
    } - } -
    -
    - - setAlertData({...alertData, compare_columns: e as {value: string, label: string}[]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    - ; - - const literature = () => { - if (selectedAlert.latest_diff) { - const change: Map> = new Map(); - selectedAlert.latest_diff?.values_changed?.map((d) => { - const nestedField = d.field.map((f) => f).join("."); - if (change.has(d.id)) { - change.set(d.id, change.get(d.id).set(nestedField, {old: d.old_value, new: d.new_value})); - } else { - change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); - } - }); - return (<> -
    Changed data:
    - - - - {selectedAlert.compare_columns?.map((field, i) => )} - - - - {selectedAlert.latest_diff.dictionary_item_added?.map((d) => { - const data = selectedAlert.latest_fetched_data.find(a => a.id === d); - return ( - {selectedAlert.compare_columns?.map((field, i) => )} - ); - })} - {selectedAlert.latest_diff.dictionary_item_removed?.map((d) => { - const data = selectedAlert.confirmed_data.find(a => a.id === d); - return ( - {selectedAlert.compare_columns?.map((field, i) => )} - ); - })} - {[...change.keys()]?.map((id, i) => { - const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); - return ( - {selectedAlert.compare_columns?.map((field, index) => change.get(id).has(field.value) ? : )} - ); - })} - -
    {field.label}
    {get(data, field.value)}
    {get(data, field.value)}
    {change.get(id).get(field.value).old} {change.get(id).get(field.value).new}{get(oldData, field.value)}
    -
    - -
    - ); - } - return

    No new data available

    ; - }; - - const editButton = !editMode && !deleteMode ? (<> - - - ) : (editMode ? <> - - - : <> - - - ); - - return (<> -
    -
    Your options
    - {editButton} -
    -
    - {!editMode ? accordionItem(1, `${selectedAlert.latest_diff ? 'Latest revision from: ' + new Date(selectedAlert.latest_compare_date)?.toLocaleDateString() : 'No new data'}`, 'editAlert', literature(), true) : null} - {accordionItem(2, 'Alert overview', 'editAlert', generalInformation, editMode)} -
    - ); -} diff --git a/src/cdc/CDCFilterComponent.tsx b/src/cdc/CDCFilterComponent.tsx index 1fa7ebf3e..009be123a 100644 --- a/src/cdc/CDCFilterComponent.tsx +++ b/src/cdc/CDCFilterComponent.tsx @@ -116,6 +116,8 @@ export function CDCFilterComponent({filterSelection, filter, setFilter, filterCo filterComponents={filterComponents} disableFilter={disableFilter} isInvalid={isInvalid} + disableDragging={true} + disableRemoving={true} />
    {filterSelection ? diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index e872dfb83..0643d8722 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -9,12 +9,12 @@ import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './CDCTextFilt import {CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter} from './CDCCheckboxFilter'; import {CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter} from './CDCRangeFilter'; import {CDCCreateAlert} from './CDCCreateAlert'; -import {CDCEditAlert} from './CDCEditAlert'; +import {CDCAlertView} from './CDCAlertView'; interface ICDCFilterDialogProps { filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; filtersByCDC: {[cdcId: string]: IFilter[]}; - compareColumnOptions: {label: string, value: string}[]; + compareColumnOptions: string[]; } export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, compare_columns: null}; @@ -101,34 +101,22 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp )}
    : null}
    - {selectedAlert ? - - : - creationMode ? - - : null + : null }
    @@ -168,11 +156,11 @@ export class CDCFilterDialogClass { 'demo': [ createCDCGroupingFilter(uuidv4()), createCDCTextFilter(uuidv4(), 'Select...', null), - createCDCCheckboxFilter(uuidv4(), {['Eins']: undefined, ['Zwei']: undefined, ['Drei']: undefined}), + createCDCCheckboxFilter(uuidv4(), {}), createCDCRangeFilter(uuidv4(), 'id', {min: 1, max: 10}), ] - }} - compareColumnOptions={[{label: "name", value: "name"}, {label: "street", value: "address.street"}, {label: "zipcode", value: "address.zipcode"}, {label: "city", value: "address.city"}, {label: "id", value: "id"}]} + }} + compareColumnOptions={['id', 'name', 'address.street', 'adress.city', 'address.zipcode']} />, this.node ); diff --git a/src/cdc/CDCRangeFilter.tsx b/src/cdc/CDCRangeFilter.tsx index 62ab392f6..774506829 100644 --- a/src/cdc/CDCRangeFilter.tsx +++ b/src/cdc/CDCRangeFilter.tsx @@ -31,14 +31,18 @@ export function createCDCRangeFilter(id: string, field: string, value: {min: num } function CDCRangeFilterComponent({value, onValueChanged, disabled, config, field}) { - return
    -
    {field}
    - onValueChanged?.(e)} - /> + return
    +
    +
    {field}
    +
    +
    + onValueChanged?.(e)} + /> +
    ; } diff --git a/src/cdc/FilterCard.tsx b/src/cdc/FilterCard.tsx index 33b146dd6..53c42d8dd 100644 --- a/src/cdc/FilterCard.tsx +++ b/src/cdc/FilterCard.tsx @@ -41,72 +41,73 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, style={disableRemoving && disableDragging ? {height: '93%'} : {}} >
    -
    - {disableDragging || disableFilter ? null : ( - - )} -
    -
    - {onChange && hasChildren && filter?.children?.length > 1 ? ( - - ) : null} - {!disableRemoving && onDelete && !disableFilter ? ( - - ) : null} -
    + value={filter.value} + config={filterComponent.config} + field={filter.field} + onFieldChanged={ + onFieldChanged + ? (field) => onFieldChanged(filter, field) + : undefined + } + onValueChanged={ + onValueChanged + ? (value) => onValueChanged(filter, value) + : undefined + } + /> + {filter.type === 'group' ? +
    +
    Group Filter
    + {onChange && hasChildren && filter?.children?.length > 1 ? ( + + + + ) : null} +
    : null} +
    + ) : null}
    - - {/*
    Card subtitle
    */} - {/*

    - Some quick example text to build on the card title and make up the - bulk of the card's content. -

    */} - - {filterComponent?.component ? ( -
    - onFieldChanged(filter, field) - : undefined - } - onValueChanged={ - onValueChanged - ? (value) => onValueChanged(filter, value) - : undefined - } - /> +
    + {!disableRemoving && onDelete && !disableFilter ? ( + + ) : null}
    - ) : null} +
    {onDrop && (hasChildren || !filterComponent.component.disableDropping) && !disableFilter ? ( { } export async function saveAlert(alert: IUploadAlert): Promise { - alert.compare = alert.compare_columns?.map((cc) => cc.value); - delete alert.compare_columns; return Ajax.send(AppContext.getInstance().api2absURL(`/tdp/cdc/alert`), alert, 'POST', 'JSON', 'application/json'); } diff --git a/src/cdc/interfaces.ts b/src/cdc/interfaces.ts index 12feac057..b21c855cd 100644 --- a/src/cdc/interfaces.ts +++ b/src/cdc/interfaces.ts @@ -5,7 +5,7 @@ export interface IFilterComponent { onFieldChanged?: (field: string) => void; disabled: boolean; config: any; - field: any; + field?: any; }) => JSX.Element; disableDropping?: boolean; } @@ -89,7 +89,7 @@ export interface IAlert { modification_date: string; confirmed_data: any; confirmation_date: Date; - compare_columns: {label: string, value: string}[]; + compare_columns: string[]; } //TODO: remove any export interface IUploadAlert extends Pick { diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index 908243e73..95f5665c7 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -58,7 +58,7 @@ class CDCAlertArgsSchema(Schema): enable_mail_notification = fields.Boolean() cdc_id = fields.String() filter = fields.Nested(Filter, required=True) - compare = fields.List(fields.String()) + compare_column = fields.List(fields.String()) # TODO: Remove and use postgres diff --git a/tdp_core/cdc/CDCManager.py b/tdp_core/cdc/CDCManager.py index 42f67ea9c..c6a135296 100644 --- a/tdp_core/cdc/CDCManager.py +++ b/tdp_core/cdc/CDCManager.py @@ -42,7 +42,7 @@ def run_alert(self, alert: CDCAlert): **item } for field in fields: - # new_item[field] = FieldFilterMixin.access(item, field) + # new_item[field] = FieldFilterMixin.access(item, field) new[i] = new_item # Filter new entry From 6ea78fcaac6f3f6b10747ccca6189016e719236e Mon Sep 17 00:00:00 2001 From: Michael Puehringer Date: Thu, 11 Nov 2021 15:06:39 +0100 Subject: [PATCH 28/40] Unified front- and backend for CDCs --- dist/cdc/AccordianItem.d.ts | 10 - dist/cdc/AccordianItem.js | 10 - dist/cdc/AccordianItem.js.map | 1 - dist/cdc/AccordionItem.d.ts | 11 - dist/cdc/AccordionItem.js | 11 - dist/cdc/AccordionItem.js.map | 1 - dist/cdc/AccordionView.d.ts | 11 - dist/cdc/AccordionView.js | 11 - dist/cdc/AccordionView.js.map | 1 - dist/cdc/CDCAlertView.js.map | 1 - dist/cdc/CDCCheckboxFilter.js.map | 1 - dist/cdc/CDCCreateAlert.js.map | 1 - dist/cdc/CDCCreateEditAlert.d.ts | 18 - dist/cdc/CDCCreateEditAlert.js | 35 -- dist/cdc/CDCCreateEditAlert.js.map | 1 - dist/cdc/CDCEditAlert.d.ts | 23 -- dist/cdc/CDCEditAlert.js | 324 ------------------ dist/cdc/CDCEditAlert.js.map | 1 - dist/cdc/CDCEditFilter.d.ts | 7 - dist/cdc/CDCEditFilter.js | 25 -- dist/cdc/CDCEditFilter.js.map | 1 - dist/cdc/CDCFilterComponent.js.map | 1 - dist/cdc/CDCFilterDialog.d.ts | 4 +- dist/cdc/CDCFilterDialog.js | 39 ++- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/CDCGroupingFilter.js.map | 1 - dist/cdc/CDCRangeFilter.js.map | 1 - dist/cdc/CDCTextFilter.js.map | 1 - dist/cdc/CheckboxFilter.d.ts | 12 - dist/cdc/CheckboxFilter.js | 32 -- dist/cdc/CheckboxFilter.js.map | 1 - dist/cdc/DropZone.js.map | 1 - dist/cdc/FilterCard.js.map | 1 - dist/cdc/GroupingFilter.d.ts | 2 - dist/cdc/GroupingFilter.js | 18 - dist/cdc/GroupingFilter.js.map | 1 - dist/cdc/RangeFilter.d.ts | 6 - dist/cdc/RangeFilter.js | 23 -- dist/cdc/RangeFilter.js.map | 1 - dist/cdc/TextFilter.d.ts | 17 - dist/cdc/TextFilter.js | 69 ---- dist/cdc/TextFilter.js.map | 1 - dist/cdc/{ => alert}/CDCAlertView.d.ts | 4 +- dist/cdc/{ => alert}/CDCAlertView.js | 107 +++--- dist/cdc/alert/CDCAlertView.js.map | 1 + dist/cdc/{ => alert}/CDCCreateAlert.d.ts | 2 +- dist/cdc/{ => alert}/CDCCreateAlert.js | 26 +- dist/cdc/alert/CDCCreateAlert.js.map | 1 + dist/cdc/alert/index.d.ts | 2 + dist/cdc/alert/index.js | 3 + dist/cdc/alert/index.js.map | 1 + .../CDCFilterCard.d.ts} | 2 +- .../CDCFilterCard.js} | 4 +- dist/cdc/creator/CDCFilterCard.js.map | 1 + .../CDCFilterCreator.d.ts} | 6 +- .../CDCFilterCreator.js} | 8 +- dist/cdc/creator/CDCFilterCreator.js.map | 1 + dist/cdc/{ => creator}/DropZone.d.ts | 2 +- dist/cdc/{ => creator}/DropZone.js | 2 +- dist/cdc/creator/DropZone.js.map | 1 + dist/cdc/creator/index.d.ts | 2 + dist/cdc/creator/index.js | 4 + dist/cdc/creator/index.js.map | 1 + dist/cdc/{ => filter}/CDCCheckboxFilter.d.ts | 2 +- dist/cdc/{ => filter}/CDCCheckboxFilter.js | 4 +- dist/cdc/filter/CDCCheckboxFilter.js.map | 1 + dist/cdc/{ => filter}/CDCGroupingFilter.d.ts | 2 +- dist/cdc/{ => filter}/CDCGroupingFilter.js | 2 + dist/cdc/filter/CDCGroupingFilter.js.map | 1 + dist/cdc/{ => filter}/CDCRangeFilter.d.ts | 2 +- dist/cdc/{ => filter}/CDCRangeFilter.js | 6 +- dist/cdc/filter/CDCRangeFilter.js.map | 1 + dist/cdc/{ => filter}/CDCTextFilter.d.ts | 2 +- dist/cdc/{ => filter}/CDCTextFilter.js | 6 +- dist/cdc/filter/CDCTextFilter.js.map | 1 + dist/cdc/filter/index.d.ts | 4 + dist/cdc/filter/index.js | 5 + dist/cdc/filter/index.js.map | 1 + dist/cdc/index.d.ts | 5 + dist/cdc/index.js | 5 + dist/cdc/index.js.map | 2 +- dist/cdc/interface.d.ts | 60 ---- dist/cdc/interface.js | 58 ---- dist/cdc/interface.js.map | 1 - dist/cdc/interfaces.d.ts | 14 +- dist/cdc/interfaces.js.map | 2 +- package.json | 3 +- src/cdc/CDCFilterDialog.tsx | 42 +-- src/cdc/{ => alert}/CDCAlertView.tsx | 133 ++++--- src/cdc/{ => alert}/CDCCreateAlert.tsx | 34 +- src/cdc/alert/index.ts | 2 + .../CDCFilterCard.tsx} | 2 +- .../CDCFilterCreator.tsx} | 12 +- src/cdc/{ => creator}/DropZone.tsx | 3 +- src/cdc/creator/index.ts | 3 + src/cdc/{ => filter}/CDCCheckboxFilter.tsx | 10 +- src/cdc/{ => filter}/CDCGroupingFilter.tsx | 4 +- src/cdc/{ => filter}/CDCRangeFilter.tsx | 8 +- src/cdc/{ => filter}/CDCTextFilter.tsx | 19 +- src/cdc/filter/index.ts | 4 + src/cdc/index.ts | 5 + src/cdc/interfaces.ts | 47 +-- tdp_core/cdc/BaseCDC.py | 3 +- tdp_core/cdc/CDCAlert.py | 24 +- tdp_core/cdc/CDCManager.py | 80 +---- ...{DemoCDC.py => JSONPlaceholderPostsCDC.py} | 14 +- tdp_core/cdc/JSONPlaceholderUserCDC.py | 17 + tdp_core/cdc/api.py | 39 +-- tdp_core/cdc/filter.py | 21 +- 109 files changed, 446 insertions(+), 1190 deletions(-) delete mode 100644 dist/cdc/AccordianItem.d.ts delete mode 100644 dist/cdc/AccordianItem.js delete mode 100644 dist/cdc/AccordianItem.js.map delete mode 100644 dist/cdc/AccordionItem.d.ts delete mode 100644 dist/cdc/AccordionItem.js delete mode 100644 dist/cdc/AccordionItem.js.map delete mode 100644 dist/cdc/AccordionView.d.ts delete mode 100644 dist/cdc/AccordionView.js delete mode 100644 dist/cdc/AccordionView.js.map delete mode 100644 dist/cdc/CDCAlertView.js.map delete mode 100644 dist/cdc/CDCCheckboxFilter.js.map delete mode 100644 dist/cdc/CDCCreateAlert.js.map delete mode 100644 dist/cdc/CDCCreateEditAlert.d.ts delete mode 100644 dist/cdc/CDCCreateEditAlert.js delete mode 100644 dist/cdc/CDCCreateEditAlert.js.map delete mode 100644 dist/cdc/CDCEditAlert.d.ts delete mode 100644 dist/cdc/CDCEditAlert.js delete mode 100644 dist/cdc/CDCEditAlert.js.map delete mode 100644 dist/cdc/CDCEditFilter.d.ts delete mode 100644 dist/cdc/CDCEditFilter.js delete mode 100644 dist/cdc/CDCEditFilter.js.map delete mode 100644 dist/cdc/CDCFilterComponent.js.map delete mode 100644 dist/cdc/CDCGroupingFilter.js.map delete mode 100644 dist/cdc/CDCRangeFilter.js.map delete mode 100644 dist/cdc/CDCTextFilter.js.map delete mode 100644 dist/cdc/CheckboxFilter.d.ts delete mode 100644 dist/cdc/CheckboxFilter.js delete mode 100644 dist/cdc/CheckboxFilter.js.map delete mode 100644 dist/cdc/DropZone.js.map delete mode 100644 dist/cdc/FilterCard.js.map delete mode 100644 dist/cdc/GroupingFilter.d.ts delete mode 100644 dist/cdc/GroupingFilter.js delete mode 100644 dist/cdc/GroupingFilter.js.map delete mode 100644 dist/cdc/RangeFilter.d.ts delete mode 100644 dist/cdc/RangeFilter.js delete mode 100644 dist/cdc/RangeFilter.js.map delete mode 100644 dist/cdc/TextFilter.d.ts delete mode 100644 dist/cdc/TextFilter.js delete mode 100644 dist/cdc/TextFilter.js.map rename dist/cdc/{ => alert}/CDCAlertView.d.ts (92%) rename dist/cdc/{ => alert}/CDCAlertView.js (65%) create mode 100644 dist/cdc/alert/CDCAlertView.js.map rename dist/cdc/{ => alert}/CDCCreateAlert.d.ts (91%) rename dist/cdc/{ => alert}/CDCCreateAlert.js (78%) create mode 100644 dist/cdc/alert/CDCCreateAlert.js.map create mode 100644 dist/cdc/alert/index.d.ts create mode 100644 dist/cdc/alert/index.js create mode 100644 dist/cdc/alert/index.js.map rename dist/cdc/{FilterCard.d.ts => creator/CDCFilterCard.d.ts} (93%) rename dist/cdc/{FilterCard.js => creator/CDCFilterCard.js} (98%) create mode 100644 dist/cdc/creator/CDCFilterCard.js.map rename dist/cdc/{CDCFilterComponent.d.ts => creator/CDCFilterCreator.d.ts} (57%) rename dist/cdc/{CDCFilterComponent.js => creator/CDCFilterCreator.js} (94%) create mode 100644 dist/cdc/creator/CDCFilterCreator.js.map rename dist/cdc/{ => creator}/DropZone.d.ts (85%) rename dist/cdc/{ => creator}/DropZone.js (95%) create mode 100644 dist/cdc/creator/DropZone.js.map create mode 100644 dist/cdc/creator/index.d.ts create mode 100644 dist/cdc/creator/index.js create mode 100644 dist/cdc/creator/index.js.map rename dist/cdc/{ => filter}/CDCCheckboxFilter.d.ts (90%) rename dist/cdc/{ => filter}/CDCCheckboxFilter.js (93%) create mode 100644 dist/cdc/filter/CDCCheckboxFilter.js.map rename dist/cdc/{ => filter}/CDCGroupingFilter.d.ts (76%) rename dist/cdc/{ => filter}/CDCGroupingFilter.js (85%) create mode 100644 dist/cdc/filter/CDCGroupingFilter.js.map rename dist/cdc/{ => filter}/CDCRangeFilter.d.ts (89%) rename dist/cdc/{ => filter}/CDCRangeFilter.js (89%) create mode 100644 dist/cdc/filter/CDCRangeFilter.js.map rename dist/cdc/{ => filter}/CDCTextFilter.d.ts (90%) rename dist/cdc/{ => filter}/CDCTextFilter.js (93%) create mode 100644 dist/cdc/filter/CDCTextFilter.js.map create mode 100644 dist/cdc/filter/index.d.ts create mode 100644 dist/cdc/filter/index.js create mode 100644 dist/cdc/filter/index.js.map delete mode 100644 dist/cdc/interface.d.ts delete mode 100644 dist/cdc/interface.js delete mode 100644 dist/cdc/interface.js.map rename src/cdc/{ => alert}/CDCAlertView.tsx (70%) rename src/cdc/{ => alert}/CDCCreateAlert.tsx (80%) create mode 100644 src/cdc/alert/index.ts rename src/cdc/{FilterCard.tsx => creator/CDCFilterCard.tsx} (98%) rename src/cdc/{CDCFilterComponent.tsx => creator/CDCFilterCreator.tsx} (92%) rename src/cdc/{ => creator}/DropZone.tsx (93%) create mode 100644 src/cdc/creator/index.ts rename src/cdc/{ => filter}/CDCCheckboxFilter.tsx (87%) rename src/cdc/{ => filter}/CDCGroupingFilter.tsx (74%) rename src/cdc/{ => filter}/CDCRangeFilter.tsx (87%) rename src/cdc/{ => filter}/CDCTextFilter.tsx (73%) create mode 100644 src/cdc/filter/index.ts rename tdp_core/cdc/{DemoCDC.py => JSONPlaceholderPostsCDC.py} (52%) create mode 100644 tdp_core/cdc/JSONPlaceholderUserCDC.py diff --git a/dist/cdc/AccordianItem.d.ts b/dist/cdc/AccordianItem.d.ts deleted file mode 100644 index d9cb08adc..000000000 --- a/dist/cdc/AccordianItem.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -interface IAccordionItem { - children: JSX.Element; - index: number; - title: string; - parentId: string; - show?: boolean; -} -export default function AccordionItem({ children, index, title, parentId, show }: IAccordionItem): JSX.Element; -export {}; diff --git a/dist/cdc/AccordianItem.js b/dist/cdc/AccordianItem.js deleted file mode 100644 index cbe32694c..000000000 --- a/dist/cdc/AccordianItem.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -export default function AccordionItem({ children, index, title, parentId, show }) { - // index: number, title: string, parentId: string, , show?: boolean - console.log(this); - return (React.createElement("div", { className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId.trim()}` }, children))); -} -//# sourceMappingURL=AccordianItem.js.map \ No newline at end of file diff --git a/dist/cdc/AccordianItem.js.map b/dist/cdc/AccordianItem.js.map deleted file mode 100644 index da088194d..000000000 --- a/dist/cdc/AccordianItem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AccordianItem.js","sourceRoot":"","sources":["../../src/cdc/AccordianItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAiB;IAE5F,mEAAmE;IACnE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAEf,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;QAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;YACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;QACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,IACvK,QAAQ,CACL,CACF,CACP,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/AccordionItem.d.ts b/dist/cdc/AccordionItem.d.ts deleted file mode 100644 index 1af81c883..000000000 --- a/dist/cdc/AccordionItem.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// -interface IAccordionViewProps { - parentId: string; - data: { - title: string; - JSX: JSX.Element; - show?: boolean; - }[]; -} -export declare function AccordionView({ parentId, data }: IAccordionViewProps): JSX.Element; -export {}; diff --git a/dist/cdc/AccordionItem.js b/dist/cdc/AccordionItem.js deleted file mode 100644 index f7fa4623c..000000000 --- a/dist/cdc/AccordionItem.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -export function AccordionView({ parentId, data }) { - const accordionItem = (index, title, JSX, show) => { - return (React.createElement("div", { className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, JSX))); - }; - return (React.createElement("div", { className: "accordion", id: parentId }, data.map((d, i) => { accordionItem(i, d.title, d.JSX, d.show); }))); -} -//# sourceMappingURL=AccordionItem.js.map \ No newline at end of file diff --git a/dist/cdc/AccordionItem.js.map b/dist/cdc/AccordionItem.js.map deleted file mode 100644 index 4b010274c..000000000 --- a/dist/cdc/AccordionItem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../src/cdc/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAsB;IACjE,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,GAAgB,EAAE,IAAc,EAAE,EAAE;QACvF,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,EAAE,IAChK,GAAG,CACA,CACF,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAE,QAAQ,IACpC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA,CAAA,CAAC,CAAC,CAC3D,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/AccordionView.d.ts b/dist/cdc/AccordionView.d.ts deleted file mode 100644 index 1af81c883..000000000 --- a/dist/cdc/AccordionView.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// -interface IAccordionViewProps { - parentId: string; - data: { - title: string; - JSX: JSX.Element; - show?: boolean; - }[]; -} -export declare function AccordionView({ parentId, data }: IAccordionViewProps): JSX.Element; -export {}; diff --git a/dist/cdc/AccordionView.js b/dist/cdc/AccordionView.js deleted file mode 100644 index 4aa9ec1c8..000000000 --- a/dist/cdc/AccordionView.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -export function AccordionView({ parentId, data }) { - const accordionItem = (index, title, JSX, show) => { - return (React.createElement("div", { key: index, className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId.trim()}` }, JSX))); - }; - return (React.createElement("div", { className: "accordion", id: parentId.trim() }, data.map((d, i) => accordionItem(i, d.title, d.JSX, d.show)))); -} -//# sourceMappingURL=AccordionView.js.map \ No newline at end of file diff --git a/dist/cdc/AccordionView.js.map b/dist/cdc/AccordionView.js.map deleted file mode 100644 index 7355abed7..000000000 --- a/dist/cdc/AccordionView.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AccordionView.js","sourceRoot":"","sources":["../../src/cdc/AccordionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAsB;IACjE,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,GAAgB,EAAE,IAAc,EAAE,EAAE;QACvF,OAAO,CACL,6BAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,gBAAgB;YACzC,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IACrK,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,kCAAkC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,IACvK,GAAG,CACA,CACF,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,IAC3C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CACzD,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCAlertView.js.map b/dist/cdc/CDCAlertView.js.map deleted file mode 100644 index c18ac6ddd..000000000 --- a/dist/cdc/CDCAlertView.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCAlertView.js","sourceRoot":"","sources":["../../src/cdc/CDCAlertView.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAkBxD,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAgB;;IACnN,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IACnE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3D,KA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;4BACvB,+BAAO,SAAS,EAAC,YAAY,yBAA2B;4BACxD,6BAAK,SAAS,EAAC,YAAY;gCACzB,+BAAO,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;gCAC9M,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;oBACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC3B,oBAAC,kBAAkB,IAAC,eAAe,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;wBAC/L,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqKE"} \ No newline at end of file diff --git a/dist/cdc/CDCCheckboxFilter.js.map b/dist/cdc/CDCCheckboxFilter.js.map deleted file mode 100644 index 68e3ca10d..000000000 --- a/dist/cdc/CDCCheckboxFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,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Q,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACrB,SAAS,EAAC,kBAAkB,EAC5B,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAClD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAC7C;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,KAAK,CACA,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.js.map b/dist/cdc/CDCCreateAlert.js.map deleted file mode 100644 index 2688c8d69..000000000 --- a/dist/cdc/CDCCreateAlert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAgBxD,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAE,oBAAoB,EAAkB;IAC1L,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY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BACvB,+BAAO,SAAS,EAAC,YAAY,oBAAsB;oBACnD,oBAAC,MAAM,IACL,OAAO,QACP,iBAAiB,EAAE,KAAK,EACxB,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,SAAS,CAAC,eAAe,EAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,eAAe,EAAE,CAAC,GAAG,CAAC,CAAC,EAAC,CAAC,GACtE,CACE;gBACN,6BAAK,SAAS,EAAC,UAAU;oBACvB,+BAAO,SAAS,EAAC,YAAY,yBAA2B;oBACxD,6BAAK,SAAS,EAAC,YAAY;wBACzB,+BAAO,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;wBAC9L,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;YACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3B,oBAAC,kBAAkB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;gBAC3J,CAAC;oBACD,mEAAwC,CAEtC,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateEditAlert.d.ts b/dist/cdc/CDCCreateEditAlert.d.ts deleted file mode 100644 index fe14073ab..000000000 --- a/dist/cdc/CDCCreateEditAlert.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// -import { ICDCFormData } from "."; -import { IAlert, IFilter, IFilterComponent } from "./interface"; -interface ICDCCreateEditAlert { - formData: ICDCFormData; - setFormData: (formData: ICDCFormData) => void; - selectedAlert?: IAlert; - filterSelection: IFilter[] | undefined; - filter: IFilter; - setFilter: (filter: IFilter) => void; - editMode?: boolean; - setEditMode?: (editMode: boolean) => void; - filterComponents: { - [key: string]: IFilterComponent; - }; -} -export declare function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter, editMode, setEditMode, filterComponents }: ICDCCreateEditAlert): JSX.Element; -export {}; diff --git a/dist/cdc/CDCCreateEditAlert.js b/dist/cdc/CDCCreateEditAlert.js deleted file mode 100644 index 888eebf4a..000000000 --- a/dist/cdc/CDCCreateEditAlert.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from "react"; -import { CDCFilterComponent } from "./CDCFilterComponent"; -import { v4 as uuidv4 } from 'uuid'; -export function CDCCreateEditAlert({ formData, setFormData, filterSelection, selectedAlert, filter, setFilter, editMode, setEditMode, filterComponents }) { - const generalInformation = formData ? - (React.createElement(React.Fragment, null, - React.createElement("div", { className: "mb-3" }, - React.createElement("label", { className: "form-label" }, "Name"), - selectedAlert && !editMode ? - React.createElement("p", null, formData.name) - : - React.createElement("input", { type: "text", className: "form-control", value: formData.name, onChange: (e) => setFormData({ ...formData, name: e.target.value }) })), - React.createElement("div", { className: "mb-3" }, - React.createElement("label", { className: "form-label" }, "CDC"), - selectedAlert && !editMode ? - React.createElement("p", null, formData.name) - : - React.createElement("input", { type: "text", className: "form-control", value: formData.cdc_id, onChange: (e) => setFormData({ ...formData, cdc_id: e.target.value }) })), - React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: selectedAlert && !editMode, checked: formData.enable_mail_notification, onChange: (e) => setFormData({ ...formData, enable_mail_notification: e.target.checked }) }), - React.createElement("label", { className: "form-check-label ms-2" }, "Email notification"), - React.createElement("div", { className: "mb-3 form-check" }))) : null; - const accordionItem = (title, parentId, child, show) => { - const index = uuidv4(); - parentId = parentId.trim(); - return (React.createElement("div", { key: index, className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse${show ? " show" : ""}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, child))); - }; - return (React.createElement("div", { className: "accordion", id: "createAlert" }, - accordionItem('Alert overview', 'createAlert', generalInformation, true), - selectedAlert ? accordionItem('New literature', 'createAlert', React.createElement("p", null, "text aufgeklappt")) : null, - accordionItem('Filter settings', 'createAlert', !filter ? null : React.createElement(CDCFilterComponent, { filterSelection: selectedAlert && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter })))); -} -//# sourceMappingURL=CDCCreateEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCCreateEditAlert.js.map b/dist/cdc/CDCCreateEditAlert.js.map deleted file mode 100644 index e16892866..000000000 --- a/dist/cdc/CDCCreateEditAlert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCCreateEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCCreateEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAclC,MAAM,UAAU,kBAAkB,CAAC,EAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAsB;IACzK,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC;QACnC,CAAC;YACC,6BAAK,SAAS,EAAC,MAAM;gBACnB,+BAAO,SAAS,EAAC,YAAY,WAAa;gBACzC,aAAa,IAAI,CAAC,QAAQ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lert.d.ts b/dist/cdc/CDCEditAlert.d.ts deleted file mode 100644 index 256bf87ba..000000000 --- a/dist/cdc/CDCEditAlert.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interfaces'; -interface ICDCEditAlert { - alertData: IUploadAlert; - setAlertData: (formData: IUploadAlert) => void; - filterSelection: IFilter[] | undefined; - filter: IFilter; - setFilter: (filter: IFilter) => void; - filterComponents: { - [key: string]: { - component: IFilterComponent; - config?: any; - }; - }; - onAlertChanged: (id?: number) => void; - selectedAlert?: IAlert; - cdcs: string[]; - compareColumnOptions: string[]; - creationMode: boolean; - setCreationMode: (mode: boolean) => void; -} -export declare function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode }: ICDCEditAlert): JSX.Element; -export {}; diff --git a/dist/cdc/CDCEditAlert.js b/dist/cdc/CDCEditAlert.js deleted file mode 100644 index 87dfb3219..000000000 --- a/dist/cdc/CDCEditAlert.js +++ /dev/null @@ -1,324 +0,0 @@ -import get from 'lodash.get'; -import React from 'react'; -import Select from 'react-select'; -import { runAlert } from '.'; -import { confirmAlertById, deleteAlert, editAlert, saveAlert } from './api'; -import { CDCFilterComponent } from './CDCFilterComponent'; -export function CDCEditAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode }) { - var _a, _b; - const [editMode, setEditMode] = React.useState(false); - const [deleteMode, setDeleteMode] = React.useState(false); - const [validName, setValidName] = React.useState(true); - const [validFilter, setValidFilter] = React.useState(true); - React.useEffect(() => { - setEditMode(false); - setDeleteMode(false); - }, [selectedAlert]); - React.useEffect(() => { - setValidFilter((filter === null || filter === void 0 ? void 0 : filter.children.length) > 0); - }, [filter]); - React.useEffect(() => { - var _a; - setValidName(((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0); - }, [alertData.name]); - const confirmChanges = async (id) => { - const alert = await confirmAlertById(id); - onAlertChanged(alert.id); - }; - const onCreateSave = async () => { - if (validFilter && validName) { - const newAlert = await saveAlert({ ...alertData, filter }) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } - }; - const onEditSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter }) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } - }; - const onDiscard = () => { - setEditMode(false); - setAlertData(selectedAlert); - setFilter(selectedAlert.filter); - }; - const onDelete = async (id) => { - setEditMode(false); - await deleteAlert(id); - onAlertChanged(); - }; - const literature = () => { - var _a, _b, _c, _d, _e, _f; - if (selectedAlert.latest_diff) { - const change = new Map(); - (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.values_changed) === null || _b === void 0 ? void 0 : _b.map((d) => { - const nestedField = d.field.map((f) => f).join("."); - if (change.has(d.id)) { - change.set(d.id, change.get(d.id).set(nestedField, { old: d.old_value, new: d.new_value })); - } - else { - change.set(d.id, new Map().set(nestedField, { old: d.old_value, new: d.new_value })); - } - }); - return (React.createElement(React.Fragment, null, - React.createElement("h6", null, "Changed data:"), - React.createElement("table", { className: "table table-light mt-2" }, - React.createElement("thead", null, - React.createElement("tr", null, (_c = selectedAlert.compare_columns) === null || _c === void 0 ? void 0 : _c.map((field, i) => React.createElement("th", { key: `header-${i}`, scope: "col" }, field)))), - React.createElement("tbody", null, (_d = selectedAlert.latest_diff.dictionary_item_added) === null || _d === void 0 ? void 0 : - _d.map((d) => { - var _a; - const data = selectedAlert.latest_fetched_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-success" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `added-${i}` }, get(data, field))))); - }), (_e = selectedAlert.latest_diff.dictionary_item_removed) === null || _e === void 0 ? void 0 : - _e.map((d) => { - var _a; - const data = selectedAlert.confirmed_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-danger" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `removed-${i}` }, get(data, field))))); - }), (_f = [...change.keys()]) === null || _f === void 0 ? void 0 : - _f.map((id, i) => { - var _a, _b; - const oldData = (_a = selectedAlert.confirmed_data) === null || _a === void 0 ? void 0 : _a.find(a => a.id === id); - return (React.createElement("tr", { key: `tr-changed-${i}`, className: "table-primary" }, (_b = selectedAlert.compare_columns) === null || _b === void 0 ? void 0 : _b.map((field, index) => change.get(id).has(field) ? React.createElement("td", { key: `changed-${i}-${index}` }, - React.createElement("s", null, change.get(id).get(field).old), - " ", - change.get(id).get(field).new) : React.createElement("td", { key: `changed-${i}-${index}` }, get(oldData, field))))); - }))), - React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))); - } - return React.createElement("p", null, "No new data available"); - }; - const editButton = !editMode && !deleteMode && !creationMode ? (React.createElement(React.Fragment, null, - React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, - React.createElement("i", { className: "fas fa-pencil-alt" })), - React.createElement("button", { title: "Delete Alert", className: "btn btn-text-secondary", onClick: () => setDeleteMode(true) }, - React.createElement("i", { className: "fas fa-trash" })))) : (editMode || creationMode ? React.createElement(React.Fragment, null, - React.createElement("button", { title: "Save changes", className: "btn btn-text-secondary", onClick: editMode ? () => onEditSave() : () => onCreateSave() }, - React.createElement("i", { className: "fas fa-save" })), - React.createElement("button", { title: "Discard changes", className: "btn btn-text-secondary ms-1", onClick: editMode ? () => onDiscard() : () => setCreationMode(false) }, - React.createElement("i", { className: "fas fa-times" }))) : React.createElement(React.Fragment, null, - React.createElement("button", { title: "Delete", className: "btn btn-text-secondary", onClick: () => onDelete(selectedAlert.id) }, - React.createElement("i", { className: "fas fa-check" })), - React.createElement("button", { title: "No Delete", className: "btn btn-text-secondary ms-1", onClick: () => setDeleteMode(false) }, - React.createElement("i", { className: "fas fa-times" })))); - return (React.createElement(React.Fragment, null, - React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, - React.createElement("h5", null, "Your options"), - React.createElement("small", null, editButton)), - React.createElement("div", { className: "accordion", id: "editAlert" }, - !editMode && !creationMode ? - React.createElement("div", { key: "one", className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: "heading-one" }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_a = new Date(selectedAlert.latest_compare_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()) : 'No new data'}`)), - React.createElement("div", { id: "collapse-one", className: "p-4 accordion-collapse collapse", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, literature())) - : null, - React.createElement("div", { key: "two", className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: "heading-two" }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-two", "aria-expanded": "true", "aria-controls": "collapse-two" }, "Alert overview")), - React.createElement("div", { id: "collapse-two", className: `p-4 accordion-collapse${editMode || creationMode ? ' collapse' : ''}`, "aria-labelledby": "heading-two", "data-bs-parent": "#editAlert" }, - React.createElement("div", { className: "row mb-3" }, - React.createElement("div", { className: "mb-3 col" }, - React.createElement("label", { className: "form-label" }, "Name"), - !creationMode && !editMode ? - React.createElement("h6", null, alertData.name) - : - React.createElement(React.Fragment, null, - React.createElement("input", { type: "text", className: `form-control${validName ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }), required: true }), - validName ? null : - React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!"))), - React.createElement("div", { className: "mb-3 col pe-2" }, - React.createElement("label", { className: "form-label" }, "CDC"), - React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), - React.createElement("div", { className: "mb-3 col pe-2" }, - React.createElement("label", { className: "form-label" }, "Change Fields"), - React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumnOptions.map((col) => { return { label: col, value: col }; }), value: (_b = alertData.compare_columns) === null || _b === void 0 ? void 0 : _b.map((col) => { return { label: col, value: col }; }), onChange: (e) => setAlertData({ ...alertData, compare_columns: [...e.map((col) => col.value)] }) })), - React.createElement("div", { className: "mb-3 col" }, - React.createElement("label", { className: "form-label" }, "Email notification"), - React.createElement("div", { className: "form-check" }, - React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: true, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), - React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), - React.createElement("div", null, filterSelection || !filter ? - React.createElement(CDCFilterComponent, { filterSelection: !creationMode || !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) - : - React.createElement("p", null, "No filters available for this cdc"))))))); -} -/* -const generalInformation = - <> -
    -
    - - {!editMode ? -
    {alertData.name}
    - : - <> setAlertData({...alertData, name: e.target.value})} /> - {validName ? null : -
    - Name must not be empty! -
    } - } -
    -
    - - setAlertData({...alertData, compare_columns: [...e]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    - ; - - -const alertInformation = -<> -
    -
    - -
    {alertData.name}
    -
    -
    - - -
    -
    - -
    - - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    -; - -const onCreateSave = async () => { - if (validFilter && validName) { - const newAlert = await saveAlert({...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } -}; - - const onEditSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } -}; - -const alterAlert = -<> -
    -
    -
    - - setAlertData({...alertData, name: e.target.value})} required /> - {validName ? null : -
    - Name must not be empty! -
    } -
    -
    - - setAlertData({...alertData, compare_columns: [...e]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    - } -
    -
    -; - -*/ -//# sourceMappingURL=CDCEditAlert.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditAlert.js.map b/dist/cdc/CDCEditAlert.js.map deleted file mode 100644 index ddbdb2f80..000000000 --- a/dist/cdc/CDCEditAlert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCEditAlert.js","sourceRoot":"","sources":["../../src/cdc/CDCEditAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAkBxD,MAAM,UAAU,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AI;wBAC/L,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqKE"} \ No newline at end of file diff --git a/dist/cdc/CDCEditFilter.d.ts b/dist/cdc/CDCEditFilter.d.ts deleted file mode 100644 index b0dd03d4c..000000000 --- a/dist/cdc/CDCEditFilter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { IAlert } from "./interface"; -interface ICDCEditFilterProps { - selectedAlert: IAlert; -} -export declare function CDCEditFilter({ selectedAlert }: ICDCEditFilterProps): JSX.Element; -export {}; diff --git a/dist/cdc/CDCEditFilter.js b/dist/cdc/CDCEditFilter.js deleted file mode 100644 index 7fd909b54..000000000 --- a/dist/cdc/CDCEditFilter.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import { CDCFilterComponent } from "./CDCFilterComponent"; -export function CDCEditFilter({ selectedAlert }) { - const accordionItem = (parentId, title, index, innerHtml, show) => { - return (React.createElement("div", { className: "accordion-item" }, - React.createElement("h2", { className: "accordion-header", id: `heading${index}` }, - React.createElement("button", { disabled: !selectedAlert, className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": `#collapse${index}`, "aria-expanded": "true", "aria-controls": `collapse${index}` }, title)), - React.createElement("div", { id: `collapse${index}`, className: `p-2 accordion-collapse collapse ${show}`, "aria-labelledby": `heading${index}`, "data-bs-parent": `#${parentId}` }, innerHtml))); - }; - return (React.createElement(React.Fragment, null, - React.createElement("h5", null, "Your options"), - React.createElement("div", { className: "accordion", id: "filterOptions" }, - accordionItem('filterOptions', 'Alert overview', 1, (React.createElement(React.Fragment, null, - React.createElement("p", null, "text aufgeklappt"), - React.createElement("p", null, "is"), - React.createElement("p", null, "written"), - React.createElement("p", null, "here"))), "show"), - accordionItem('filterOptions', 'New Literature', 2, (React.createElement(React.Fragment, null, - React.createElement("p", null, "text"), - React.createElement("p", null, "is"), - React.createElement("p", null, "written"), - React.createElement("p", null, "here")))), - accordionItem('filterOptions', 'Filter settings', 3, React.createElement(CDCFilterComponent, null))))); -} -//# sourceMappingURL=CDCEditFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CDCEditFilter.js.map b/dist/cdc/CDCEditFilter.js.map deleted file mode 100644 index bae686ce3..000000000 --- a/dist/cdc/CDCEditFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCEditFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCEditFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAOvD,MAAM,UAAU,aAAa,CAAC,EAAC,aAAa,EAAuB;IACjE,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAE,KAAa,EAAE,SAAsB,EAAE,IAAa,EAAE,EAAE;QAC9G,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,4BAAI,SAAS,EAAC,kBAAkB,EAAC,EAAE,EAAE,UAAU,KAAK,EAAE;gBACpD,gCAAQ,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,QAAQ,oBAAgB,UAAU,oBAAiB,YAAY,KAAK,EAAE,mBAAgB,MAAM,mBAAgB,WAAW,KAAK,EAAE,IAC/L,KAAK,CACC,CACN;YACL,6BAAK,EAAE,EAAE,WAAW,KAAK,EAAE,EAAE,SAAS,EAAE,mCAAmC,IAAI,EAAE,qBAAmB,UAAU,KAAK,EAAE,oBAAkB,IAAI,QAAQ,EAAE,IAClJ,SAAS,CACN,CACF,CACP,CAAA;IACH,CAAC,CAAC;IAEF,OAAO,CAAC;QACJ,+CAAqB;QACrB,6BAAK,SAAS,EAAC,WAAW,EAAC,EAAE,EAAC,eAAe;YAC1C,aAAa,CACZ,eAAe,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;gBACvC,kDAAuB;gBACvB,oCAAS;gBACT,yCAAc;gBACd,sCAAW,CACV,CAAC,EAAE,MAAM,CAAC;YACZ,aAAa,CACZ,eAAe,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;gBACvC,sCAAW;gBACX,oCAAS;gBACT,yCAAc;gBACd,sCAAW,CACV,CAAC,CAAC;YACJ,aAAa,CACZ,eAAe,EAAE,iBAAiB,EAAE,CAAC,EAAE,oBAAC,kBAAkB,OAAG,CAAC,CAC5D,CACP,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCFilterComponent.js.map b/dist/cdc/CDCFilterComponent.js.map deleted file mode 100644 index c5d09fa0a..000000000 --- a/dist/cdc/CDCFilterComponent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCFilterComponent.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAA4B,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAWlC,MAAM,UAAU,kBAAkB,CAAC,EAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAA2B;IAC3I,MAAM,QAAQ,GAAG,CAAC,SAAkB,EAAE,E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.ts index a41797089..f4540d9e8 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -12,8 +12,8 @@ interface ICDCFilterDialogProps { }; compareColumnOptions: string[]; } -export declare const DEFAULTALERTDATA: IUploadAlert; -export declare const DEFAULTFILTER: { +export declare const CDC_DEFAULT_ALERT_DATA: IUploadAlert; +export declare const CDC_DEFAULT_FILTER: { id: string; operator?: "AND" | "OR"; type: string; diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 86c4d728e..0975e799a 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -2,20 +2,17 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import { BSModal, useAsync } from '../hooks'; import { getAlerts, runAlertById } from './api'; -import { CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter } from './CDCGroupingFilter'; +import { CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter, CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter, CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './filter'; import { v4 as uuidv4 } from 'uuid'; -import { CDCTextFilter, CDCTextFilterId, createCDCTextFilter } from './CDCTextFilter'; -import { CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter } from './CDCCheckboxFilter'; -import { CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter } from './CDCRangeFilter'; -import { CDCAlertView } from './CDCAlertView'; -export const DEFAULTALERTDATA = { name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, compare_columns: null }; -export const DEFAULTFILTER = { ...createCDCGroupingFilter(uuidv4()) }; +import { CDCTextFilter, CDCTextFilterId, createCDCTextFilter } from './filter/CDCTextFilter'; +import { CDCAlertView } from './alert/CDCAlertView'; +export const CDC_DEFAULT_ALERT_DATA = { name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: null, compare_columns: null }; +export const CDC_DEFAULT_FILTER = { ...createCDCGroupingFilter(uuidv4()) }; export const runAlert = async (id) => { - const runAlert = runAlertById(id).then((alert) => { return alert; }).catch((e) => { + return runAlertById(id).then((alert) => { return alert; }).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); return null; }); - return runAlert; }; export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnOptions }) { const [selectedAlert, setSelectedAlert] = React.useState(); @@ -23,18 +20,18 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnO const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); - const [cdcs, setCdcs] = React.useState(); const { status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts } = useAsync(getAlerts, true); + // TODO: CDCs are more complex than just filters, i.e. they also have fields. + const cdcs = Object.keys(filtersByCDC); React.useEffect(() => { - setAlertData(DEFAULTALERTDATA); - setFilter(DEFAULTFILTER); - setCdcs(['demo']); + setAlertData(CDC_DEFAULT_ALERT_DATA); + setFilter(CDC_DEFAULT_FILTER); }, []); const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); - setAlertData(DEFAULTALERTDATA); - setFilter(DEFAULTFILTER); + setAlertData(CDC_DEFAULT_ALERT_DATA); + setFilter(CDC_DEFAULT_FILTER); }; const onAlertClick = async (alert) => { setAlertData(alert); @@ -94,7 +91,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnO React.createElement("small", null, !(alert === null || alert === void 0 ? void 0 : alert.latest_diff) && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${(_a = new Date(alert.confirmation_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()}`))); })) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert || creationMode ? - React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC['demo'], onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, cdcs: cdcs, compareColumnOptions: compareColumnOptions, creationMode: creationMode }) + React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC[alertData.cdc_id], onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, cdcs: cdcs, compareColumnOptions: compareColumnOptions, creationMode: creationMode }) : null))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), @@ -115,13 +112,19 @@ export class CDCFilterDialogClass { [CDCCheckboxFilterId]: { component: CDCCheckboxFilter, config: { fields: ['Eins', 'Zwei', 'Drei'] } }, [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 10 } } }, filtersByCDC: { - 'demo': [ + 'JSONPlaceholderUserCDC': [ createCDCGroupingFilter(uuidv4()), createCDCTextFilter(uuidv4(), 'Select...', null), createCDCCheckboxFilter(uuidv4(), {}), createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 10 }), + ], + 'JSONPlaceholderPostsCDC': [ + createCDCGroupingFilter(uuidv4()), + createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 100 }), ] - }, compareColumnOptions: ['id', 'name', 'address.street', 'adress.city', 'address.zipcode'] }), this.node); + }, + // TODO: This needs to be defined per CDC. Maybe we define this in the backend and fetch it via an API? + compareColumnOptions: ['id', 'name', 'address.street', 'adress.city', 'address.zipcode', 'title', 'body'] }), this.node); } } //# sourceMappingURL=CDCFilterDialog.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 29733b15b..411cdfca7 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRo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M,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC;oBAChD,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC;oBACrC,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAC,CAAC;iBACxD;gBACD,yBAAyB,EAAE;oBACzB,uBAAuB,CAAC,MAAM,EAAE,CAAC;oBACjC,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAC,CAAC;iBACzD;aACF;YACD,uGAAuG;YACvG,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,GACzG,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/CDCGroupingFilter.js.map b/dist/cdc/CDCGroupingFilter.js.map deleted file mode 100644 index d041a7488..000000000 --- a/dist/cdc/CDCGroupingFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCGroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCGroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;IACjC,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAAU;IAChD,OAAO;QACL,EAAE;QACF,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,mBAAmB;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B;IACjC,OAAO;QAAK,+BAAM,CAAM,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.js.map b/dist/cdc/CDCRangeFilter.js.map deleted file mode 100644 index 44c704234..000000000 --- a/dist/cdc/CDCRangeFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAe3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAiC;IAC/F,OAAO;QACL,EAAE;QACF,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;KACb,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAC;IAC/E,OAAO,6BAAK,SAAS,EAAC,8BAA8B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QACjH,6BAAK,SAAS,EAAC,YAAY;YACzB,gCAAK,KAAK,CAAM,CACZ;QACN,6BAAK,SAAS,EAAC,aAAa;YAC1B,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACpC,CACE,CACF,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.js.map b/dist/cdc/CDCTextFilter.js.map deleted file mode 100644 index 366997712..000000000 --- a/dist/cdc/CDCTextFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../src/cdc/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAIlC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAe;IAC5E,OAAO;QACL,EAAE;QACF,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;;IACrG,OAAO;QACL,6BAAK,SAAS,EAAC,qBAAqB;YAClC,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,EACvC,KAAK,EAAE,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,EACnC,OAAO,EAAE,CAAC,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAA,CAAA,CAAC,CAAC,CAAC,EACpF,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,KAAK,CAAC,GAC1C,CACE;YACN,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,iBAAiB,EAAE,KAAK,EACxB,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,IAAI,CAAC,KAAK,EACjD,OAAO,QACP,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAA,CAAA,CAAC,GACtD,OAAO,QAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,MAAK,KAAK,2CAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAA,CAAA,CAAC,GAClG,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC7D,CACE,CACF,CACL,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CheckboxFilter.d.ts b/dist/cdc/CheckboxFilter.d.ts deleted file mode 100644 index badd26df0..000000000 --- a/dist/cdc/CheckboxFilter.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { IFilter } from "./interface"; -interface ICDCCheckboxFilterValue { - fields: string[]; - filter: string[]; -} -export declare function createCDCCheckboxFilter(id: string, name: string, value: ICDCCheckboxFilterValue): IFilter; -export declare function CDCCheckboxFilter({ value, onValueChanged }: { - value: any; - onValueChanged: any; -}): JSX.Element; -export {}; diff --git a/dist/cdc/CheckboxFilter.js b/dist/cdc/CheckboxFilter.js deleted file mode 100644 index 861101e4a..000000000 --- a/dist/cdc/CheckboxFilter.js +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from 'react'; -export function createCDCCheckboxFilter(id, name, value) { - return { - id, - name, - disableDropping: true, - component: { - clazz: CDCCheckboxFilter, - toFilter: CDCCheckboxFilterToString, - value, - } - }; -} -function CDCCheckboxFilterToString(value) { - // Generate filter from value - return `(${value === null || value === void 0 ? void 0 : value.fields.map((v) => { return `${v} == ${value.filter.filter((f) => f === v).length > 0}`; }).join(" and ")})`; -} -export function CDCCheckboxFilter({ value, onValueChanged }) { - return React.createElement(React.Fragment, null, value.fields.map((v) => { - return (React.createElement("div", { className: "input-group m-1" }, - React.createElement("div", { className: "form-check" }, - React.createElement("input", { className: "form-check-input", type: "checkbox", id: "flexCheckDefault", checked: value.filter.filter((f) => f === v).length > 0, disabled: !onValueChanged, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - fields: value.fields, - filter: value.filter.filter((f) => f === v).length > 0 - ? value.filter.filter((f) => f !== v) - : [...value.filter, v] - }) }), - React.createElement("label", { className: "form-check-label", htmlFor: "flexCheckDefault" }, v)))); - })); -} -//# sourceMappingURL=CheckboxFilter.js.map \ No newline at end of file diff --git a/dist/cdc/CheckboxFilter.js.map b/dist/cdc/CheckboxFilter.js.map deleted file mode 100644 index c90c04fc4..000000000 --- a/dist/cdc/CheckboxFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CheckboxFilter.js","sourceRoot":"","sources":["../../src/cdc/CheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY,EAAE,KA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E,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;4BAC5C,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;4BACrC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;qBAC3B,CAAC,GAEJ;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,CAAC,CACI,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAA;AACL,CAAC"} \ No newline at end of file diff --git a/dist/cdc/DropZone.js.map b/dist/cdc/DropZone.js.map deleted file mode 100644 index f191bd882..000000000 --- a/dist/cdc/DropZone.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../src/cdc/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAW,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,MAAM,UAAU,QAAQ,CAAC,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAiB;IACvE,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,GAAG,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,SAAS,CAAC,UAAU;QAC5B,IAAI,EAAE,CAAC,IAAa,EAAE,OAAO,EAAE,EAAE;YAC/B,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;YAC1B,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,EACF,EAAE,CACH,CAAC;IAEF,kFAAkF;IAClF,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC7C,qFAAqF;QACrF,OAAO,WAAW,IAAI,CAAC,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAC5E,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1B,MAAM,SAAS,GACb,CAAC,mBAAmB,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,IAAI,OAAO,CAAC;IAE3E,OAAO,CACL,6BACE,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EACvB,SAAS,EAAE,oBACT,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC/D,EAAE;QAEF,mDAAW,CACP,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/FilterCard.js.map b/dist/cdc/FilterCard.js.map deleted file mode 100644 index 62d13d08a..000000000 --- a/dist/cdc/FilterCard.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FilterCard.js","sourceRoot":"","sources":["../../src/cdc/FilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA4B,SAAS,EAAC,MAAM,cAAc,CAAC;AAClE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAgBpC,MAAM,UAAU,UAAU,CA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AAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B;oBACD,MAAM,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CACzC,oBAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GAAG,CAAC,EACZ,OAAO,EACL,WAAW,KAAK,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,IAAI,CAAC,aAAa,GAE/E,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF;QACL,SAAS,CAAC,CAAC;YACV,6BAAK,SAAS,EAAC,uBAAuB,gCAEhC,CAAC,CAAC;YACR,IAAI,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/GroupingFilter.d.ts b/dist/cdc/GroupingFilter.d.ts deleted file mode 100644 index 5a7da887c..000000000 --- a/dist/cdc/GroupingFilter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { IFilter } from "./interface"; -export declare function createCDCGroupingFilter(id: string, name: string): IFilter; diff --git a/dist/cdc/GroupingFilter.js b/dist/cdc/GroupingFilter.js deleted file mode 100644 index 0458b374a..000000000 --- a/dist/cdc/GroupingFilter.js +++ /dev/null @@ -1,18 +0,0 @@ -import * as React from 'react'; -export function createCDCGroupingFilter(id, name) { - return { - id, - name, - disableDropping: true, - operator: "AND", - children: [], - component: { - clazz: CDCGroupingFilter, - } - }; -} -function CDCGroupingFilter() { - return React.createElement("div", null, - React.createElement("br", null)); -} -//# sourceMappingURL=GroupingFilter.js.map \ No newline at end of file diff --git a/dist/cdc/GroupingFilter.js.map b/dist/cdc/GroupingFilter.js.map deleted file mode 100644 index 444317a6b..000000000 --- a/dist/cdc/GroupingFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GroupingFilter.js","sourceRoot":"","sources":["../../src/cdc/GroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,IAAY;IAC9D,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;SACzB;KACF,CAAA;AACH,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO;QAAK,+BAAM,CAAM,CAAA;AAC1B,CAAC"} \ No newline at end of file diff --git a/dist/cdc/RangeFilter.d.ts b/dist/cdc/RangeFilter.d.ts deleted file mode 100644 index b4de0ebea..000000000 --- a/dist/cdc/RangeFilter.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IFilter } from "./interface"; -export interface ICDCRangeFilterValue { - min: number; - max: number; -} -export declare function createCDCRangeFilter(id: string, name: string, value: ICDCRangeFilterValue): IFilter; diff --git a/dist/cdc/RangeFilter.js b/dist/cdc/RangeFilter.js deleted file mode 100644 index 9ac17bb30..000000000 --- a/dist/cdc/RangeFilter.js +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react'; -import InputRange from "react-input-range"; -export function createCDCRangeFilter(id, name, value) { - return { - id, - name, - disableDropping: true, - component: { - clazz: CDCRangeFilter, - toFilter: CDCRangeFilterToString, - value, - } - }; -} -function CDCRangeFilterToString(value) { - // Generate filter from value - return `(date >= ${value.min} and date <= ${value.max})`; -} -function CDCRangeFilter({ value, onValueChanged }) { - return React.createElement("div", { style: { margin: "10px", paddingTop: "10px" } }, - React.createElement(InputRange, { disabled: !onValueChanged, maxValue: 2021, minValue: 1950, value: { min: value.min, max: value.max }, onChange: (v) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged(v) })); -} -//# sourceMappingURL=RangeFilter.js.map \ No newline at end of file diff --git a/dist/cdc/RangeFilter.js.map b/dist/cdc/RangeFilter.js.map deleted file mode 100644 index dfe6f1285..000000000 --- a/dist/cdc/RangeFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"RangeFilter.js","sourceRoot":"","sources":["../../src/cdc/RangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAQ3C,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA2B;IACxF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,cAAc;YACrB,QAAQ,EAAE,sBAAsB;YAChC,KAAK;SACN;KACF,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA2B;IACzD,6BAA6B;IAC7B,OAAO,YAAY,KAAK,CAAC,GAAG,gBAAgB,KAAK,CAAC,GAAG,GAAG,CAAC;AAC3D,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,OAAO,6BAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE;QACvD,oBAAC,UAAU,IACP,QAAQ,EAAE,CAAC,cAAc,EACzB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,EAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAC,EACvC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACtC,CACI,CAAA;AACV,CAAC"} \ No newline at end of file diff --git a/dist/cdc/TextFilter.d.ts b/dist/cdc/TextFilter.d.ts deleted file mode 100644 index 630e9319b..000000000 --- a/dist/cdc/TextFilter.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { IFilter } from "./interface"; -export interface ICDCTextFilterValue { - fields: { - field: string; - options: string[]; - }[]; - filter: { - field: string; - value: string[]; - }[]; -} -export declare function createCDCTextFilter(id: string, name: string, value: ICDCTextFilterValue): IFilter; -export declare function CDCTextFilter({ value, onValueChanged }: { - value: any; - onValueChanged: any; -}): JSX.Element; diff --git a/dist/cdc/TextFilter.js b/dist/cdc/TextFilter.js deleted file mode 100644 index 8eb0395ac..000000000 --- a/dist/cdc/TextFilter.js +++ /dev/null @@ -1,69 +0,0 @@ -import * as React from 'react'; -import Select from "react-select"; -export function createCDCTextFilter(id, name, value) { - return { - id, - name, - disableDropping: true, - component: { - clazz: CDCTextFilter, - toFilter: CDCTextFilterToString, - value, - } - }; -} -function CDCTextFilterToString(value) { - // Generate filter from value - return `(${value.filter - .map((v) => `${v.field} in (${v.value.join(',')})`) - .join(" and ")})`; -} -export function CDCTextFilter({ value, onValueChanged }) { - return React.createElement(React.Fragment, null, - value.filter.map((v, i) => { - var _a; - return (React.createElement("div", { key: i, className: "input-group m-1" }, - React.createElement("select", { className: "form-select", disabled: !onValueChanged, value: v.field, onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.map((oldV) => oldV === v - ? { - ...v, - field: e.currentTarget.value, - value: [] - } - : oldV) - }) }, - React.createElement("option", { value: "" }, "Select..."), - value.fields.map((f) => (React.createElement("option", { value: f.field, key: f.field }, f.field)))), - React.createElement("div", { style: { width: "70%" } }, - React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged, isMulti: true, value: v.value.map((value) => ({ label: value, value })), options: (_a = value.fields - .find((f) => f.field === v.field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { - return { value: o, label: o }; - }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.map((oldV) => oldV === v - ? { - ...v, - value: e.map((value) => value.value) - } - : oldV) - }) })), - React.createElement("button", { disabled: !onValueChanged, onClick: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged({ - ...value, - filter: value.filter.filter((oldV) => oldV !== v) - }), className: "btn btn-secondary" }, "X"))); - }), - onValueChanged ? (React.createElement("button", { className: "btn btn-secondary m-1", onClick: () => { - onValueChanged({ - ...value, - filter: [ - ...value.filter, - { - field: "", - value: [] - } - ] - }); - } }, "+")) : null); -} -//# sourceMappingURL=TextFilter.js.map \ No newline at end of file diff --git a/dist/cdc/TextFilter.js.map b/dist/cdc/TextFilter.js.map deleted file mode 100644 index dd7c2deb7..000000000 --- a/dist/cdc/TextFilter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TextFilter.js","sourceRoot":"","sources":["../../src/cdc/TextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAclC,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,IAAY,EAAE,KAA0B;IACtF,OAAO;QACL,EAAE;QACF,IAAI;QACJ,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE,qBAAqB;YAC/B,KAAK;SACN;KACF,CAAA;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,KAA0B;IACvD,6BAA6B;IAC7B,OAAO,IAAI,KAAK,CAAC,MAAM;SACpB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA,GAAG,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;SACjD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE;IACrD,OAAO;QACJ,KAAK,CA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at end of file diff --git a/dist/cdc/CDCAlertView.d.ts b/dist/cdc/alert/CDCAlertView.d.ts similarity index 92% rename from dist/cdc/CDCAlertView.d.ts rename to dist/cdc/alert/CDCAlertView.d.ts index e0b4f0ee3..b09cad27c 100644 --- a/dist/cdc/CDCAlertView.d.ts +++ b/dist/cdc/alert/CDCAlertView.d.ts @@ -1,9 +1,9 @@ /// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interfaces'; +import { IAlert, IFilter, IFilterComponent, IUploadAlert } from '../interfaces'; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; - filterSelection: IFilter[] | undefined; + filterSelection?: IFilter[]; filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: { diff --git a/dist/cdc/CDCAlertView.js b/dist/cdc/alert/CDCAlertView.js similarity index 65% rename from dist/cdc/CDCAlertView.js rename to dist/cdc/alert/CDCAlertView.js index 58253a2b8..d11c3fabe 100644 --- a/dist/cdc/CDCAlertView.js +++ b/dist/cdc/alert/CDCAlertView.js @@ -1,26 +1,19 @@ import get from 'lodash.get'; import React from 'react'; import Select from 'react-select'; -import { runAlert } from '.'; -import { confirmAlertById, deleteAlert, editAlert, saveAlert } from './api'; -import { CDCFilterComponent } from './CDCFilterComponent'; +import { runAlert } from '..'; +import { confirmAlertById, deleteAlert, editAlert, saveAlert } from '../api'; +import { CDCFilterCreator } from '../creator'; export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode }) { - var _a, _b; + var _a, _b, _c; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); - const [validName, setValidName] = React.useState(true); - const [validFilter, setValidFilter] = React.useState(true); + const validFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; + const validName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; React.useEffect(() => { setEditMode(false); setDeleteMode(false); }, [selectedAlert]); - React.useEffect(() => { - setValidFilter((filter === null || filter === void 0 ? void 0 : filter.children.length) > 0); - }, [filter]); - React.useEffect(() => { - var _a; - setValidName(((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0); - }, [alertData.name]); const confirmChanges = async (id) => { const alert = await confirmAlertById(id); onAlertChanged(alert.id); @@ -59,12 +52,13 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, await deleteAlert(id); onAlertChanged(); }; + // TODO: Extract to component instead of inline function const literature = () => { var _a, _b, _c, _d, _e, _f; - if (selectedAlert.latest_diff) { + if (selectedAlert.latest_diff || selectedAlert.confirmed_data) { const change = new Map(); (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.values_changed) === null || _b === void 0 ? void 0 : _b.map((d) => { - const nestedField = d.field.map((f) => f).join("."); + const nestedField = d.field.map((f) => f).join('.'); if (change.has(d.id)) { change.set(d.id, change.get(d.id).set(nestedField, { old: d.old_value, new: d.new_value })); } @@ -73,31 +67,50 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, } }); return (React.createElement(React.Fragment, null, - React.createElement("h6", null, "Changed data:"), - React.createElement("table", { className: "table table-light mt-2" }, + React.createElement("table", { className: "table mb-0" }, React.createElement("thead", null, - React.createElement("tr", null, (_c = selectedAlert.compare_columns) === null || _c === void 0 ? void 0 : _c.map((field, i) => React.createElement("th", { key: `header-${i}`, scope: "col" }, field)))), - React.createElement("tbody", null, (_d = selectedAlert.latest_diff.dictionary_item_added) === null || _d === void 0 ? void 0 : - _d.map((d) => { - var _a; - const data = selectedAlert.latest_fetched_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-success" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `added-${i}` }, get(data, field))))); - }), (_e = selectedAlert.latest_diff.dictionary_item_removed) === null || _e === void 0 ? void 0 : - _e.map((d) => { - var _a; - const data = selectedAlert.confirmed_data.find(a => a.id === d); - return (React.createElement("tr", { key: d, className: "table-danger" }, (_a = selectedAlert.compare_columns) === null || _a === void 0 ? void 0 : _a.map((field, i) => React.createElement("td", { key: `removed-${i}` }, get(data, field))))); - }), (_f = [...change.keys()]) === null || _f === void 0 ? void 0 : - _f.map((id, i) => { - var _a, _b; - const oldData = (_a = selectedAlert.confirmed_data) === null || _a === void 0 ? void 0 : _a.find(a => a.id === id); - return (React.createElement("tr", { key: `tr-changed-${i}`, className: "table-primary" }, (_b = selectedAlert.compare_columns) === null || _b === void 0 ? void 0 : _b.map((field, index) => change.get(id).has(field) ? React.createElement("td", { key: `changed-${i}-${index}` }, - React.createElement("s", null, change.get(id).get(field).old), - " ", - change.get(id).get(field).new) : React.createElement("td", { key: `changed-${i}-${index}` }, get(oldData, field))))); - }))), - React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm")))); + React.createElement("tr", null, + React.createElement("th", { scope: "col" }, "ID"), + selectedAlert.compare_columns.map((field, i) => React.createElement("th", { key: field, scope: "col" }, field)), + React.createElement("th", { scope: "col" }, "Status"))), + React.createElement("tbody", { style: { maxHeight: 600, overflow: 'auto' } }, + selectedAlert.latest_diff ? React.createElement(React.Fragment, null, (_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_added) === null || _d === void 0 ? void 0 : + _d.map((d) => { + const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); + return (React.createElement("tr", { key: d, className: "table-success" }, + React.createElement("td", { scope: "row" }, data._cdc_compare_id), + selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), + React.createElement("td", null, "Added"))); + }), (_f = (_e = selectedAlert.latest_diff) === null || _e === void 0 ? void 0 : _e.dictionary_item_removed) === null || _f === void 0 ? void 0 : + _f.map((d) => { + const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); + return (React.createElement("tr", { key: d, className: "table-danger" }, + React.createElement("td", { scope: "row" }, data._cdc_compare_id), + selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), + React.createElement("td", null, "Removed"))); + })) : null, + selectedAlert.confirmed_data ? React.createElement(React.Fragment, null, selectedAlert.confirmed_data + // Only show entries which are not already shown above + .filter((item) => { var _a, _b, _c, _d; return !((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(item._cdc_compare_id)) && !((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(item._cdc_compare_id)); }) + // Sort such that rows with changes are on top + .sort((a, b) => (change.has(b._cdc_compare_id) ? 1 : 0) - (change.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { + var _a, _b, _c, _d; + const id = d._cdc_compare_id; + const hasChanged = change.has(id); + // TODO: All these .find() and .includes() should be refactored as they are O(n). + const isAlreadyHandled = ((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(id)) || ((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(id)); + return (isAlreadyHandled ? null : + React.createElement("tr", { key: id, className: `${hasChanged ? 'table-primary' : ''}` }, + React.createElement("td", { scope: "row" }, d._cdc_compare_id), + selectedAlert.compare_columns.map((field) => (React.createElement(React.Fragment, { key: field }, hasChanged ? (change.get(id).has(field) ? (React.createElement("td", null, + React.createElement("s", null, change.get(id).get(field).old), + " ", + change.get(id).get(field).new)) : (React.createElement("td", null, get(d, field)))) : (React.createElement("td", { key: field }, get(d, field)))))), + React.createElement("td", null, hasChanged ? React.createElement(React.Fragment, null, "Changed") : null))); + })) : null)), + selectedAlert.latest_diff ? React.createElement("div", { className: "p-1" }, + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm"))) : null)); } return React.createElement("p", null, "No new data available"); }; @@ -122,8 +135,8 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, !editMode && !creationMode ? React.createElement("div", { key: "one", className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: "heading-one" }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_a = new Date(selectedAlert.latest_compare_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()) : 'No new data'}`)), - React.createElement("div", { id: "collapse-one", className: "p-4 accordion-collapse collapse show", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, literature())) + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_b = new Date(selectedAlert.latest_compare_date)) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()) : 'No new data'}`)), + React.createElement("div", { id: "collapse-one", className: "accordion-collapse collapse show", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, literature())) : null, React.createElement("div", { key: "two", className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: "heading-two" }, @@ -141,17 +154,17 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!"))), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "CDC"), - React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), + React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => ({ label: c, value: c })), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "Change Fields"), - React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumnOptions.map((col) => { return { label: col, value: col }; }), value: (_b = alertData.compare_columns) === null || _b === void 0 ? void 0 : _b.map((col) => { return { label: col, value: col }; }), onChange: (e) => setAlertData({ ...alertData, compare_columns: [...e.map((col) => col.value)] }) })), + React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumnOptions.map((c) => ({ label: c, value: c })), value: (_c = alertData.compare_columns) === null || _c === void 0 ? void 0 : _c.map((c) => ({ label: c, value: c })), onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: true, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), React.createElement("div", null, filterSelection || !filter ? - React.createElement(CDCFilterComponent, { filterSelection: !creationMode && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) + React.createElement(CDCFilterCreator, { filterSelection: !creationMode && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) : React.createElement("p", null, "No filters available for this cdc"))))))); } @@ -201,7 +214,7 @@ const generalInformation =
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    }
    @@ -240,7 +253,7 @@ const alertInformation =
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    }
    @@ -312,7 +325,7 @@ const alterAlert =
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    } diff --git a/dist/cdc/alert/CDCAlertView.js.map b/dist/cdc/alert/CDCAlertView.js.map new file mode 100644 index 000000000..59a002896 --- /dev/null +++ b/dist/cdc/alert/CDCAlertView.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCAlertView.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCAlertView.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAkB5C,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAgB;;IACnN,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,MAAM,IAAG,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,OAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,IAAI,GAAG,MA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,+BAAO,SAAS,EAAC,YAAY,yBAA2B;4BACxD,6BAAK,SAAS,EAAC,YAAY;gCACzB,+BAAO,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;gCAC9M,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;oBACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC3B,oBAAC,gBAAgB,IAAC,eAAe,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;wBAC7L,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqKE"} \ No newline at end of file diff --git a/dist/cdc/CDCCreateAlert.d.ts b/dist/cdc/alert/CDCCreateAlert.d.ts similarity index 91% rename from dist/cdc/CDCCreateAlert.d.ts rename to dist/cdc/alert/CDCCreateAlert.d.ts index db030df1a..690e13887 100644 --- a/dist/cdc/CDCCreateAlert.d.ts +++ b/dist/cdc/alert/CDCCreateAlert.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter, IFilterComponent, IUploadAlert } from './interfaces'; +import { IFilter, IFilterComponent, IUploadAlert } from '../interfaces'; interface ICDCCreateAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; diff --git a/dist/cdc/CDCCreateAlert.js b/dist/cdc/alert/CDCCreateAlert.js similarity index 78% rename from dist/cdc/CDCCreateAlert.js rename to dist/cdc/alert/CDCCreateAlert.js index e9ce433ba..e3fd03416 100644 --- a/dist/cdc/CDCCreateAlert.js +++ b/dist/cdc/alert/CDCCreateAlert.js @@ -1,18 +1,12 @@ import React from 'react'; import Select from 'react-select'; import { runAlert } from '..'; -import { saveAlert } from './api'; -import { CDCFilterComponent } from './CDCFilterComponent'; +import { saveAlert } from '../api'; +import { CDCFilterCreator } from '../creator'; export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions }) { - const [validFilter, setValidFilter] = React.useState(true); - const [validName, setValidName] = React.useState(true); - React.useEffect(() => { - setValidFilter((filter === null || filter === void 0 ? void 0 : filter.children.length) > 0); - }, [filter]); - React.useEffect(() => { - var _a; - setValidName(((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0); - }, [alertData.name]); + var _a; + const validFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; + const validName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; const onSave = async () => { if (validFilter && validName) { const newAlert = await saveAlert({ ...alertData, filter }) @@ -45,14 +39,20 @@ export function CDCCreateAlert({ alertData, setAlertData, filterSelection, filte React.createElement(Select, { options: cdcs.map((c) => { return { label: c, value: c }; }), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Change Fields"), - React.createElement(Select, { isMulti: true, closeMenuOnSelect: false, options: compareColumnOptions, value: alertData.compare_columns, onChange: (e) => setAlertData({ ...alertData, compare_columns: [...e] }) })), + React.createElement(Select, { isMulti: true, closeMenuOnSelect: false, options: compareColumnOptions.map((o) => ({ + label: o, + value: o + })), value: alertData.compare_columns.map((o) => ({ + label: o, + value: o + })), onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map(({ value }) => value) }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, React.createElement("input", { className: "form-check-input", type: "checkbox", checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), React.createElement("div", null, filterSelection || !filter ? - React.createElement(CDCFilterComponent, { filterSelection: filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) + React.createElement(CDCFilterCreator, { filterSelection: filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) : React.createElement("p", null, "No filters available for this cdc"))))); } diff --git a/dist/cdc/alert/CDCCreateAlert.js.map b/dist/cdc/alert/CDCCreateAlert.js.map new file mode 100644 index 000000000..de70cf595 --- /dev/null +++ b/dist/cdc/alert/CDCCreateAlert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCCreateAlert.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCCreateAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAgB5C,MAAM,UAAU,cAAc,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE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CAAC;4BACxC,KAAK,EAAE,CAAC;4BACR,KAAK,EAAE,CAAC;yBACT,CAAC,CAAC,EACH,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;4BAC3C,KAAK,EAAE,CAAC;4BACR,KAAK,EAAE,CAAC;yBACT,CAAC,CAAC,EACH,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAC,CAAC,GACzF,CACE;gBACN,6BAAK,SAAS,EAAC,UAAU;oBACvB,+BAAO,SAAS,EAAC,YAAY,yBAA2B;oBACxD,6BAAK,SAAS,EAAC,YAAY;wBACzB,+BAAO,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;wBAC9L,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;YACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3B,oBAAC,gBAAgB,IAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;gBACzJ,CAAC;oBACD,mEAAwC,CAEtC,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/alert/index.d.ts b/dist/cdc/alert/index.d.ts new file mode 100644 index 000000000..bd6218074 --- /dev/null +++ b/dist/cdc/alert/index.d.ts @@ -0,0 +1,2 @@ +export * from './CDCAlertView'; +export * from './CDCCreateAlert'; diff --git a/dist/cdc/alert/index.js b/dist/cdc/alert/index.js new file mode 100644 index 000000000..531cfa119 --- /dev/null +++ b/dist/cdc/alert/index.js @@ -0,0 +1,3 @@ +export * from './CDCAlertView'; +export * from './CDCCreateAlert'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/alert/index.js.map b/dist/cdc/alert/index.js.map new file mode 100644 index 000000000..320894a67 --- /dev/null +++ b/dist/cdc/alert/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdc/alert/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/dist/cdc/FilterCard.d.ts b/dist/cdc/creator/CDCFilterCard.d.ts similarity index 93% rename from dist/cdc/FilterCard.d.ts rename to dist/cdc/creator/CDCFilterCard.d.ts index 2a5ecf21f..4d38caaab 100644 --- a/dist/cdc/FilterCard.d.ts +++ b/dist/cdc/creator/CDCFilterCard.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter, IFilterComponent } from './interfaces'; +import { IFilter, IFilterComponent } from '../interfaces'; interface IFilterCardProps { filter: IFilter; onDrop?: any; diff --git a/dist/cdc/FilterCard.js b/dist/cdc/creator/CDCFilterCard.js similarity index 98% rename from dist/cdc/FilterCard.js rename to dist/cdc/creator/CDCFilterCard.js index 74f986314..bb62e6ec0 100644 --- a/dist/cdc/FilterCard.js +++ b/dist/cdc/creator/CDCFilterCard.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { itemTypes } from './interfaces'; +import { itemTypes } from '../interfaces'; import { useDrag } from 'react-dnd'; import { DropZone } from './DropZone'; export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, onFieldChanged, filterComponents, disableFilter, isInvalid, disableDragging, disableRemoving }) { @@ -49,4 +49,4 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, React.createElement("div", { className: "invalid-feedback mb-2" }, "Filter must not be empty!") : null)); } -//# sourceMappingURL=FilterCard.js.map \ No newline at end of file +//# sourceMappingURL=CDCFilterCard.js.map \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCard.js.map b/dist/cdc/creator/CDCFilterCard.js.map new file mode 100644 index 000000000..26387fd43 --- /dev/null +++ b/dist/cdc/creator/CDCFilterCard.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCFilterCard.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA4B,SAAS,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAgBpC,MAAM,UAAU,UAAU,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAmB;;IAC7L,MAAM,CAAC,EAAC,UAAU,EAAE,WAAW,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChE,IAAI,EAAE,SAAS,CAAC,UAAU;QAC1B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE;YAClC,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,CAAC,CAAC;IAEJ,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC;IACnE,MAAM,eAAe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a/dist/cdc/CDCFilterComponent.d.ts b/dist/cdc/creator/CDCFilterCreator.d.ts similarity index 57% rename from dist/cdc/CDCFilterComponent.d.ts rename to dist/cdc/creator/CDCFilterCreator.d.ts index 4aef36125..7553d2e16 100644 --- a/dist/cdc/CDCFilterComponent.d.ts +++ b/dist/cdc/creator/CDCFilterCreator.d.ts @@ -1,6 +1,6 @@ import React from 'react'; -import { IFilter, IFilterComponent } from './interfaces'; -interface ICDCFilterComponentProps { +import { IFilter, IFilterComponent } from '../interfaces'; +interface ICDCFilterCreatorProps { filterSelection?: IFilter[]; filter: IFilter; setFilter: React.Dispatch>; @@ -13,5 +13,5 @@ interface ICDCFilterComponentProps { disableFilter?: boolean; isInvalid?: boolean; } -export declare function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }: ICDCFilterComponentProps): JSX.Element; +export declare function CDCFilterCreator({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }: ICDCFilterCreatorProps): JSX.Element; export {}; diff --git a/dist/cdc/CDCFilterComponent.js b/dist/cdc/creator/CDCFilterCreator.js similarity index 94% rename from dist/cdc/CDCFilterComponent.js rename to dist/cdc/creator/CDCFilterCreator.js index b1004ec06..ef25b3c61 100644 --- a/dist/cdc/CDCFilterComponent.js +++ b/dist/cdc/creator/CDCFilterCreator.js @@ -2,10 +2,10 @@ import produce from 'immer'; import React from 'react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; -import { FilterCard } from './FilterCard'; -import { getFilterFromTree } from './interfaces'; +import { FilterCard } from './CDCFilterCard'; +import { getFilterFromTree } from '../interfaces'; import { v4 as uuidv4 } from 'uuid'; -export function CDCFilterComponent({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }) { +export function CDCFilterCreator({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }) { const onDelete = (newFilter) => { setFilter((filter) => produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); @@ -90,4 +90,4 @@ export function CDCFilterComponent({ filterSelection, filter, setFilter, filterC filterSelection.map((f) => (React.createElement(FilterCard, { key: f.id, filter: f, filterComponents: filterComponents, disableFilter: disableFilter })))) : null))); } -//# sourceMappingURL=CDCFilterComponent.js.map \ No newline at end of file +//# sourceMappingURL=CDCFilterCreator.js.map \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCreator.js.map b/dist/cdc/creator/CDCFilterCreator.js.map new file mode 100644 index 000000000..5ee98c91e --- /dev/null +++ b/dist/cdc/creator/CDCFilterCreator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAWlC,MAAM,UAAU,gBAAgB,CAAC,EAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAyB;IACvI,MAAM,QAAQ,GAAG,CAAC,SAAkB,EAAE,EAAE;QACtC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;YACnD,MAAM,EAAC,OAAO,EAAE,MAAM,EAAC,GAAG,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;YACtE,IAAI,OAAO,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;gBACxC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AAC;IAEF,IAAG,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;KAC7D;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAClB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,+CAAqB;gBACrB,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,GACrB,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/DropZone.d.ts b/dist/cdc/creator/DropZone.d.ts similarity index 85% rename from dist/cdc/DropZone.d.ts rename to dist/cdc/creator/DropZone.d.ts index 7f5c2d27b..285d3839c 100644 --- a/dist/cdc/DropZone.d.ts +++ b/dist/cdc/creator/DropZone.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter } from './interfaces'; +import { IFilter } from '../interfaces'; interface IDropZoneProps { onDrop: any; canDrop: boolean; diff --git a/dist/cdc/DropZone.js b/dist/cdc/creator/DropZone.js similarity index 95% rename from dist/cdc/DropZone.js rename to dist/cdc/creator/DropZone.js index 10c4c289b..c83427f9d 100644 --- a/dist/cdc/DropZone.js +++ b/dist/cdc/creator/DropZone.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { getFilterFromTree, itemTypes } from './interfaces'; +import { getFilterFromTree, itemTypes } from '../interfaces'; import { useDrop } from 'react-dnd'; export function DropZone({ canDrop, onDrop, filter, index }) { // TODO: Add proper types such that draggedItem can be infered diff --git a/dist/cdc/creator/DropZone.js.map b/dist/cdc/creator/DropZone.js.map new file mode 100644 index 000000000..9383cf207 --- /dev/null +++ b/dist/cdc/creator/DropZone.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/cdc/creator/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAW,SAAS,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,MAAM,UAAU,QAAQ,CAAC,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAiB;IACvE,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,GAAG,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,SAAS,CAAC,UAAU;QAC5B,IAAI,EAAE,CAAC,IAAa,EAAE,OAAO,EAAE,EAAE;YAC/B,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;YAC1B,WAAW,EAAG,OAAO,CAAC,OAAO,EAAqC;SACnE,CAAC;KACH,CAAC,EACF,EAAE,CACH,CAAC;IAEF,kFAAkF;IAClF,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC7C,qFAAqF;QACrF,OAAO,WAAW,IAAI,CAAC,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAC5E,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1B,MAAM,SAAS,GACb,CAAC,mBAAmB,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,IAAI,OAAO,CAAC;IAE3E,OAAO,CACL,6BACE,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EACvB,SAAS,EAAE,oBACT,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC/D,EAAE;QAEF,mDAAW,CACP,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/creator/index.d.ts b/dist/cdc/creator/index.d.ts new file mode 100644 index 000000000..7b7c37bbf --- /dev/null +++ b/dist/cdc/creator/index.d.ts @@ -0,0 +1,2 @@ +export * from './CDCFilterCard'; +export * from './CDCFilterCreator'; diff --git a/dist/cdc/creator/index.js b/dist/cdc/creator/index.js new file mode 100644 index 000000000..424fac1af --- /dev/null +++ b/dist/cdc/creator/index.js @@ -0,0 +1,4 @@ +export * from './CDCFilterCard'; +export * from './CDCFilterCreator'; +// export * from './DropZone'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/creator/index.js.map b/dist/cdc/creator/index.js.map new file mode 100644 index 000000000..dd13c0835 --- /dev/null +++ b/dist/cdc/creator/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdc/creator/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,8BAA8B"} \ No newline at end of file diff --git a/dist/cdc/CDCCheckboxFilter.d.ts b/dist/cdc/filter/CDCCheckboxFilter.d.ts similarity index 90% rename from dist/cdc/CDCCheckboxFilter.d.ts rename to dist/cdc/filter/CDCCheckboxFilter.d.ts index c9cb2daeb..ded7f9c77 100644 --- a/dist/cdc/CDCCheckboxFilter.d.ts +++ b/dist/cdc/filter/CDCCheckboxFilter.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter, IFilterComponent } from './interfaces'; +import { IFilter, IFilterComponent } from '../interfaces'; interface ICDCCheckboxFilterValue { [field: string]: boolean; } diff --git a/dist/cdc/CDCCheckboxFilter.js b/dist/cdc/filter/CDCCheckboxFilter.js similarity index 93% rename from dist/cdc/CDCCheckboxFilter.js rename to dist/cdc/filter/CDCCheckboxFilter.js index 72f39f1e5..b59a2d0d1 100644 --- a/dist/cdc/CDCCheckboxFilter.js +++ b/dist/cdc/filter/CDCCheckboxFilter.js @@ -1,6 +1,8 @@ import * as React from 'react'; import Checkbox from 'react-three-state-checkbox'; +/* tslint:disable-next-line:variable-name */ export const CDCCheckboxFilterId = 'checkbox'; +/* tslint:disable-next-line:variable-name */ export const CDCCheckboxFilter = { clazz: CDCCheckboxFilterComponent, disableDropping: true @@ -9,7 +11,7 @@ export function createCDCCheckboxFilter(id, value) { return { id, type: CDCCheckboxFilterId, - value: value + value }; } export function CDCCheckboxFilterComponent({ value, onValueChanged, disabled, config }) { diff --git a/dist/cdc/filter/CDCCheckboxFilter.js.map b/dist/cdc/filter/CDCCheckboxFilter.js.map new file mode 100644 index 000000000..970e35d9d --- /dev/null +++ b/dist/cdc/filter/CDCCheckboxFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAA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,QAAQ,IACP,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACrB,SAAS,EAAC,kBAAkB,EAC5B,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAClD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAC7C;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,KAAK,CACA,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCGroupingFilter.d.ts b/dist/cdc/filter/CDCGroupingFilter.d.ts similarity index 76% rename from dist/cdc/CDCGroupingFilter.d.ts rename to dist/cdc/filter/CDCGroupingFilter.d.ts index c2c1a7c49..7af3d9bf9 100644 --- a/dist/cdc/CDCGroupingFilter.d.ts +++ b/dist/cdc/filter/CDCGroupingFilter.d.ts @@ -1,4 +1,4 @@ -import { IFilter, IFilterComponent } from './interfaces'; +import { IFilter, IFilterComponent } from '../interfaces'; export declare const CDCGroupingFilterId = "group"; export declare const CDCGroupingFilter: IFilterComponent; export declare function createCDCGroupingFilter(id: string): IFilter; diff --git a/dist/cdc/CDCGroupingFilter.js b/dist/cdc/filter/CDCGroupingFilter.js similarity index 85% rename from dist/cdc/CDCGroupingFilter.js rename to dist/cdc/filter/CDCGroupingFilter.js index 016fe4d5c..567823601 100644 --- a/dist/cdc/CDCGroupingFilter.js +++ b/dist/cdc/filter/CDCGroupingFilter.js @@ -1,5 +1,7 @@ import * as React from 'react'; +/* tslint:disable-next-line:variable-name */ export const CDCGroupingFilterId = 'group'; +/* tslint:disable-next-line:variable-name */ export const CDCGroupingFilter = { clazz: CDCGroupingFilterComponent, disableDropping: true diff --git a/dist/cdc/filter/CDCGroupingFilter.js.map b/dist/cdc/filter/CDCGroupingFilter.js.map new file mode 100644 index 000000000..33982660a --- /dev/null +++ b/dist/cdc/filter/CDCGroupingFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCGroupingFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCGroupingFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,4CAA4C;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;IACjC,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAAU;IAChD,OAAO;QACL,EAAE;QACF,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,mBAAmB;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B;IACjC,OAAO;QAAK,+BAAM,CAAM,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCRangeFilter.d.ts b/dist/cdc/filter/CDCRangeFilter.d.ts similarity index 89% rename from dist/cdc/CDCRangeFilter.d.ts rename to dist/cdc/filter/CDCRangeFilter.d.ts index 5f04c86c4..123692147 100644 --- a/dist/cdc/CDCRangeFilter.d.ts +++ b/dist/cdc/filter/CDCRangeFilter.d.ts @@ -1,4 +1,4 @@ -import { IFilter, IFilterComponent } from './interfaces'; +import { IFilter, IFilterComponent } from '../interfaces'; export interface ICDCRangeFilterValue { config: { minValue: number; diff --git a/dist/cdc/CDCRangeFilter.js b/dist/cdc/filter/CDCRangeFilter.js similarity index 89% rename from dist/cdc/CDCRangeFilter.js rename to dist/cdc/filter/CDCRangeFilter.js index 0c1ebd9c8..e2ba2e271 100644 --- a/dist/cdc/CDCRangeFilter.js +++ b/dist/cdc/filter/CDCRangeFilter.js @@ -1,6 +1,8 @@ import * as React from 'react'; import InputRange from 'react-input-range'; +/* tslint:disable-next-line:variable-name */ export const CDCRangeFilterId = 'range'; +/* tslint:disable-next-line:variable-name */ export const CDCRangeFilter = { clazz: CDCRangeFilterComponent, disableDropping: true @@ -9,8 +11,8 @@ export function createCDCRangeFilter(id, field, value) { return { id, type: CDCRangeFilterId, - field: field, - value: value, + field, + value, }; } function CDCRangeFilterComponent({ value, onValueChanged, disabled, config, field }) { diff --git a/dist/cdc/filter/CDCRangeFilter.js.map b/dist/cdc/filter/CDCRangeFilter.js.map new file mode 100644 index 000000000..7b24b6803 --- /dev/null +++ b/dist/cdc/filter/CDCRangeFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAe3C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAiC;IAC/F,OAAO;QACL,EAAE;QACF,IAAI,EAAE,gBAAgB;QACtB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAC;IAC/E,OAAO,6BAAK,SAAS,EAAC,8BAA8B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QACjH,6BAAK,SAAS,EAAC,YAAY;YACzB,gCAAK,KAAK,CAAM,CACZ;QACN,6BAAK,SAAS,EAAC,aAAa;YAC1B,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACpC,CACE,CACF,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/dist/cdc/CDCTextFilter.d.ts b/dist/cdc/filter/CDCTextFilter.d.ts similarity index 90% rename from dist/cdc/CDCTextFilter.d.ts rename to dist/cdc/filter/CDCTextFilter.d.ts index 032f72b8f..ea25b8ca3 100644 --- a/dist/cdc/CDCTextFilter.d.ts +++ b/dist/cdc/filter/CDCTextFilter.d.ts @@ -1,5 +1,5 @@ /// -import { IFilter, IFilterComponent } from './interfaces'; +import { IFilter, IFilterComponent } from '../interfaces'; export interface ICDCTextFilterValue { } export declare const CDCTextFilterId = "text"; diff --git a/dist/cdc/CDCTextFilter.js b/dist/cdc/filter/CDCTextFilter.js similarity index 93% rename from dist/cdc/CDCTextFilter.js rename to dist/cdc/filter/CDCTextFilter.js index b17ce61b1..32f7e0638 100644 --- a/dist/cdc/CDCTextFilter.js +++ b/dist/cdc/filter/CDCTextFilter.js @@ -1,6 +1,8 @@ import * as React from 'react'; import Select from 'react-select'; +/* tslint:disable-next-line:variable-name */ export const CDCTextFilterId = 'text'; +/* tslint:disable-next-line:variable-name */ export const CDCTextFilter = { clazz: CDCTextFilterComponent, disableDropping: true @@ -9,8 +11,8 @@ export function createCDCTextFilter(id, field, value) { return { id, type: CDCTextFilterId, - field: field, - value: value, + field, + value, }; } export function CDCTextFilterComponent({ value, onValueChanged, onFieldChanged, disabled, field, config }) { diff --git a/dist/cdc/filter/CDCTextFilter.js.map b/dist/cdc/filter/CDCTextFilter.js.map new file mode 100644 index 000000000..5b8bef7f3 --- /dev/null +++ b/dist/cdc/filter/CDCTextFilter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAOlC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAe;IAC5E,OAAO;QACL,EAAE;QACF,IAAI,EAAE,eAAe;QACrB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;;IACrG,OAAO;QACL,6BAAK,SAAS,EAAC,qBAAqB;YAClC,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,EACvC,KAAK,EAAE,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,EACnC,OAAO,EAAE,CAAC,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAA,CAAC,CAAC,CAAC,EACrF,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,KAAK,CAAC,GAC1C,CACE;YACN,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,iBAAiB,EAAE,KAAK,EACxB,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,IAAI,CAAC,KAAK,EACjD,OAAO,QACP,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA,CAAC,GACvD,OAAO,QAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,MAAK,KAAK,2CAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA,CAAC,GACnG,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC7D,CACE,CACF,CACL,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/filter/index.d.ts b/dist/cdc/filter/index.d.ts new file mode 100644 index 000000000..31a7ed909 --- /dev/null +++ b/dist/cdc/filter/index.d.ts @@ -0,0 +1,4 @@ +export * from './CDCCheckboxFilter'; +export * from './CDCGroupingFilter'; +export * from './CDCRangeFilter'; +export * from './CDCTextFilter'; diff --git a/dist/cdc/filter/index.js b/dist/cdc/filter/index.js new file mode 100644 index 000000000..b3b3f74d8 --- /dev/null +++ b/dist/cdc/filter/index.js @@ -0,0 +1,5 @@ +export * from './CDCCheckboxFilter'; +export * from './CDCGroupingFilter'; +export * from './CDCRangeFilter'; +export * from './CDCTextFilter'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/filter/index.js.map b/dist/cdc/filter/index.js.map new file mode 100644 index 000000000..74a6d7fb2 --- /dev/null +++ b/dist/cdc/filter/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdc/filter/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/dist/cdc/index.d.ts b/dist/cdc/index.d.ts index d6dbffba6..cc99a9901 100644 --- a/dist/cdc/index.d.ts +++ b/dist/cdc/index.d.ts @@ -1 +1,6 @@ +export * from './alert'; +export * from './creator'; +export * from './filter'; +export * from './api'; export * from './CDCFilterDialog'; +export * from './interfaces'; diff --git a/dist/cdc/index.js b/dist/cdc/index.js index 2edb11929..5894b98d0 100644 --- a/dist/cdc/index.js +++ b/dist/cdc/index.js @@ -1,2 +1,7 @@ +export * from './alert'; +export * from './creator'; +export * from './filter'; +export * from './api'; export * from './CDCFilterDialog'; +export * from './interfaces'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/index.js.map b/dist/cdc/index.js.map index fcb79e5dd..8651e4bbf 100644 --- a/dist/cdc/index.js.map +++ b/dist/cdc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cdc/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cdc/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interface.d.ts b/dist/cdc/interface.d.ts deleted file mode 100644 index 49386feee..000000000 --- a/dist/cdc/interface.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/// -export interface IFilterComponent { - clazz: (props: { - value: V; - onValueChanged?: (value: V) => void; - disabled: boolean; - }) => JSX.Element; - toFilter?: (value: V) => string; -} -export interface IFilter { - id: string; - name: string; - disableRemoving?: boolean; - disableDragging?: boolean; - disableDropping?: boolean; - operator?: 'AND' | 'OR' | 'NOT'; - componentId: string; - componentValue: V; - children?: IFilter[]; -} -export declare const itemTypes: { - FILTERCARD: string; -}; -export declare const getFilterFromTree: (filter: IFilter, id: string) => { - parent: IFilter | null; - current: IFilter | null; -}; -export declare const getTreeQuery: (filter: IFilter, components: { - [key: string]: IFilterComponent; -}) => string; -export interface IAlert { - id: number; - name: string; - cdc_id: string; - filter: IFilter; - filter_query: string; - enable_mail_notification: boolean; - latest_diff: { - dictionary_item_added?: string[]; - dictionary_item_removed?: string[]; - values_changed?: { - id: string; - field: []; - old_value: string; - new_value: string; - }[]; - }; - latest_fetched_data: any; - latest_compare_date: Date; - modification_date: string; - confirmed_data: any; - confirmation_date: Date; - compare_columns: { - label: string; - value: string; - }[]; -} -export interface IUploadAlert extends Pick { -} -export declare function isAlert(obj: IAlert | IUploadAlert): obj is IAlert; diff --git a/dist/cdc/interface.js b/dist/cdc/interface.js deleted file mode 100644 index 1ba549514..000000000 --- a/dist/cdc/interface.js +++ /dev/null @@ -1,58 +0,0 @@ -export const itemTypes = { - FILTERCARD: 'filtercard' -}; -export const getFilterFromTree = (filter, id) => { - if ((filter === null || filter === void 0 ? void 0 : filter.id) === id) { - return { current: filter, parent: null }; - } - else if (filter && filter.children) { - // Is the id part of my children? - const current = filter.children.find((f) => f.id === id); - if (current) { - return { parent: filter, current }; - } - // Otherwise, continue with all children - for (const f of filter.children) { - const current = getFilterFromTree(f, id); - if (current.current) { - return current; - } - } - } - return { parent: null, current: null }; -}; -export const getTreeQuery = (filter, components) => { - var _a, _b; - if (!filter) { - return ''; - } - if (!filter.children) { - //leaf filter - if (filter && - components && ((_a = components[filter.componentId]) === null || _a === void 0 ? void 0 : _a.clazz) && ((_b = components[filter.componentId]) === null || _b === void 0 ? void 0 : _b.toFilter)) { - return components[filter.componentId].toFilter(filter.componentValue); - } - else { - return ''; - } - } - else { - //go through every child - let returnValue = '('; - filter.children.forEach((child, i) => { - var _a; - returnValue += `${getTreeQuery(child, components)}${filter.children && i < filter.children.length - 1 - ? ` ${(filter === null || filter === void 0 ? void 0 : filter.operator) === 'NOT' - ? 'and not' - : (_a = filter === null || filter === void 0 ? void 0 : filter.operator) === null || _a === void 0 ? void 0 : _a.toLowerCase()} ` - : ''}`; - }); - returnValue += ')'; - return returnValue; - } -}; -export function isAlert(obj) { - var _a; - return typeof ((_a = obj) === null || _a === void 0 ? void 0 : _a.id) === 'number'; -} -//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/dist/cdc/interface.js.map b/dist/cdc/interface.js.map deleted file mode 100644 index 858825a56..000000000 --- a/dist/cdc/interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/cdc/interface.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IA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G,CAAC;gBACnG,CAAC,CAAC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAK,KAAK;oBAC9B,CAAC,CAAC,SAAS;oBACX,CAAC,OAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,WAAW,EACjC,GAAG;gBACH,CAAC,CAAC,EACF,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;QACH,WAAW,IAAI,GAAG,CAAC;QACnB,OAAO,WAAW,CAAC;KACpB;AACH,CAAC,CAAC;AAoBF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interfaces.d.ts b/dist/cdc/interfaces.d.ts index f8cffb5a9..2eaf69e0c 100644 --- a/dist/cdc/interfaces.d.ts +++ b/dist/cdc/interfaces.d.ts @@ -41,10 +41,16 @@ export interface IAlert { new_value: string; }[]; }; - latest_fetched_data: any; + latest_fetched_data: { + _cdc_compare_id: string; + [key: string]: any; + }[]; latest_compare_date: Date; modification_date: string; - confirmed_data: any; + confirmed_data?: { + _cdc_compare_id: string; + [key: string]: any; + }[]; confirmation_date: Date; compare_columns: string[]; } @@ -52,3 +58,7 @@ export interface IUploadAlert extends Pick, config?: any}}; @@ -17,15 +14,14 @@ interface ICDCFilterDialogProps { compareColumnOptions: string[]; } -export const DEFAULTALERTDATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'demo', filter: null, compare_columns: null}; -export const DEFAULTFILTER = {...createCDCGroupingFilter(uuidv4())}; +export const CDC_DEFAULT_ALERT_DATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: null, compare_columns: null}; +export const CDC_DEFAULT_FILTER = {...createCDCGroupingFilter(uuidv4())}; export const runAlert = async (id: number): Promise => { - const runAlert = runAlertById(id).then((alert) => {return alert}).catch((e) => { + return runAlertById(id).then((alert) => {return alert;}).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); return null; }); - return runAlert; }; export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOptions}: ICDCFilterDialogProps) { @@ -34,20 +30,21 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); - const [cdcs, setCdcs] = React.useState(); const {status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts} = useAsync(getAlerts, true); + // TODO: CDCs are more complex than just filters, i.e. they also have fields. + const cdcs = Object.keys(filtersByCDC); + React.useEffect(() => { - setAlertData(DEFAULTALERTDATA); - setFilter(DEFAULTFILTER); - setCdcs(['demo']); + setAlertData(CDC_DEFAULT_ALERT_DATA); + setFilter(CDC_DEFAULT_FILTER); }, []); const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); - setAlertData(DEFAULTALERTDATA); - setFilter(DEFAULTFILTER); + setAlertData(CDC_DEFAULT_ALERT_DATA); + setFilter(CDC_DEFAULT_FILTER); }; const onAlertClick = async (alert: IAlert) => { @@ -69,7 +66,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp }).catch((e) => console.error(e)); }; - console.log(filter) + console.log(filter); return <> setShowDialog(true)}> Alert Filter @@ -108,7 +105,7 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp filter={filter} setFilter={setFilter} filterComponents={filterComponents} - filterSelection={filtersByCDC['demo']} + filterSelection={filtersByCDC[alertData.cdc_id]} onAlertChanged={onAlertChanged} setCreationMode={setCreationMode} selectedAlert={selectedAlert} @@ -153,14 +150,19 @@ export class CDCFilterDialogClass { [CDCRangeFilterId]: {component: CDCRangeFilter, config: {minValue: 1, maxValue: 10}} }} filtersByCDC={{ - 'demo': [ + 'JSONPlaceholderUserCDC': [ createCDCGroupingFilter(uuidv4()), createCDCTextFilter(uuidv4(), 'Select...', null), createCDCCheckboxFilter(uuidv4(), {}), createCDCRangeFilter(uuidv4(), 'id', {min: 1, max: 10}), + ], + 'JSONPlaceholderPostsCDC': [ + createCDCGroupingFilter(uuidv4()), + createCDCRangeFilter(uuidv4(), 'id', {min: 1, max: 100}), ] }} - compareColumnOptions={['id', 'name', 'address.street', 'adress.city', 'address.zipcode']} + // TODO: This needs to be defined per CDC. Maybe we define this in the backend and fetch it via an API? + compareColumnOptions={['id', 'name', 'address.street', 'adress.city', 'address.zipcode', 'title', 'body']} />, this.node ); diff --git a/src/cdc/CDCAlertView.tsx b/src/cdc/alert/CDCAlertView.tsx similarity index 70% rename from src/cdc/CDCAlertView.tsx rename to src/cdc/alert/CDCAlertView.tsx index 296332857..2223cbac6 100644 --- a/src/cdc/CDCAlertView.tsx +++ b/src/cdc/alert/CDCAlertView.tsx @@ -1,15 +1,15 @@ import get from 'lodash.get'; import React from 'react'; import Select from 'react-select'; -import {runAlert} from '.'; -import {confirmAlertById, deleteAlert, editAlert, saveAlert} from './api'; -import {CDCFilterComponent} from './CDCFilterComponent'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interfaces'; +import {runAlert} from '..'; +import {confirmAlertById, deleteAlert, editAlert, saveAlert} from '../api'; +import {CDCFilterCreator} from '../creator'; +import {IAlert, IFilter, IFilterComponent, IUploadAlert, IReactSelectOption} from '../interfaces'; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; - filterSelection: IFilter[] | undefined; + filterSelection?: IFilter[]; filter: IFilter; setFilter: (filter: IFilter) => void; filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; @@ -24,22 +24,14 @@ interface ICDCEditAlert { export function CDCAlertView({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); - const [validName, setValidName] = React.useState(true); - const [validFilter, setValidFilter] = React.useState(true); + const validFilter = filter?.children.length > 0; + const validName = alertData?.name?.trim().length > 0; React.useEffect(() => { setEditMode(false); setDeleteMode(false); }, [selectedAlert]); - React.useEffect(() => { - setValidFilter(filter?.children.length > 0); - }, [filter]); - - React.useEffect(() => { - setValidName(alertData?.name?.trim().length > 0); - }, [alertData.name]); - const confirmChanges = async (id: number) => { const alert = await confirmAlertById(id); onAlertChanged(alert.id); @@ -83,49 +75,80 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, onAlertChanged(); }; + // TODO: Extract to component instead of inline function const literature = () => { - if (selectedAlert.latest_diff) { - const change: Map> = new Map(); + if (selectedAlert.latest_diff || selectedAlert.confirmed_data) { + const change: Map> = new Map(); selectedAlert.latest_diff?.values_changed?.map((d) => { - const nestedField = d.field.map((f) => f).join("."); + const nestedField = d.field.map((f) => f).join('.'); if (change.has(d.id)) { change.set(d.id, change.get(d.id).set(nestedField, {old: d.old_value, new: d.new_value})); } else { - change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); + change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); } }); return (<> -
    Changed data:
    - +
    - {selectedAlert.compare_columns?.map((field, i) => )} + + {selectedAlert.compare_columns.map((field, i) => )} + - - {selectedAlert.latest_diff.dictionary_item_added?.map((d) => { - const data = selectedAlert.latest_fetched_data.find(a => a.id === d); - return ( - {selectedAlert.compare_columns?.map((field, i) => )} - ); - })} - {selectedAlert.latest_diff.dictionary_item_removed?.map((d) => { - const data = selectedAlert.confirmed_data.find(a => a.id === d); - return ( - {selectedAlert.compare_columns?.map((field, i) => )} - ); - })} - {[...change.keys()]?.map((id, i) => { - const oldData = selectedAlert.confirmed_data?.find(a => a.id === id); - return ( - {selectedAlert.compare_columns?.map((field, index) => change.get(id).has(field) ? : )} - ); - })} + + {selectedAlert.latest_diff ? <> + {selectedAlert.latest_diff?.dictionary_item_added?.map((d) => { + const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); + return ( + + {selectedAlert.compare_columns.map((field, i) => )} + + ); + })} + {selectedAlert.latest_diff?.dictionary_item_removed?.map((d) => { + const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); + return ( + + {selectedAlert.compare_columns.map((field, i) => )} + + ); + })} + : null} + {selectedAlert.confirmed_data ? <> + {selectedAlert.confirmed_data + // Only show entries which are not already shown above + .filter((item) => !selectedAlert.latest_diff?.dictionary_item_added?.includes(item._cdc_compare_id) && !selectedAlert.latest_diff?.dictionary_item_removed?.includes(item._cdc_compare_id)) + // Sort such that rows with changes are on top + .sort((a, b) => (change.has(b._cdc_compare_id) ? 1 : 0) - (change.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { + const id = d._cdc_compare_id; + const hasChanged = change.has(id); + // TODO: All these .find() and .includes() should be refactored as they are O(n). + const isAlreadyHandled = selectedAlert.latest_diff?.dictionary_item_added?.includes(id) || selectedAlert.latest_diff?.dictionary_item_removed?.includes(id); + return (isAlreadyHandled ? null : + + + {selectedAlert.compare_columns.map((field) => ( + + {hasChanged ? ( + change.get(id).has(field) ? () : () + ) : ( + + )} + + ))} + + + ); + })} + : null}
    {field}ID{field}Status
    {get(data, field)}
    {get(data, field)}
    {change.get(id).get(field).old} {change.get(id).get(field).new}{get(oldData, field)}
    {data._cdc_compare_id}{get(data, field)}Added
    {data._cdc_compare_id}{get(data, field)}Removed
    {d._cdc_compare_id}{change.get(id).get(field).old} {change.get(id).get(field).new}{get(d, field)}{get(d, field)}{hasChanged ? <>Changed : null}
    -
    - -
    + {selectedAlert.latest_diff ?
    +
    + +
    +
    : null} ); } return

    No new data available

    ; @@ -155,7 +178,7 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, {`${selectedAlert.latest_diff ? 'Latest revision from: ' + new Date(selectedAlert.latest_compare_date)?.toLocaleDateString() : 'No new data'}`} -
    +
    {literature()}
    @@ -182,22 +205,22 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter,
    - isMulti isDisabled={!creationMode && !editMode} closeMenuOnSelect={false} - options={compareColumnOptions.map((col) => {return {label: col, value: col}})} - value={alertData.compare_columns?.map((col) => {return {label: col, value: col}})} - onChange={(e) => setAlertData({...alertData, compare_columns: [...e.map((col) => col.value)]})} + options={compareColumnOptions.map((c) => ({label: c, value: c}))} + value={alertData.compare_columns?.map((c) => ({label: c, value: c}))} + onChange={(e) => setAlertData({...alertData, compare_columns: e.map((col) => col.value)})} />
    @@ -210,7 +233,7 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter,
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    }
    @@ -267,7 +290,7 @@ const generalInformation =
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    }
    @@ -306,7 +329,7 @@ const alertInformation =
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    }
    @@ -378,7 +401,7 @@ const alterAlert =
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    } diff --git a/src/cdc/CDCCreateAlert.tsx b/src/cdc/alert/CDCCreateAlert.tsx similarity index 80% rename from src/cdc/CDCCreateAlert.tsx rename to src/cdc/alert/CDCCreateAlert.tsx index 1cc4b4d6a..5527d7915 100644 --- a/src/cdc/CDCCreateAlert.tsx +++ b/src/cdc/alert/CDCCreateAlert.tsx @@ -1,9 +1,9 @@ import React from 'react'; import Select from 'react-select'; import {runAlert} from '..'; -import {saveAlert} from './api'; -import {CDCFilterComponent} from './CDCFilterComponent'; -import {IFilter, IFilterComponent, IUploadAlert} from './interfaces'; +import {saveAlert} from '../api'; +import {CDCFilterCreator} from '../creator'; +import {IFilter, IFilterComponent, IUploadAlert, IReactSelectOption} from '../interfaces'; interface ICDCCreateAlert { alertData: IUploadAlert; @@ -19,16 +19,8 @@ interface ICDCCreateAlert { } export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions}: ICDCCreateAlert) { - const [validFilter, setValidFilter] = React.useState(true); - const [validName, setValidName] = React.useState(true); - - React.useEffect(() => { - setValidFilter(filter?.children.length > 0); - }, [filter]); - - React.useEffect(() => { - setValidName(alertData?.name?.trim().length > 0); - }, [alertData.name]); + const validFilter = filter?.children.length > 0; + const validName = alertData?.name?.trim().length > 0; const onSave = async () => { if (validFilter && validName) { @@ -71,12 +63,18 @@ export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter
    - {return {label: conf.field, value: conf.field}})]} + options={[...config?.map((conf) => {return {label: conf.field, value: conf.field};})]} onChange={(e) => onFieldChanged?.(e.value)} />
    @@ -35,8 +40,8 @@ export function CDCTextFilterComponent({value, onValueChanged, onFieldChanged, d closeMenuOnSelect={false} isDisabled={!onValueChanged || disabled || !field} isMulti - value={value?.map((v) => {return {label: v, value: v}})} - options={config?.find((f) => f?.field === field)?.options.map((o) => {return {label: o, value: o}})} + value={value?.map((v) => {return {label: v, value: v};})} + options={config?.find((f) => f?.field === field)?.options.map((o) => {return {label: o, value: o};})} onChange={(e) => onValueChanged?.([...e.map((v) => v.value)])} />
    diff --git a/src/cdc/filter/index.ts b/src/cdc/filter/index.ts new file mode 100644 index 000000000..31a7ed909 --- /dev/null +++ b/src/cdc/filter/index.ts @@ -0,0 +1,4 @@ +export * from './CDCCheckboxFilter'; +export * from './CDCGroupingFilter'; +export * from './CDCRangeFilter'; +export * from './CDCTextFilter'; diff --git a/src/cdc/index.ts b/src/cdc/index.ts index d6dbffba6..cc99a9901 100644 --- a/src/cdc/index.ts +++ b/src/cdc/index.ts @@ -1 +1,6 @@ +export * from './alert'; +export * from './creator'; +export * from './filter'; +export * from './api'; export * from './CDCFilterDialog'; +export * from './interfaces'; diff --git a/src/cdc/interfaces.ts b/src/cdc/interfaces.ts index b21c855cd..94196e45c 100644 --- a/src/cdc/interfaces.ts +++ b/src/cdc/interfaces.ts @@ -10,7 +10,6 @@ export interface IFilterComponent { disableDropping?: boolean; } - export interface IFilter { id: string; operator?: 'AND' | 'OR'; @@ -47,36 +46,6 @@ export const getFilterFromTree = ( return {parent: null, current: null}; }; -// export const getTreeQuery = (filter: IFilter, components: {[key: string]: IFilterComponent}) => { -// if (!filter) { -// return ''; -// } -// if (!filter.children) { -// //leaf filter -// if ( -// filter && -// components && -// components[filter.type]?.clazz && -// components[filter.type]?.toFilter -// ) { -// return components[filter.type].toFilter(filter.componentValue); -// } else { -// return ''; -// } -// } else { -// //go through every child -// let returnValue = '('; -// filter.children.forEach((child, i) => { -// returnValue += `${getTreeQuery(child, components)}${filter.children && i < filter.children.length - 1 -// ? ` ${filter?.operator?.toLowerCase()} ` -// : '' -// }`; -// }); -// returnValue += ')'; -// return returnValue; -// } -// }; - export interface IAlert { id: number; name: string; @@ -84,10 +53,16 @@ export interface IAlert { filter: IFilter; enable_mail_notification: boolean; latest_diff: {dictionary_item_added?: string[], dictionary_item_removed?: string[], values_changed?: {id: string, field: [], old_value: string, new_value: string}[]}; - latest_fetched_data: any; + latest_fetched_data: { + _cdc_compare_id: string; + [key: string]: any; + }[]; latest_compare_date: Date; modification_date: string; - confirmed_data: any; + confirmed_data?: { + _cdc_compare_id: string; + [key: string]: any; + }[]; confirmation_date: Date; compare_columns: string[]; } //TODO: remove any @@ -99,3 +74,9 @@ export interface IUploadAlert extends Pick Union[BaseCDC, None]: + def get_cdc(self, id: str) -> Union[BaseCDC, None]: return next((c for c in cdc_manager.cdcs if c.id == id), None) def run_alert(self, alert: CDCAlert): _log.info(f'Refreshing alert {alert.cdc_id}') - cdc = self.getCDC(alert.cdc_id) + cdc = self.get_cdc(alert.cdc_id) if not cdc: raise Exception(f'Missing cdc {alert.cdc_id}') @@ -31,45 +28,23 @@ def run_alert(self, alert: CDCAlert): # TODO: Define options like username? }) - new = [item for item in new if eval(alert.filter_query)] + new = Filter().load(alert.filter)._apply(new) - - fields = [col["value"] for col in alert.compare_columns] for i, item in enumerate(new): new_item = { - '_cdc_compare_id': cdc.get_id(item), + '_cdc_compare_id': str(cdc.get_id(item)), # TODO: Recursive lookup and field selection - **item + # **item } - for field in fields: - # new_item[field] = FieldFilterMixin.access(item, field) + for field in alert.compare_columns: + new_item[field] = FieldFilterMixin.access(item, field) new[i] = new_item - # Filter new entry - # '(item["id"] in (4, 5, 6, 7, 8) and not (item["id"] == 5 and item["id"] == 4 or item["id"] == 8)) or ((item["address"]["city"] == "Gwenborough") and (item["id"] > 0 and item["id"] < 5))' - - - # filter = { - # 'operator': 'AND', - # 'filters': [{ - # 'query': 'num1 == false && num2 == true' - # }, { - # 'operator': 'OR', - # 'filters': [{ - # }, { - # 'query': '' - # }] - # }] - # } - # filter = '(num1 == false AND num2 == true) AND ((age1 >= ...) OR (age1 <= ...))' - # TODO: How to find a proper "filter" library? - # 1) [item for item in new if exec('item.age >= 20')] - # 2) new_df = pd.DataFrame.from_dict(new) - # new_df = new_df.query('name == ["test123", "asdfasdf"] or age > 40 and ...') - # Compare confirmed with new entry diff = cdc.compare(alert.confirmed_data, new) + _log.info(diff.to_dict()) + if "dictionary_item_removed" in diff: diff["dictionary_item_removed"] = [rm.path(output_format='list')[0] for rm in diff["dictionary_item_removed"]] @@ -88,13 +63,16 @@ def run_alert(self, alert: CDCAlert): new_values_changed.append(new_obj) diff["values_changed"] = new_values_changed + _log.info("New") + _log.info(diff) + return new, diff - def registerCDC(self, cdc: BaseCDC): + def register_cdc(self, cdc: BaseCDC): _log.info(f'Registered CDC {cdc.id}') self.cdcs.append(cdc) - def refreshCDC(self, cdc: BaseCDC): + def refresh_cdc(self, cdc: BaseCDC): _log.info(f'Refreshing CDC {cdc.id}') # Get existing entry old = cdc.load_existing() @@ -102,27 +80,6 @@ def refreshCDC(self, cdc: BaseCDC): # Fetch new entry new = cdc.load_data() - # validate filter tree - - # { - # id: 'group', - # value: {operator: 'AND'} - # filters: [{ - # id: 'range', - # value: {from: 1, to: 2, field: 'address.zipCode'} - # }, { - # id: 'group', - # value: {operator: 'AND'}, - # filters: [...] - # }] - # } - - class GroupFilter(): - pass - # schema = .. - - # def filter(item: Dict[...], ..) - # Filter new entry new = [item for item in new if eval('(item["id"] in (4, 5, 6, 7, 8) and not (item["id"] == 5 and item["id"] == 4 or item["id"] == 8)) or ((item["address"]["city"] == "Gwenborough") and (item["id"] > 0 and item["id"] < 5))')] @@ -142,4 +99,5 @@ class GroupFilter(): cdc_manager = CDCManager() -cdc_manager.registerCDC(DemoCDC()) +cdc_manager.register_cdc(JSONPlaceholderUserCDC()) +cdc_manager.register_cdc(JSONPlaceholderPostsCDC()) diff --git a/tdp_core/cdc/DemoCDC.py b/tdp_core/cdc/JSONPlaceholderPostsCDC.py similarity index 52% rename from tdp_core/cdc/DemoCDC.py rename to tdp_core/cdc/JSONPlaceholderPostsCDC.py index 44b085fa2..b670d715f 100644 --- a/tdp_core/cdc/DemoCDC.py +++ b/tdp_core/cdc/JSONPlaceholderPostsCDC.py @@ -1,21 +1,15 @@ -from types import LambdaType from typing import Dict from .BaseCDC import BaseCDC -import requests -import logging +import requests -_log = logging.getLogger(__name__) - -class DemoCDC(BaseCDC): +class JSONPlaceholderPostsCDC(BaseCDC): @property def id(self): - return 'demo' + return 'JSONPlaceholderPostsCDC' def load_data(self, options: Dict = {}): - _log.info('Loading up-to-date data') - return requests.get('https://jsonplaceholder.typicode.com/users').json() + return requests.get('https://jsonplaceholder.typicode.com/posts').json() def get_id(self, item): - _log.info(item) return item['id'] diff --git a/tdp_core/cdc/JSONPlaceholderUserCDC.py b/tdp_core/cdc/JSONPlaceholderUserCDC.py new file mode 100644 index 000000000..54ed6a2d3 --- /dev/null +++ b/tdp_core/cdc/JSONPlaceholderUserCDC.py @@ -0,0 +1,17 @@ +from typing import Dict +from .BaseCDC import BaseCDC +import requests + + +class JSONPlaceholderUserCDC(BaseCDC): + @property + def id(self): + return 'JSONPlaceholderUserCDC' + + def load_data(self, options: Dict = {}): + users = requests.get('https://jsonplaceholder.typicode.com/users').json() + # users[4]['name'] = 'Max Mustermann' + return users + + def get_id(self, item): + return item['id'] diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 037eeee7a..55a09c7a0 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -1,13 +1,11 @@ import logging from datetime import datetime - -import requests from flask_smorest import Api, Blueprint - from phovea_server.ns import Namespace, abort, no_cache from phovea_server.security import login_required, can_write, can_read, current_username from phovea_server.util import jsonify from .CDCAlert import CDCAlert, CDCAlertSchema, create_session, CDCAlertArgsSchema +from .CDCManager import cdc_manager app = Namespace(__name__) app.config['OPENAPI_VERSION'] = '3.0.2' @@ -26,9 +24,10 @@ 'cdc', __name__, url_prefix='/' ) -#@app.errorhandler(400) -##@app.errorhandler(404) -#@app.errorhandler(500) + +@app.errorhandler(400) +@app.errorhandler(404) +@app.errorhandler(500) def handle_error(e): return jsonify(error=str(e.description), code=e.code), e.code @@ -43,10 +42,10 @@ def list_cdc(): @app.route('/cdc/', methods=['GET']) def execute_cdc(id: str): - cdc = cdc_manager.getCDC(id) + cdc = cdc_manager.get_cdc(id) if not cdc: abort(404, f'No cdc with id {id} available') - return cdc_manager.refreshCDC(cdc) + return cdc_manager.refresh_cdc(cdc) @no_cache @@ -62,18 +61,12 @@ def get_alerts(): @no_cache @login_required @blp.route('/alert', methods=["POST"]) -@blp.arguments(CDCAlertArgsSchema) -# @blp.response(CDCAlertSchema, code=200) +@blp.arguments(CDCAlertArgsSchema, location='json', description='Create an alert') +@blp.response(CDCAlertSchema, code=200) def create_alert(data): - users = requests.get('https://jsonplaceholder.typicode.com/users').json() - for user in users: - user["Eins"] = user["Zwei"] = user["Drei"] = False - users[1]["Eins"] = users[2]["Zwei"] = users[3]["Drei"] = True - fusers = data["filter"]["_apply"](users) - return jsonify(fusers) - - """ session = create_session() + # session.query(CDCAlert).delete() + alert = CDCAlertSchema().load(data, partial=True, session=session) # Security alert.creator = current_username() alert.creation_date = datetime.utcnow() @@ -86,7 +79,7 @@ def create_alert(data): session.add(alert) session.commit() return alert - """ + @no_cache @login_required @@ -163,16 +156,10 @@ def confirm_alert_by_id(id: str): abort(401) if not alert.latest_fetched_data: - abort(500, f'No data to confirm for id {id}') + abort(400, f'No data to confirm for id {id}') - # TODO: How to confirm this override? alert.confirmation_date = datetime.utcnow() alert.confirmed_data = alert.latest_fetched_data - alert.confirmed_data[1]['name'] = 'Herbert' - alert.confirmed_data[2]['name'] = 'Herbert' - alert.confirmed_data[1]['address']['street'] = 'Dornach' - alert.confirmed_data[2]['address']['city'] = 'Lünz' - alert.latest_compare_date = None alert.latest_fetched_data = None alert.latest_diff = None diff --git a/tdp_core/cdc/filter.py b/tdp_core/cdc/filter.py index 5feb2fcdf..41801618e 100644 --- a/tdp_core/cdc/filter.py +++ b/tdp_core/cdc/filter.py @@ -2,10 +2,14 @@ from operator import and_, or_, eq from re import match from typing import Dict, List, Any - from marshmallow import Schema, post_load, INCLUDE, fields +# Create a subclass of dict to allow adding arbitrary attributes +class MyDict(dict): + pass + + # This method contains all filter classes to avoid cyclic dependencies class Filter(Schema): """ Filter baseclass to delegate to children """ @@ -26,10 +30,13 @@ def postload(self, data: Dict, type: str, **_) -> Dict: filters = {f.__name__.lower(): f for f in Filter.__subclasses__()} assert type in filters, f"Error: Filter type {type} doesn't exist in {filters.values()}" sub_cls = filters[type] - # _prvate so it doesn't get serialized - data["_filt"] = filt = sub_cls().load(data) - data["_apply"] = lambda items: list(filter(filt, items)) - return data + filt = sub_cls().load(data) + # Create a MyDict to allow adding attributes + new_data = MyDict(**data) + # _private attributes so it doesn't get serialized + setattr(new_data, '_filt', filt) + setattr(new_data, '_apply', lambda items: list(filter(filt, items))) + return new_data class FieldFilterMixin: @@ -65,7 +72,7 @@ class Group(Filter): def postload(self, data: Dict, children: List, operator: str, **_): if not children: return lambda _: True - children = [Filter().load(child)["_filt"] for child in children] + children = [Filter().load(child)._filt for child in children] op = ALLOWED_OPERATORS[operator] return lambda d: reduce(op, [child(d) for child in children]) @@ -89,7 +96,7 @@ class Text(Filter, FieldFilterMixin): def postload(self, data: Dict, field: str, value: List[str], match_case: bool, match_exact: bool, **_): compare = eq if match_exact else str.__contains__ if match_case: - compare = lambda a, b: compare(b.lower(), a.lower()) # nopep8 # ignore lambda assign + compare = lambda a, b: compare(b.lower(), a.lower()) # NOQA E731 return lambda item: any(compare(FieldFilterMixin.access(item, field), v) for v in value) From 6d92646a709086f200243c8be6df7650a45cca92 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Fri, 12 Nov 2021 09:44:09 +0100 Subject: [PATCH 29/40] code refactoring + bug fix --- dist/cdc/CDCFilterDialog.js | 3 +- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/alert/CDCAlertView.js | 239 +-------------------- dist/cdc/alert/CDCAlertView.js.map | 2 +- dist/cdc/alert/CDCDataChangeTable.d.ts | 8 + dist/cdc/alert/CDCDataChangeTable.js | 80 +++++++ dist/cdc/alert/CDCDataChangeTable.js.map | 1 + dist/cdc/alert/index.d.ts | 1 - dist/cdc/alert/index.js | 1 - dist/cdc/alert/index.js.map | 2 +- dist/cdc/common/ErrorMessage.d.ts | 5 + dist/cdc/common/ErrorMessage.js | 8 + dist/cdc/common/ErrorMessage.js.map | 1 + dist/cdc/common/index.d.ts | 1 + dist/cdc/common/index.js | 2 + dist/cdc/common/index.js.map | 1 + dist/cdc/creator/CDCFilterCreator.js | 2 +- dist/cdc/creator/CDCFilterCreator.js.map | 2 +- dist/cdc/filter/CDCCheckboxFilter.js.map | 2 +- dist/cdc/filter/CDCRangeFilter.d.ts | 17 +- dist/cdc/filter/CDCRangeFilter.js.map | 2 +- dist/cdc/filter/CDCTextFilter.d.ts | 4 +- dist/cdc/filter/CDCTextFilter.js | 5 +- dist/cdc/filter/CDCTextFilter.js.map | 2 +- dist/cdc/index.d.ts | 1 + dist/cdc/index.js | 1 + dist/cdc/index.js.map | 2 +- dist/cdc/interfaces.d.ts | 9 +- dist/cdc/interfaces.js.map | 2 +- src/cdc/CDCFilterDialog.tsx | 7 +- src/cdc/alert/CDCAlertView.tsx | 258 +---------------------- src/cdc/alert/CDCCreateAlert.tsx | 98 --------- src/cdc/alert/CDCDataChangeTable.tsx | 106 ++++++++++ src/cdc/alert/index.ts | 1 - src/cdc/common/ErrorMessage.tsx | 15 ++ src/cdc/common/index.ts | 1 + src/cdc/creator/CDCFilterCreator.tsx | 2 +- src/cdc/filter/CDCCheckboxFilter.tsx | 1 - src/cdc/filter/CDCRangeFilter.tsx | 14 +- src/cdc/filter/CDCTextFilter.tsx | 12 +- src/cdc/index.ts | 3 +- src/cdc/interfaces.ts | 12 +- tdp_core/cdc/CDCAlert.py | 3 + tdp_core/cdc/api.py | 32 ++- 44 files changed, 311 insertions(+), 662 deletions(-) create mode 100644 dist/cdc/alert/CDCDataChangeTable.d.ts create mode 100644 dist/cdc/alert/CDCDataChangeTable.js create mode 100644 dist/cdc/alert/CDCDataChangeTable.js.map create mode 100644 dist/cdc/common/ErrorMessage.d.ts create mode 100644 dist/cdc/common/ErrorMessage.js create mode 100644 dist/cdc/common/ErrorMessage.js.map create mode 100644 dist/cdc/common/index.d.ts create mode 100644 dist/cdc/common/index.js create mode 100644 dist/cdc/common/index.js.map delete mode 100644 src/cdc/alert/CDCCreateAlert.tsx create mode 100644 src/cdc/alert/CDCDataChangeTable.tsx create mode 100644 src/cdc/common/ErrorMessage.tsx create mode 100644 src/cdc/common/index.ts diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index 0975e799a..a4e48fdc3 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -51,7 +51,6 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnO } }).catch((e) => console.error(e)); }; - console.log(filter); return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), @@ -105,6 +104,7 @@ export class CDCFilterDialogClass { parent.appendChild(this.node); this.init(); } + //{id: .., filters: filter[], compareColumns: [], config: [id]: config} --> überschreibt die config einer bestimmten init() { ReactDOM.render(React.createElement(CDCFilterDialog, { filterComponents: { [CDCGroupingFilterId]: { component: CDCGroupingFilter }, @@ -113,6 +113,7 @@ export class CDCFilterDialogClass { [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 10 } } }, filtersByCDC: { 'JSONPlaceholderUserCDC': [ + // [CDCTextFilterId]: {filter (defaultwert): createCDCGroupingFilter(uuidv4()), component: CDCTextFilter, config: [{field: 'address.city', options: ['Gwenborough', 'Wisokyburgh', 'McKenziehaven', 'Roscoeview', 'Aliyaview', 'Howemouth']}, {field: 'address.zipcode', options: ['33263', '23505-1337', '58804-1099']}, {field: 'name', options: ['Leanne Graham', 'Ervin Howell', 'Glenna Reichert', 'Clementina DuBuque']}]}, createCDCGroupingFilter(uuidv4()), createCDCTextFilter(uuidv4(), 'Select...', null), createCDCCheckboxFilter(uuidv4(), {}), diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index 411cdfca7..e36200798 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClN,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,EAAC,aAAa,EAA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EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,GACzG,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCAlertView.js b/dist/cdc/alert/CDCAlertView.js index d11c3fabe..a412b3461 100644 --- a/dist/cdc/alert/CDCAlertView.js +++ b/dist/cdc/alert/CDCAlertView.js @@ -1,9 +1,9 @@ -import get from 'lodash.get'; import React from 'react'; import Select from 'react-select'; import { runAlert } from '..'; -import { confirmAlertById, deleteAlert, editAlert, saveAlert } from '../api'; +import { deleteAlert, editAlert, saveAlert } from '../api'; import { CDCFilterCreator } from '../creator'; +import { CDCDataChangeTable } from './CDCDataChangeTable'; export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode }) { var _a, _b, _c; const [editMode, setEditMode] = React.useState(false); @@ -14,10 +14,6 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, setEditMode(false); setDeleteMode(false); }, [selectedAlert]); - const confirmChanges = async (id) => { - const alert = await confirmAlertById(id); - onAlertChanged(alert.id); - }; const onCreateSave = async () => { if (validFilter && validName) { const newAlert = await saveAlert({ ...alertData, filter }) @@ -52,68 +48,6 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, await deleteAlert(id); onAlertChanged(); }; - // TODO: Extract to component instead of inline function - const literature = () => { - var _a, _b, _c, _d, _e, _f; - if (selectedAlert.latest_diff || selectedAlert.confirmed_data) { - const change = new Map(); - (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.values_changed) === null || _b === void 0 ? void 0 : _b.map((d) => { - const nestedField = d.field.map((f) => f).join('.'); - if (change.has(d.id)) { - change.set(d.id, change.get(d.id).set(nestedField, { old: d.old_value, new: d.new_value })); - } - else { - change.set(d.id, new Map().set(nestedField, { old: d.old_value, new: d.new_value })); - } - }); - return (React.createElement(React.Fragment, null, - React.createElement("table", { className: "table mb-0" }, - React.createElement("thead", null, - React.createElement("tr", null, - React.createElement("th", { scope: "col" }, "ID"), - selectedAlert.compare_columns.map((field, i) => React.createElement("th", { key: field, scope: "col" }, field)), - React.createElement("th", { scope: "col" }, "Status"))), - React.createElement("tbody", { style: { maxHeight: 600, overflow: 'auto' } }, - selectedAlert.latest_diff ? React.createElement(React.Fragment, null, (_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_added) === null || _d === void 0 ? void 0 : - _d.map((d) => { - const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); - return (React.createElement("tr", { key: d, className: "table-success" }, - React.createElement("td", { scope: "row" }, data._cdc_compare_id), - selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), - React.createElement("td", null, "Added"))); - }), (_f = (_e = selectedAlert.latest_diff) === null || _e === void 0 ? void 0 : _e.dictionary_item_removed) === null || _f === void 0 ? void 0 : - _f.map((d) => { - const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); - return (React.createElement("tr", { key: d, className: "table-danger" }, - React.createElement("td", { scope: "row" }, data._cdc_compare_id), - selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), - React.createElement("td", null, "Removed"))); - })) : null, - selectedAlert.confirmed_data ? React.createElement(React.Fragment, null, selectedAlert.confirmed_data - // Only show entries which are not already shown above - .filter((item) => { var _a, _b, _c, _d; return !((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(item._cdc_compare_id)) && !((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(item._cdc_compare_id)); }) - // Sort such that rows with changes are on top - .sort((a, b) => (change.has(b._cdc_compare_id) ? 1 : 0) - (change.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { - var _a, _b, _c, _d; - const id = d._cdc_compare_id; - const hasChanged = change.has(id); - // TODO: All these .find() and .includes() should be refactored as they are O(n). - const isAlreadyHandled = ((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(id)) || ((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(id)); - return (isAlreadyHandled ? null : - React.createElement("tr", { key: id, className: `${hasChanged ? 'table-primary' : ''}` }, - React.createElement("td", { scope: "row" }, d._cdc_compare_id), - selectedAlert.compare_columns.map((field) => (React.createElement(React.Fragment, { key: field }, hasChanged ? (change.get(id).has(field) ? (React.createElement("td", null, - React.createElement("s", null, change.get(id).get(field).old), - " ", - change.get(id).get(field).new)) : (React.createElement("td", null, get(d, field)))) : (React.createElement("td", { key: field }, get(d, field)))))), - React.createElement("td", null, hasChanged ? React.createElement(React.Fragment, null, "Changed") : null))); - })) : null)), - selectedAlert.latest_diff ? React.createElement("div", { className: "p-1" }, - React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => confirmChanges(selectedAlert.id) }, "Confirm"))) : null)); - } - return React.createElement("p", null, "No new data available"); - }; const editButton = !editMode && !deleteMode && !creationMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, React.createElement("i", { className: "fas fa-pencil-alt" })), @@ -136,7 +70,8 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, React.createElement("div", { key: "one", className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: "heading-one" }, React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_b = new Date(selectedAlert.latest_compare_date)) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()) : 'No new data'}`)), - React.createElement("div", { id: "collapse-one", className: "accordion-collapse collapse show", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, literature())) + React.createElement("div", { id: "collapse-one", className: "accordion-collapse collapse show", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, + React.createElement(CDCDataChangeTable, { selectedAlert: selectedAlert, onAlertChanged: onAlertChanged }))) : null, React.createElement("div", { key: "two", className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: "heading-two" }, @@ -168,170 +103,4 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, : React.createElement("p", null, "No filters available for this cdc"))))))); } -/* -const generalInformation = - <> -
    -
    - - {!editMode ? -
    {alertData.name}
    - : - <> setAlertData({...alertData, name: e.target.value})} /> - {validName ? null : -
    - Name must not be empty! -
    } - } -
    -
    - - setAlertData({...alertData, compare_columns: [...e]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    - ; - - -const alertInformation = -<> -
    -
    - -
    {alertData.name}
    -
    -
    - - -
    -
    - -
    - - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    -; - -const onCreateSave = async () => { - if (validFilter && validName) { - const newAlert = await saveAlert({...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } -}; - - const onEditSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } -}; - -const alterAlert = -<> -
    -
    -
    - - setAlertData({...alertData, name: e.target.value})} required /> - {validName ? null : -
    - Name must not be empty! -
    } -
    -
    - - setAlertData({...alertData, compare_columns: [...e]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    - } -
    -
    -; - -*/ //# sourceMappingURL=CDCAlertView.js.map \ No newline at end of file diff --git a/dist/cdc/alert/CDCAlertView.js.map b/dist/cdc/alert/CDCAlertView.js.map index 59a002896..300ebbac4 100644 --- a/dist/cdc/alert/CDCAlertView.js.map +++ b/dist/cdc/alert/CDCAlertView.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCAlertView.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCAlertView.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAkB5C,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAgB;;IACnN,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,MAAM,IAAG,CAAC,CAAC;IAChD,MAAM,SAA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CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;wBAC7L,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCDataChangeTable.d.ts b/dist/cdc/alert/CDCDataChangeTable.d.ts new file mode 100644 index 000000000..16bd6f8a3 --- /dev/null +++ b/dist/cdc/alert/CDCDataChangeTable.d.ts @@ -0,0 +1,8 @@ +/// +import { IAlert } from "../interfaces"; +interface ICDCDataChangeTable { + selectedAlert: IAlert; + onAlertChanged: (id?: number) => void; +} +export declare function CDCDataChangeTable({ selectedAlert, onAlertChanged }: ICDCDataChangeTable): JSX.Element; +export {}; diff --git a/dist/cdc/alert/CDCDataChangeTable.js b/dist/cdc/alert/CDCDataChangeTable.js new file mode 100644 index 000000000..100a8d3bc --- /dev/null +++ b/dist/cdc/alert/CDCDataChangeTable.js @@ -0,0 +1,80 @@ +import { get } from "lodash"; +import React, { useEffect } from "react"; +import { useAsync } from "../../hooks"; +import { confirmAlertById } from "../api"; +import { ErrorMessage } from "../common/ErrorMessage"; +export function CDCDataChangeTable({ selectedAlert, onAlertChanged }) { + var _a, _b, _c, _d; + const [dataChange, setDataChange] = React.useState(new Map()); + useEffect(() => { + var _a, _b, _c; + if ((_a = selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.values_changed) { + const change = new Map(); + (_c = (_b = selectedAlert.latest_diff) === null || _b === void 0 ? void 0 : _b.values_changed) === null || _c === void 0 ? void 0 : _c.map((d) => { + const nestedField = d.field.map((f) => f).join('.'); + if (change.has(d.id)) { + change.set(d.id, change.get(d.id).set(nestedField, { old: d.old_value, new: d.new_value })); + } + else { + change.set(d.id, new Map().set(nestedField, { old: d.old_value, new: d.new_value })); + } + }); + setDataChange(change); + } + else { + setDataChange(new Map()); + } + }, [selectedAlert]); + const { status: confirmStatus, error: confirmError, execute: doConfirm } = useAsync(async () => { + const alert = await confirmAlertById(selectedAlert.id); + onAlertChanged(alert.id); + }, false); + //loading icon when loading + return (React.createElement(React.Fragment, null, selectedAlert.latest_diff || selectedAlert.confirmed_data ? (React.createElement(React.Fragment, null, + React.createElement("table", { className: "table mb-0" }, + React.createElement("thead", null, + React.createElement("tr", null, + React.createElement("th", { scope: "col" }, "ID"), + selectedAlert.compare_columns.map((field, i) => React.createElement("th", { key: field, scope: "col" }, field)), + React.createElement("th", { scope: "col" }, "Status"))), + React.createElement("tbody", { style: { maxHeight: 600, overflow: 'auto' } }, + selectedAlert.latest_diff ? React.createElement(React.Fragment, null, (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : + _b.map((d) => { + const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); + return (React.createElement("tr", { key: d, className: "table-success" }, + React.createElement("td", { scope: "row" }, data._cdc_compare_id), + selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), + React.createElement("td", null, "Added"))); + }), (_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : + _d.map((d) => { + const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); + return (React.createElement("tr", { key: d, className: "table-danger" }, + React.createElement("td", { scope: "row" }, data._cdc_compare_id), + selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), + React.createElement("td", null, "Removed"))); + })) : null, + selectedAlert.confirmed_data ? React.createElement(React.Fragment, null, selectedAlert.confirmed_data + // Only show entries which are not already shown above + .filter((item) => { var _a, _b, _c, _d; return !((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(item._cdc_compare_id)) && !((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(item._cdc_compare_id)); }) + // Sort such that rows with changes are on top + .sort((a, b) => (dataChange.has(b._cdc_compare_id) ? 1 : 0) - (dataChange.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { + var _a, _b, _c, _d; + const id = d._cdc_compare_id; + const hasChanged = dataChange.has(id); + // TODO: All these .find() and .includes() should be refactored as they are O(n). + const isAlreadyHandled = ((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(id)) || ((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(id)); + return (isAlreadyHandled ? null : + React.createElement("tr", { key: id, className: `${hasChanged ? 'table-primary' : ''}` }, + React.createElement("td", { scope: "row" }, d._cdc_compare_id), + selectedAlert.compare_columns.map((field) => (React.createElement(React.Fragment, { key: field }, hasChanged ? (dataChange.get(id).has(field) ? (React.createElement("td", null, + React.createElement("s", null, dataChange.get(id).get(field).old), + " ", + dataChange.get(id).get(field).new)) : (React.createElement("td", null, get(d, field)))) : (React.createElement("td", { key: field }, get(d, field)))))), + React.createElement("td", null, hasChanged ? React.createElement(React.Fragment, null, "Changed") : null))); + })) : null)), + selectedAlert.latest_diff ? React.createElement("div", { className: "p-1" }, + React.createElement(ErrorMessage, { error: confirmError, onRetry: () => doConfirm() }), + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement("button", { disabled: confirmStatus === 'pending', title: "Confirm changes", className: "btn btn-primary", onClick: () => doConfirm() }, "Confirm"))) : null)) : React.createElement("p", null, "No new data available"))); +} +//# sourceMappingURL=CDCDataChangeTable.js.map \ No newline at end of file diff --git a/dist/cdc/alert/CDCDataChangeTable.js.map b/dist/cdc/alert/CDCDataChangeTable.js.map new file mode 100644 index 000000000..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/cdc/alert/index.d.ts b/dist/cdc/alert/index.d.ts index bd6218074..13dae734d 100644 --- a/dist/cdc/alert/index.d.ts +++ b/dist/cdc/alert/index.d.ts @@ -1,2 +1 @@ export * from './CDCAlertView'; -export * from './CDCCreateAlert'; diff --git a/dist/cdc/alert/index.js b/dist/cdc/alert/index.js index 531cfa119..e0181ad3d 100644 --- a/dist/cdc/alert/index.js +++ b/dist/cdc/alert/index.js @@ -1,3 +1,2 @@ export * from './CDCAlertView'; -export * from './CDCCreateAlert'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/alert/index.js.map b/dist/cdc/alert/index.js.map index 320894a67..8b59d24e0 100644 --- a/dist/cdc/alert/index.js.map +++ b/dist/cdc/alert/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdc/alert/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdc/alert/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/dist/cdc/common/ErrorMessage.d.ts b/dist/cdc/common/ErrorMessage.d.ts new file mode 100644 index 000000000..6a1a1cc07 --- /dev/null +++ b/dist/cdc/common/ErrorMessage.d.ts @@ -0,0 +1,5 @@ +/// +export declare function ErrorMessage({ error, onRetry }: { + error: Error | null; + onRetry?: () => void; +}): JSX.Element; diff --git a/dist/cdc/common/ErrorMessage.js b/dist/cdc/common/ErrorMessage.js new file mode 100644 index 000000000..ad131c13a --- /dev/null +++ b/dist/cdc/common/ErrorMessage.js @@ -0,0 +1,8 @@ +import * as React from 'react'; +export function ErrorMessage({ error, onRetry }) { + return error ? (React.createElement("div", { className: "alert alert-danger flex-fill d-flex align-items-center", role: "alert" }, + React.createElement("i", { className: "fas fa-fw fa-exclamation" }), + React.createElement("div", { className: "flex-fill" }, error.toString()), + onRetry ? (React.createElement("button", { type: "button", className: "btn btn-sm btn-outline-danger", onClick: onRetry }, "Retry")) : null)) : null; +} +//# sourceMappingURL=ErrorMessage.js.map \ No newline at end of file diff --git a/dist/cdc/common/ErrorMessage.js.map b/dist/cdc/common/ErrorMessage.js.map new file mode 100644 index 000000000..dc2789c24 --- /dev/null +++ b/dist/cdc/common/ErrorMessage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../../src/cdc/common/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,YAAY,CAAC,EAAC,KAAK,EAAE,OAAO,EAA8C;IACzF,OAAO,KAAK,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAC,wDAAwD,EAAC,IAAI,EAAC,OAAO;QACnF,2BAAG,SAAS,EAAC,0BAA0B,GAAG;QAC1C,6BAAK,SAAS,EAAC,WAAW,IAAE,KAAK,CAAC,QAAQ,EAAE,CAAO;QAClD,OAAO,CAAC,CAAC,CAAC,CACV,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,+BAA+B,EAAC,OAAO,EAAE,OAAO,YAEvE,CACT,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC"} \ No newline at end of file diff --git a/dist/cdc/common/index.d.ts b/dist/cdc/common/index.d.ts new file mode 100644 index 000000000..3dee9621e --- /dev/null +++ b/dist/cdc/common/index.d.ts @@ -0,0 +1 @@ +export * from './ErrorMessage'; diff --git a/dist/cdc/common/index.js b/dist/cdc/common/index.js new file mode 100644 index 000000000..fd897c741 --- /dev/null +++ b/dist/cdc/common/index.js @@ -0,0 +1,2 @@ +export * from './ErrorMessage'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/cdc/common/index.js.map b/dist/cdc/common/index.js.map new file mode 100644 index 000000000..41b652e15 --- /dev/null +++ b/dist/cdc/common/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdc/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCreator.js b/dist/cdc/creator/CDCFilterCreator.js index ef25b3c61..a64c5c6c9 100644 --- a/dist/cdc/creator/CDCFilterCreator.js +++ b/dist/cdc/creator/CDCFilterCreator.js @@ -77,7 +77,7 @@ export function CDCFilterCreator({ filterSelection, filter, setFilter, filterCom }); }; if (filter.type !== 'group') { - throw Error('First filter always has to be a group filter'); + throw Error('First filter always has to be a group filter!'); } return (React.createElement(DndProvider, { backend: HTML5Backend }, React.createElement("div", { className: "row" }, diff --git a/dist/cdc/creator/CDCFilterCreator.js.map b/dist/cdc/creator/CDCFilterCreator.js.map index 5ee98c91e..26e35621e 100644 --- a/dist/cdc/creator/CDCFilterCreator.js.map +++ b/dist/cdc/creator/CDCFilterCreator.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAWlC,MAAM,UAAU,gBAAgB,CAAC,EAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAyB;IACvI,MAAM,QAAQ,GAAG,CAAC,SAAkB,EAAE,EAAE;QACtC,S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ClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,GACrB,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/filter/CDCCheckboxFilter.js.map b/dist/cdc/filter/CDCCheckboxFilter.js.map index 970e35d9d..d823f561b 100644 --- a/dist/cdc/filter/CDCCheckboxFilter.js.map +++ b/dist/cdc/filter/CDCCheckboxFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCCheckboxFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCCheckboxFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAMlD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAC9C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,KAAK,EAAE,0BAA0B;IACjC,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAAU,EAAE,KAA8B;IAChF,OAAO;QACL,EAAE;QACF,IAAI,EAAE,mBAAmB;QACzB,KAAK;KACN,CAAC;AACJ,CAAC;AAGD,MAAM,UAAU,0BAA0B,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAC;IAClF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AAE;QAC9B,OAAO,CACL,6BAAK,GAAG,EAAE,CAAC,EAAE,SAAS,EAAC,iBAAiB;YACtC,6BAAK,SAAS,EAAC,YAAY;gBACzB,oBAAC,QAAQ,IACP,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACrB,SAAS,EAAC,kBAAkB,EAC5B,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAClD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAC7C;gBACF,+BACE,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,kBAAkB,IAEzB,KAAK,CACA,CACJ,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACD,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/filter/CDCRangeFilter.d.ts b/dist/cdc/filter/CDCRangeFilter.d.ts index 123692147..b8dba4b1c 100644 --- a/dist/cdc/filter/CDCRangeFilter.d.ts +++ b/dist/cdc/filter/CDCRangeFilter.d.ts @@ -1,19 +1,8 @@ import { IFilter, IFilterComponent } from '../interfaces'; export interface ICDCRangeFilterValue { - config: { - minValue: number; - maxValue: number; - label: string; - field: string; - }; - value: { - min: number; - max: number; - }; + min: number; + max: number; } export declare const CDCRangeFilterId = "range"; export declare const CDCRangeFilter: IFilterComponent; -export declare function createCDCRangeFilter(id: string, field: string, value: { - min: number; - max: number; -}): IFilter; +export declare function createCDCRangeFilter(id: string, field: string, value: ICDCRangeFilterValue): IFilter; diff --git a/dist/cdc/filter/CDCRangeFilter.js.map b/dist/cdc/filter/CDCRangeFilter.js.map index 7b24b6803..a7b383b92 100644 --- a/dist/cdc/filter/CDCRangeFilter.js.map +++ b/dist/cdc/filter/CDCRangeFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAe3C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAiC;IAC/F,OAAO;QACL,EAAE;QACF,IAAI,EAAE,gBAAgB;QACtB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAC;IAC/E,OAAO,6BAAK,SAAS,EAAC,8BAA8B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QACjH,6BAAK,SAAS,EAAC,YAAY;YACzB,gCAAK,KAAK,CAAM,CACZ;QACN,6BAAK,SAAS,EAAC,aAAa;YAC1B,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACpC,CACE,CACF,CAAC;AACT,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCRangeFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCRangeFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAO3C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,KAAK,EAAE,uBAAuB;IAC9B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAU,EAAE,KAAa,EAAE,KAA2B;IACzF,OAAO;QACL,EAAE;QACF,IAAI,EAAE,gBAAgB;QACtB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAC;IAC/E,OAAO,6BAAK,SAAS,EAAC,8BAA8B,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC;QACjH,6BAAK,SAAS,EAAC,YAAY;YACzB,gCAAK,KAAK,CAAM,CACZ;QACN,6BAAK,SAAS,EAAC,aAAa;YAC1B,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,cAAc,IAAI,QAAQ,EACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,GACpC,CACE,CACF,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/dist/cdc/filter/CDCTextFilter.d.ts b/dist/cdc/filter/CDCTextFilter.d.ts index ea25b8ca3..98104c4d5 100644 --- a/dist/cdc/filter/CDCTextFilter.d.ts +++ b/dist/cdc/filter/CDCTextFilter.d.ts @@ -1,10 +1,8 @@ /// import { IFilter, IFilterComponent } from '../interfaces'; -export interface ICDCTextFilterValue { -} export declare const CDCTextFilterId = "text"; export declare const CDCTextFilter: IFilterComponent; -export declare function createCDCTextFilter(id: string, field: string, value: string[]): IFilter; +export declare function createCDCTextFilter(id: string, field: string, value: string[]): IFilter; export declare function CDCTextFilterComponent({ value, onValueChanged, onFieldChanged, disabled, field, config }: { value: any; onValueChanged: any; diff --git a/dist/cdc/filter/CDCTextFilter.js b/dist/cdc/filter/CDCTextFilter.js index 32f7e0638..80ebfe8e8 100644 --- a/dist/cdc/filter/CDCTextFilter.js +++ b/dist/cdc/filter/CDCTextFilter.js @@ -20,7 +20,10 @@ export function CDCTextFilterComponent({ value, onValueChanged, onFieldChanged, return React.createElement(React.Fragment, null, React.createElement("div", { className: "input-group m-1 row" }, React.createElement("div", { className: "col-4 p-0" }, - React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: { label: field, value: field }, options: [...config === null || config === void 0 ? void 0 : config.map((conf) => { return { label: conf.field, value: conf.field }; })], onChange: (e) => onFieldChanged === null || onFieldChanged === void 0 ? void 0 : onFieldChanged(e.value) })), + React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: { label: field, value: field }, options: [...config === null || config === void 0 ? void 0 : config.map((conf) => { return { label: conf.field, value: conf.field }; })], onChange: (e) => { + onFieldChanged === null || onFieldChanged === void 0 ? void 0 : onFieldChanged(e.value); + onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged([]); + } })), React.createElement("div", { className: "col-8 p-0" }, React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !field, isMulti: true, value: value === null || value === void 0 ? void 0 : value.map((v) => { return { label: v, value: v }; }), options: (_a = config === null || config === void 0 ? void 0 : config.find((f) => (f === null || f === void 0 ? void 0 : f.field) === field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { return { label: o, value: o }; }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged([...e.map((v) => v.value)]) })))); } diff --git a/dist/cdc/filter/CDCTextFilter.js.map b/dist/cdc/filter/CDCTextFilter.js.map index 5b8bef7f3..82e0616b7 100644 --- a/dist/cdc/filter/CDCTextFilter.js.map +++ b/dist/cdc/filter/CDCTextFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAOlC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAe;IAC5E,OAAO;QACL,EAAE;QACF,IAAI,EAAE,eAAe;QACrB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;;IACrG,OAAO;QACL,6BAAK,SAAS,EAAC,qBAAqB;YAClC,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,EACvC,KAAK,EAAE,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,EACnC,OAAO,EAAE,CAAC,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAA,CAAC,CAAC,CAAC,EACr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OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA,CAAC,GACvD,OAAO,QAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,MAAK,KAAK,2CAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA,CAAC,GACnG,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC7D,CACE,CACF,CACL,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/index.d.ts b/dist/cdc/index.d.ts index cc99a9901..770afb82d 100644 --- a/dist/cdc/index.d.ts +++ b/dist/cdc/index.d.ts @@ -1,4 +1,5 @@ export * from './alert'; +export * from './common'; export * from './creator'; export * from './filter'; export * from './api'; diff --git a/dist/cdc/index.js b/dist/cdc/index.js index 5894b98d0..124b11c7f 100644 --- a/dist/cdc/index.js +++ b/dist/cdc/index.js @@ -1,4 +1,5 @@ export * from './alert'; +export * from './common'; export * from './creator'; export * from './filter'; export * from './api'; diff --git a/dist/cdc/index.js.map b/dist/cdc/index.js.map index 8651e4bbf..90c396bea 100644 --- a/dist/cdc/index.js.map +++ b/dist/cdc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cdc/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cdc/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interfaces.d.ts b/dist/cdc/interfaces.d.ts index 2eaf69e0c..ea0a466c0 100644 --- a/dist/cdc/interfaces.d.ts +++ b/dist/cdc/interfaces.d.ts @@ -1,4 +1,5 @@ /// +import { ISecureItem } from "phovea_core"; export interface IFilterComponent { clazz: (props: { value: V; @@ -25,7 +26,7 @@ export declare const getFilterFromTree: (filter: IFilter, id: string) => { parent: IFilter | null; current: IFilter | null; }; -export interface IAlert { +export interface IAlert extends ISecureItem { id: number; name: string; cdc_id: string; @@ -45,14 +46,16 @@ export interface IAlert { _cdc_compare_id: string; [key: string]: any; }[]; - latest_compare_date: Date; - modification_date: string; + latest_compare_date?: Date; + modification_date?: string; confirmed_data?: { _cdc_compare_id: string; [key: string]: any; }[]; confirmation_date: Date; compare_columns: string[]; + latest_error?: string; + latest_error_date?: Date; } export interface IUploadAlert extends Pick { compare?: string[]; diff --git a/dist/cdc/interfaces.js.map b/dist/cdc/interfaces.js.map index f3201827a..80bc78635 100644 --- a/dist/cdc/interfaces.js.map +++ b/dist/cdc/interfaces.js.map @@ -1 +1 @@ -{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/cdc/interfaces.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,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AM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE;YACX,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;SAClC;QACD,wCAAwC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;SACF;KACF;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AACvC,CAAC,CAAC;AA6BF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 2046cfd85..98c571e1b 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -66,8 +66,6 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp }).catch((e) => console.error(e)); }; - console.log(filter); - return <> setShowDialog(true)}> Alert Filter @@ -138,8 +136,9 @@ export class CDCFilterDialogClass { this.node = document.createElement('div'); parent.appendChild(this.node); this.init(); - } + } +//{id: .., filters: filter[], compareColumns: [], config: [id]: config} --> überschreibt die config einer bestimmten private init() { ReactDOM.render( { - const alert = await confirmAlertById(id); - onAlertChanged(alert.id); - }; - const onCreateSave = async () => { if (validFilter && validName) { const newAlert = await saveAlert({...alertData, filter}) @@ -75,85 +70,6 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, onAlertChanged(); }; - // TODO: Extract to component instead of inline function - const literature = () => { - if (selectedAlert.latest_diff || selectedAlert.confirmed_data) { - const change: Map> = new Map(); - selectedAlert.latest_diff?.values_changed?.map((d) => { - const nestedField = d.field.map((f) => f).join('.'); - if (change.has(d.id)) { - change.set(d.id, change.get(d.id).set(nestedField, {old: d.old_value, new: d.new_value})); - } else { - change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); - } - }); - return (<> - - - - - {selectedAlert.compare_columns.map((field, i) => )} - - - - - {selectedAlert.latest_diff ? <> - {selectedAlert.latest_diff?.dictionary_item_added?.map((d) => { - const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); - return ( - - {selectedAlert.compare_columns.map((field, i) => )} - - ); - })} - {selectedAlert.latest_diff?.dictionary_item_removed?.map((d) => { - const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); - return ( - - {selectedAlert.compare_columns.map((field, i) => )} - - ); - })} - : null} - {selectedAlert.confirmed_data ? <> - {selectedAlert.confirmed_data - // Only show entries which are not already shown above - .filter((item) => !selectedAlert.latest_diff?.dictionary_item_added?.includes(item._cdc_compare_id) && !selectedAlert.latest_diff?.dictionary_item_removed?.includes(item._cdc_compare_id)) - // Sort such that rows with changes are on top - .sort((a, b) => (change.has(b._cdc_compare_id) ? 1 : 0) - (change.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { - const id = d._cdc_compare_id; - const hasChanged = change.has(id); - // TODO: All these .find() and .includes() should be refactored as they are O(n). - const isAlreadyHandled = selectedAlert.latest_diff?.dictionary_item_added?.includes(id) || selectedAlert.latest_diff?.dictionary_item_removed?.includes(id); - return (isAlreadyHandled ? null : - - - {selectedAlert.compare_columns.map((field) => ( - - {hasChanged ? ( - change.get(id).has(field) ? () : () - ) : ( - - )} - - ))} - - - ); - })} - : null} - -
    ID{field}Status
    {data._cdc_compare_id}{get(data, field)}Added
    {data._cdc_compare_id}{get(data, field)}Removed
    {d._cdc_compare_id}{change.get(id).get(field).old} {change.get(id).get(field).new}{get(d, field)}{get(d, field)}{hasChanged ? <>Changed : null}
    - {selectedAlert.latest_diff ?
    -
    - -
    -
    : null} - ); - } - return

    No new data available

    ; - }; - const editButton = !editMode && !deleteMode && !creationMode ? (<> @@ -179,7 +95,7 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter,
    - {literature()} +
    : null} @@ -242,171 +158,3 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter,
    ); } - - -/* -const generalInformation = - <> -
    -
    - - {!editMode ? -
    {alertData.name}
    - : - <> setAlertData({...alertData, name: e.target.value})} /> - {validName ? null : -
    - Name must not be empty! -
    } - } -
    -
    - - setAlertData({...alertData, compare_columns: [...e]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    - ; - - -const alertInformation = -<> -
    -
    - -
    {alertData.name}
    -
    -
    - - -
    -
    - -
    - - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    } -
    -; - -const onCreateSave = async () => { - if (validFilter && validName) { - const newAlert = await saveAlert({...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } -}; - - const onEditSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } -}; - -const alterAlert = -<> -
    -
    -
    - - setAlertData({...alertData, name: e.target.value})} required /> - {validName ? null : -
    - Name must not be empty! -
    } -
    -
    - - setAlertData({...alertData, compare_columns: [...e]})} - /> -
    -
    - -
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    - } -
    -
    -; - -*/ diff --git a/src/cdc/alert/CDCCreateAlert.tsx b/src/cdc/alert/CDCCreateAlert.tsx deleted file mode 100644 index 5527d7915..000000000 --- a/src/cdc/alert/CDCCreateAlert.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import React from 'react'; -import Select from 'react-select'; -import {runAlert} from '..'; -import {saveAlert} from '../api'; -import {CDCFilterCreator} from '../creator'; -import {IFilter, IFilterComponent, IUploadAlert, IReactSelectOption} from '../interfaces'; - -interface ICDCCreateAlert { - alertData: IUploadAlert; - setAlertData: (formData: IUploadAlert) => void; - filterSelection: IFilter[] | undefined; - filter: IFilter; - setFilter: (filter: IFilter) => void; - filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; - onAlertChanged: (id?: number) => void; - setCreationMode: (mode: boolean) => void; - cdcs: string[]; - compareColumnOptions: string[]; -} - -export function CDCCreateAlert({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, setCreationMode, cdcs, compareColumnOptions}: ICDCCreateAlert) { - const validFilter = filter?.children.length > 0; - const validName = alertData?.name?.trim().length > 0; - - const onSave = async () => { - if (validFilter && validName) { - const newAlert = await saveAlert({...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } - }; - - return (<> -
    -
    Create alert
    - - - - -
    -
    -
    -
    - - setAlertData({...alertData, name: e.target.value})} required /> - {validName ? null : -
    - Name must not be empty! -
    } -
    -
    - - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - -
    -
    -
    -
    - {filterSelection || !filter ? - - : -

    No filters available for this cdc

    - } -
    -
    - ); -} - diff --git a/src/cdc/alert/CDCDataChangeTable.tsx b/src/cdc/alert/CDCDataChangeTable.tsx new file mode 100644 index 000000000..8c7e86024 --- /dev/null +++ b/src/cdc/alert/CDCDataChangeTable.tsx @@ -0,0 +1,106 @@ +import {get} from "lodash"; +import React, {useEffect} from "react"; +import {useAsync} from "../../hooks"; +import {confirmAlertById} from "../api"; +import {ErrorMessage} from "../common/ErrorMessage"; +import {IAlert} from "../interfaces"; + +interface ICDCDataChangeTable { + selectedAlert: IAlert; + onAlertChanged: (id?: number) => void; +} + +export function CDCDataChangeTable({selectedAlert, onAlertChanged}: ICDCDataChangeTable) { + const [dataChange, setDataChange] = React.useState>>(new Map()); + + useEffect(() => { + if (selectedAlert?.latest_diff?.values_changed) { + const change: Map> = new Map(); + selectedAlert.latest_diff?.values_changed?.map((d) => { + const nestedField = d.field.map((f) => f).join('.'); + if (change.has(d.id)) { + change.set(d.id, change.get(d.id).set(nestedField, {old: d.old_value, new: d.new_value})); + } else { + change.set(d.id, new Map().set(nestedField, {old: d.old_value, new: d.new_value})); + } + }); + setDataChange(change); + } else { + setDataChange(new Map()); + } + }, [selectedAlert]); + + const {status: confirmStatus, error: confirmError, execute: doConfirm} = useAsync(async () => { + const alert = await confirmAlertById(selectedAlert.id); + onAlertChanged(alert.id); + }, false); + + //loading icon when loading + + return (<> + {selectedAlert.latest_diff || selectedAlert.confirmed_data ? (<> + + + + + {selectedAlert.compare_columns.map((field, i) => )} + + + + + {selectedAlert.latest_diff ? <> + {selectedAlert.latest_diff?.dictionary_item_added?.map((d) => { + const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); + return ( + + {selectedAlert.compare_columns.map((field, i) => )} + + ); + })} + {selectedAlert.latest_diff?.dictionary_item_removed?.map((d) => { + const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); + return ( + + {selectedAlert.compare_columns.map((field, i) => )} + + ); + })} + : null} + {selectedAlert.confirmed_data ? <> + {selectedAlert.confirmed_data + // Only show entries which are not already shown above + .filter((item) => !selectedAlert.latest_diff?.dictionary_item_added?.includes(item._cdc_compare_id) && !selectedAlert.latest_diff?.dictionary_item_removed?.includes(item._cdc_compare_id)) + // Sort such that rows with changes are on top + .sort((a, b) => (dataChange.has(b._cdc_compare_id) ? 1 : 0) - (dataChange.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { + const id = d._cdc_compare_id; + const hasChanged = dataChange.has(id); + // TODO: All these .find() and .includes() should be refactored as they are O(n). + const isAlreadyHandled = selectedAlert.latest_diff?.dictionary_item_added?.includes(id) || selectedAlert.latest_diff?.dictionary_item_removed?.includes(id); + return (isAlreadyHandled ? null : + + + {selectedAlert.compare_columns.map((field) => ( + + {hasChanged ? ( + dataChange.get(id).has(field) ? () : () + ) : ( + + )} + + ))} + + + ); + })} + : null} + +
    ID{field}Status
    {data._cdc_compare_id}{get(data, field)}Added
    {data._cdc_compare_id}{get(data, field)}Removed
    {d._cdc_compare_id}{dataChange.get(id).get(field).old} {dataChange.get(id).get(field).new}{get(d, field)}{get(d, field)}{hasChanged ? <>Changed : null}
    + {selectedAlert.latest_diff ?
    + doConfirm()} /> +
    + +
    +
    : null} + ) :

    No new data available

    } + ); +} diff --git a/src/cdc/alert/index.ts b/src/cdc/alert/index.ts index bd6218074..13dae734d 100644 --- a/src/cdc/alert/index.ts +++ b/src/cdc/alert/index.ts @@ -1,2 +1 @@ export * from './CDCAlertView'; -export * from './CDCCreateAlert'; diff --git a/src/cdc/common/ErrorMessage.tsx b/src/cdc/common/ErrorMessage.tsx new file mode 100644 index 000000000..f4c8b4f35 --- /dev/null +++ b/src/cdc/common/ErrorMessage.tsx @@ -0,0 +1,15 @@ +import * as React from 'react'; + +export function ErrorMessage({error, onRetry}: {error: Error | null; onRetry?: () => void}) { + return error ? ( +
    + +
    {error.toString()}
    + {onRetry ? ( + + ) : null} +
    + ) : null; +} diff --git a/src/cdc/common/index.ts b/src/cdc/common/index.ts new file mode 100644 index 000000000..d4f9176e1 --- /dev/null +++ b/src/cdc/common/index.ts @@ -0,0 +1 @@ +export * from './ErrorMessage'; \ No newline at end of file diff --git a/src/cdc/creator/CDCFilterCreator.tsx b/src/cdc/creator/CDCFilterCreator.tsx index 123f4bbb0..c2501a8a9 100644 --- a/src/cdc/creator/CDCFilterCreator.tsx +++ b/src/cdc/creator/CDCFilterCreator.tsx @@ -98,7 +98,7 @@ export function CDCFilterCreator({filterSelection, filter, setFilter, filterComp }; if(filter.type !== 'group') { - throw Error('First filter always has to be a group filter'); + throw Error('First filter always has to be a group filter!'); } return ( diff --git a/src/cdc/filter/CDCCheckboxFilter.tsx b/src/cdc/filter/CDCCheckboxFilter.tsx index f5173ab39..192436e45 100644 --- a/src/cdc/filter/CDCCheckboxFilter.tsx +++ b/src/cdc/filter/CDCCheckboxFilter.tsx @@ -22,7 +22,6 @@ export function createCDCCheckboxFilter(id: string, value: ICDCCheckboxFilterVal }; } - export function CDCCheckboxFilterComponent({value, onValueChanged, disabled, config}) { const onChange = (value, field, e) => { if (value[field] === false) { diff --git a/src/cdc/filter/CDCRangeFilter.tsx b/src/cdc/filter/CDCRangeFilter.tsx index 9e9c1b7f6..66518c3d6 100644 --- a/src/cdc/filter/CDCRangeFilter.tsx +++ b/src/cdc/filter/CDCRangeFilter.tsx @@ -3,16 +3,8 @@ import * as React from 'react'; import InputRange from 'react-input-range'; export interface ICDCRangeFilterValue { - config: { - minValue: number; - maxValue: number; - label: string; - field: string; - }; - value: { - min: number; - max: number; - }; + min: number; + max: number; } /* tslint:disable-next-line:variable-name */ @@ -23,7 +15,7 @@ export const CDCRangeFilter: IFilterComponent = { disableDropping: true }; -export function createCDCRangeFilter(id: string, field: string, value: {min: number, max: number}): IFilter { +export function createCDCRangeFilter(id: string, field: string, value: ICDCRangeFilterValue): IFilter { return { id, type: CDCRangeFilterId, diff --git a/src/cdc/filter/CDCTextFilter.tsx b/src/cdc/filter/CDCTextFilter.tsx index b706e434a..c0dad3a3b 100644 --- a/src/cdc/filter/CDCTextFilter.tsx +++ b/src/cdc/filter/CDCTextFilter.tsx @@ -2,11 +2,6 @@ import {IFilter, IFilterComponent} from '../interfaces'; import * as React from 'react'; import Select from 'react-select'; -/* tslint:disable-next-line:no-empty-interface */ -export interface ICDCTextFilterValue { - // TODO: empty? -} - /* tslint:disable-next-line:variable-name */ export const CDCTextFilterId = 'text'; /* tslint:disable-next-line:variable-name */ @@ -15,7 +10,7 @@ export const CDCTextFilter: IFilterComponent = { disableDropping: true }; -export function createCDCTextFilter(id: string, field: string, value: string[]): IFilter { +export function createCDCTextFilter(id: string, field: string, value: string[]): IFilter { return { id, type: CDCTextFilterId, @@ -32,7 +27,10 @@ export function CDCTextFilterComponent({value, onValueChanged, onFieldChanged, d isDisabled={!onValueChanged || disabled} value={{label: field, value: field}} options={[...config?.map((conf) => {return {label: conf.field, value: conf.field};})]} - onChange={(e) => onFieldChanged?.(e.value)} + onChange={(e) => { + onFieldChanged?.(e.value); + onValueChanged?.([]); + }} />
    diff --git a/src/cdc/index.ts b/src/cdc/index.ts index cc99a9901..33b71bd58 100644 --- a/src/cdc/index.ts +++ b/src/cdc/index.ts @@ -1,6 +1,7 @@ export * from './alert'; +export * from './common'; export * from './creator'; export * from './filter'; export * from './api'; export * from './CDCFilterDialog'; -export * from './interfaces'; +export * from './interfaces'; \ No newline at end of file diff --git a/src/cdc/interfaces.ts b/src/cdc/interfaces.ts index 94196e45c..2d70c0a3f 100644 --- a/src/cdc/interfaces.ts +++ b/src/cdc/interfaces.ts @@ -1,3 +1,5 @@ +import {ISecureItem} from "phovea_core"; + export interface IFilterComponent { clazz: (props: { value: V; @@ -46,7 +48,7 @@ export const getFilterFromTree = ( return {parent: null, current: null}; }; -export interface IAlert { +export interface IAlert extends ISecureItem{ id: number; name: string; cdc_id: string; @@ -57,15 +59,17 @@ export interface IAlert { _cdc_compare_id: string; [key: string]: any; }[]; - latest_compare_date: Date; - modification_date: string; + latest_compare_date?: Date; + modification_date?: string; confirmed_data?: { _cdc_compare_id: string; [key: string]: any; }[]; confirmation_date: Date; compare_columns: string[]; -} //TODO: remove any + latest_error?: string; + latest_error_date?: Date; +} export interface IUploadAlert extends Pick { compare?: string[]; diff --git a/tdp_core/cdc/CDCAlert.py b/tdp_core/cdc/CDCAlert.py index 0dd8d2434..d1db5ed29 100644 --- a/tdp_core/cdc/CDCAlert.py +++ b/tdp_core/cdc/CDCAlert.py @@ -30,6 +30,9 @@ class CDCAlert(Base): latest_fetched_data = Column(JSON, nullable=True) compare_columns = Column(JSON, nullable=True) + latest_error_date = Column(DateTime, nullable=True) + latest_error = Column(JSON, nullable=True) + confirmation_date = Column(DateTime, nullable=True) # date of confirmation confirmed_data = Column(JSON, nullable=True) # your confirmed data # security diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 55a09c7a0..3b8072c4d 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -130,17 +130,27 @@ def run_alert_by_id(id: int): if not can_read(alert): abort(401) - new_data, diff = cdc_manager.run_alert(alert) - - if diff: - # We have a new diff! Send email? Store in db? ... - alert.latest_compare_date = datetime.utcnow() - alert.latest_fetched_data = new_data - alert.latest_diff = diff - # TODO else: also set latest diff to empty - - session.commit() - return alert, 200 + try: + new_data, diff = cdc_manager.run_alert(alert) + + if diff: + # We have a new diff! Send email? Store in db? ... + alert.latest_compare_date = datetime.utcnow() + alert.latest_fetched_data = new_data + alert.latest_diff = diff + # TODO else: also set latest diff to empty + + alert.latest_error = None + alert.latest_error_date = None + + session.commit() + return alert, 200 + + except Exception as e: + alert.latest_error = str(e) + alert.latest_error_date = datetime.utcnow() + session.commit() + abort(400) @no_cache From bded9a512e1ed581547cdc0b910ad7a119b3f90c Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Mon, 15 Nov 2021 10:48:32 +0100 Subject: [PATCH 30/40] combine all single cdc filter dependecies in one dict entered by cdcid + minor fixes --- dist/cdc/CDCFilterDialog.d.ts | 15 ++---- dist/cdc/CDCFilterDialog.js | 55 +++++++++++--------- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/alert/CDCAlertView.d.ts | 16 ++---- dist/cdc/alert/CDCAlertView.js | 46 ++++++++++++----- dist/cdc/alert/CDCAlertView.js.map | 2 +- dist/cdc/creator/CDCFilterCreator.d.ts | 10 ++-- dist/cdc/creator/CDCFilterCreator.js | 2 +- dist/cdc/creator/CDCFilterCreator.js.map | 2 +- dist/cdc/filter/CDCTextFilter.js | 4 +- dist/cdc/filter/CDCTextFilter.js.map | 2 +- dist/cdc/interfaces.d.ts | 10 ++++ dist/cdc/interfaces.js.map | 2 +- src/cdc/CDCFilterDialog.tsx | 65 +++++++++++------------- src/cdc/alert/CDCAlertView.tsx | 62 ++++++++++++++-------- src/cdc/creator/CDCFilterCreator.tsx | 7 +-- src/cdc/filter/CDCTextFilter.tsx | 6 ++- src/cdc/interfaces.ts | 6 +++ 18 files changed, 181 insertions(+), 133 deletions(-) diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index f4540d9e8..2ebed44cb 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -1,16 +1,9 @@ /// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from './interfaces'; +import { IAlert, IFilter, IUploadAlert, ICDCConfiguration } from './interfaces'; interface ICDCFilterDialogProps { - filterComponents: { - [key: string]: { - component: IFilterComponent; - config?: any; - }; + cdcConfig: { + [cdcId: string]: ICDCConfiguration; }; - filtersByCDC: { - [cdcId: string]: IFilter[]; - }; - compareColumnOptions: string[]; } export declare const CDC_DEFAULT_ALERT_DATA: IUploadAlert; export declare const CDC_DEFAULT_FILTER: { @@ -22,7 +15,7 @@ export declare const CDC_DEFAULT_FILTER: { children?: IFilter[]; }; export declare const runAlert: (id: number) => Promise; -export declare function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnOptions }: ICDCFilterDialogProps): JSX.Element; +export declare function CDCFilterDialog({ cdcConfig }: ICDCFilterDialogProps): JSX.Element; export declare class CDCFilterDialogClass { private node; constructor(parent: HTMLElement); diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index a4e48fdc3..b602162c4 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -14,15 +14,13 @@ export const runAlert = async (id) => { return null; }); }; -export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnOptions }) { +export function CDCFilterDialog({ cdcConfig }) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); const { status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts } = useAsync(getAlerts, true); - // TODO: CDCs are more complex than just filters, i.e. they also have fields. - const cdcs = Object.keys(filtersByCDC); React.useEffect(() => { setAlertData(CDC_DEFAULT_ALERT_DATA); setFilter(CDC_DEFAULT_FILTER); @@ -90,7 +88,7 @@ export function CDCFilterDialog({ filterComponents, filtersByCDC, compareColumnO React.createElement("small", null, !(alert === null || alert === void 0 ? void 0 : alert.latest_diff) && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${(_a = new Date(alert.confirmation_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()}`))); })) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert || creationMode ? - React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, filterComponents: filterComponents, filterSelection: filtersByCDC[alertData.cdc_id], onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, cdcs: cdcs, compareColumnOptions: compareColumnOptions, creationMode: creationMode }) + React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, creationMode: creationMode, cdcConfig: cdcConfig }) : null))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), @@ -104,28 +102,35 @@ export class CDCFilterDialogClass { parent.appendChild(this.node); this.init(); } - //{id: .., filters: filter[], compareColumns: [], config: [id]: config} --> überschreibt die config einer bestimmten init() { - ReactDOM.render(React.createElement(CDCFilterDialog, { filterComponents: { - [CDCGroupingFilterId]: { component: CDCGroupingFilter }, - [CDCTextFilterId]: { component: CDCTextFilter, config: [{ field: 'address.city', options: ['Gwenborough', 'Wisokyburgh', 'McKenziehaven', 'Roscoeview', 'Aliyaview', 'Howemouth'] }, { field: 'address.zipcode', options: ['33263', '23505-1337', '58804-1099'] }, { field: 'name', options: ['Leanne Graham', 'Ervin Howell', 'Glenna Reichert', 'Clementina DuBuque'] }] }, - [CDCCheckboxFilterId]: { component: CDCCheckboxFilter, config: { fields: ['Eins', 'Zwei', 'Drei'] } }, - [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 10 } } - }, filtersByCDC: { - 'JSONPlaceholderUserCDC': [ - // [CDCTextFilterId]: {filter (defaultwert): createCDCGroupingFilter(uuidv4()), component: CDCTextFilter, config: [{field: 'address.city', options: ['Gwenborough', 'Wisokyburgh', 'McKenziehaven', 'Roscoeview', 'Aliyaview', 'Howemouth']}, {field: 'address.zipcode', options: ['33263', '23505-1337', '58804-1099']}, {field: 'name', options: ['Leanne Graham', 'Ervin Howell', 'Glenna Reichert', 'Clementina DuBuque']}]}, - createCDCGroupingFilter(uuidv4()), - createCDCTextFilter(uuidv4(), 'Select...', null), - createCDCCheckboxFilter(uuidv4(), {}), - createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 10 }), - ], - 'JSONPlaceholderPostsCDC': [ - createCDCGroupingFilter(uuidv4()), - createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 100 }), - ] - }, - // TODO: This needs to be defined per CDC. Maybe we define this in the backend and fetch it via an API? - compareColumnOptions: ['id', 'name', 'address.street', 'adress.city', 'address.zipcode', 'title', 'body'] }), this.node); + ReactDOM.render(React.createElement(CDCFilterDialog, { cdcConfig: { + 'JSONPlaceholderUserCDC': { + filters: [ + createCDCGroupingFilter(uuidv4()), + createCDCTextFilter(uuidv4(), 'Select...', null), + createCDCCheckboxFilter(uuidv4(), {}), + createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 10 }) + ], + components: { + [CDCGroupingFilterId]: { component: CDCGroupingFilter }, + [CDCTextFilterId]: { component: CDCTextFilter, config: [{ field: 'address.city', options: ['Gwenborough', 'Wisokyburgh', 'McKenziehaven', 'Roscoeview', 'Aliyaview', 'Howemouth'] }, { field: 'address.zipcode', options: ['33263', '23505-1337', '58804-1099'] }, { field: 'name', options: ['Leanne Graham', 'Ervin Howell', 'Glenna Reichert', 'Clementina DuBuque'] }] }, + [CDCCheckboxFilterId]: { component: CDCCheckboxFilter, config: { fields: ['Eins', 'Zwei', 'Drei'] } }, + [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 10 } } + }, + compareColumns: ['id', 'name', 'address.street', 'adress.city', 'address.zipcode'] + }, + 'JSONPlaceholderPostsCDC': { + filters: [ + createCDCGroupingFilter(uuidv4()), + createCDCRangeFilter(uuidv4(), 'id', { min: 1, max: 100 }) + ], + components: { + [CDCGroupingFilterId]: { component: CDCGroupingFilter }, + [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 100 } } + }, + compareColumns: ['title', 'body'] + } + } }), this.node); } } //# sourceMappingURL=CDCFilterDialog.js.map \ No newline at end of file diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index e36200798..a504b5bf2 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MA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AAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAC,CAAC;qBACzD;oBACD,UAAU,EAAE;wBACV,CAAC,mBAAmB,CAAC,EAAE,EAAC,SAAS,EAAE,iBAAiB,EAAC;wBACrD,CAAC,gBAAgB,CAAC,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAC,EAAC;qBACtF;oBACD,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;iBAClC;aACF,GACD,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCAlertView.d.ts b/dist/cdc/alert/CDCAlertView.d.ts index b09cad27c..437c59951 100644 --- a/dist/cdc/alert/CDCAlertView.d.ts +++ b/dist/cdc/alert/CDCAlertView.d.ts @@ -1,23 +1,17 @@ /// -import { IAlert, IFilter, IFilterComponent, IUploadAlert } from '../interfaces'; +import { IAlert, IFilter, IUploadAlert, ICDCConfiguration } from '../interfaces'; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; - filterSelection?: IFilter[]; filter: IFilter; setFilter: (filter: IFilter) => void; - filterComponents: { - [key: string]: { - component: IFilterComponent; - config?: any; - }; - }; onAlertChanged: (id?: number) => void; selectedAlert?: IAlert; - cdcs: string[]; - compareColumnOptions: string[]; creationMode: boolean; setCreationMode: (mode: boolean) => void; + cdcConfig: { + [cdcId: string]: ICDCConfiguration; + }; } -export declare function CDCAlertView({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode }: ICDCEditAlert): JSX.Element; +export declare function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }: ICDCEditAlert): JSX.Element; export {}; diff --git a/dist/cdc/alert/CDCAlertView.js b/dist/cdc/alert/CDCAlertView.js index a412b3461..545954fdd 100644 --- a/dist/cdc/alert/CDCAlertView.js +++ b/dist/cdc/alert/CDCAlertView.js @@ -1,21 +1,35 @@ import React from 'react'; import Select from 'react-select'; -import { runAlert } from '..'; +import { CDC_DEFAULT_FILTER, runAlert } from '..'; import { deleteAlert, editAlert, saveAlert } from '../api'; import { CDCFilterCreator } from '../creator'; import { CDCDataChangeTable } from './CDCDataChangeTable'; -export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode }) { - var _a, _b, _c; +export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }) { + var _a, _b; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); - const validFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; - const validName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; + const [filterSelection, setFilterSelection] = React.useState(); + const [compareColumns, setCompareColumns] = React.useState(); + const [filterComponents, setFilterComponents] = React.useState(); + const [validFilter, setValidFilter] = React.useState(); + const [validName, setValidName] = React.useState(); + // TODO: CDCs are more complex than just filters, i.e. they also have fields. + const cdcs = Object.keys(cdcConfig); + React.useEffect(() => { + var _a, _b, _c; + setFilterSelection((_a = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _a === void 0 ? void 0 : _a.filters); + setCompareColumns((_b = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _b === void 0 ? void 0 : _b.compareColumns); + setFilterComponents((_c = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _c === void 0 ? void 0 : _c.components); + }, [alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]); React.useEffect(() => { setEditMode(false); setDeleteMode(false); }, [selectedAlert]); const onCreateSave = async () => { - if (validFilter && validName) { + var _a; + const valFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; + const valName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; + if (valFilter && valName) { const newAlert = await saveAlert({ ...alertData, filter }) .then((alert) => { return runAlert(alert.id).then((a) => { @@ -25,6 +39,8 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, onAlertChanged(newAlert.id); setCreationMode(false); } + setValidFilter(valFilter); + setValidName(valName); }; const onEditSave = async () => { if (validFilter && validName) { @@ -48,6 +64,10 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, await deleteAlert(id); onAlertChanged(); }; + const onCDCChanged = (e) => { + setAlertData({ ...alertData, cdc_id: e.value }); + setFilter(CDC_DEFAULT_FILTER); + }; const editButton = !editMode && !deleteMode && !creationMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, React.createElement("i", { className: "fas fa-pencil-alt" })), @@ -69,7 +89,7 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, !editMode && !creationMode ? React.createElement("div", { key: "one", className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: "heading-one" }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_b = new Date(selectedAlert.latest_compare_date)) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()) : 'No new data'}`)), + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_a = new Date(selectedAlert.latest_compare_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()) : 'No new data'}`)), React.createElement("div", { id: "collapse-one", className: "accordion-collapse collapse show", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, React.createElement(CDCDataChangeTable, { selectedAlert: selectedAlert, onAlertChanged: onAlertChanged }))) : null, @@ -84,22 +104,22 @@ export function CDCAlertView({ alertData, setAlertData, filterSelection, filter, React.createElement("h6", null, alertData.name) : React.createElement(React.Fragment, null, - React.createElement("input", { type: "text", className: `form-control${validName ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }), required: true }), - validName ? null : + React.createElement("input", { type: "text", className: `form-control${validName !== false ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }), required: true }), + validName !== false ? null : React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!"))), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "CDC"), - React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => ({ label: c, value: c })), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value }) })), + React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => ({ label: c, value: c })), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => onCDCChanged(e) })), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "Change Fields"), - React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumnOptions.map((c) => ({ label: c, value: c })), value: (_c = alertData.compare_columns) === null || _c === void 0 ? void 0 : _c.map((c) => ({ label: c, value: c })), onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) })), + React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumns === null || compareColumns === void 0 ? void 0 : compareColumns.map((c) => ({ label: c, value: c })), value: (_b = alertData.compare_columns) === null || _b === void 0 ? void 0 : _b.map((c) => ({ label: c, value: c })), onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, - React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: true, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), + React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: !creationMode && !editMode, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), React.createElement("div", null, filterSelection || !filter ? - React.createElement(CDCFilterCreator, { filterSelection: !creationMode && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: !validFilter }) + React.createElement(CDCFilterCreator, { filterSelection: !creationMode && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: validFilter === false }) : React.createElement("p", null, "No filters available for this cdc"))))))); } diff --git a/dist/cdc/alert/CDCAlertView.js.map b/dist/cdc/alert/CDCAlertView.js.map index 300ebbac4..3c6c91aa9 100644 --- a/dist/cdc/alert/CDCAlertView.js.map +++ b/dist/cdc/alert/CDCAlertView.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCAlertView.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCAlertView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB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F;oBACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC3B,oBAAC,gBAAgB,IAAC,eAAe,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,KAAK,KAAK,GAAI;wBACtM,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCreator.d.ts b/dist/cdc/creator/CDCFilterCreator.d.ts index 7553d2e16..fad02cb29 100644 --- a/dist/cdc/creator/CDCFilterCreator.d.ts +++ b/dist/cdc/creator/CDCFilterCreator.d.ts @@ -1,17 +1,17 @@ import React from 'react'; import { IFilter, IFilterComponent } from '../interfaces'; interface ICDCFilterCreatorProps { - filterSelection?: IFilter[]; - filter: IFilter; - setFilter: React.Dispatch>; - filterComponents: { + filterComponents?: { [key: string]: { component: IFilterComponent; config?: any; }; }; + filterSelection?: IFilter[]; + filter: IFilter; + setFilter: React.Dispatch>; disableFilter?: boolean; isInvalid?: boolean; } -export declare function CDCFilterCreator({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }: ICDCFilterCreatorProps): JSX.Element; +export declare function CDCFilterCreator({ filterSelection, filter, setFilter, disableFilter, isInvalid, filterComponents }: ICDCFilterCreatorProps): JSX.Element; export {}; diff --git a/dist/cdc/creator/CDCFilterCreator.js b/dist/cdc/creator/CDCFilterCreator.js index a64c5c6c9..624d8f64f 100644 --- a/dist/cdc/creator/CDCFilterCreator.js +++ b/dist/cdc/creator/CDCFilterCreator.js @@ -5,7 +5,7 @@ import { HTML5Backend } from 'react-dnd-html5-backend'; import { FilterCard } from './CDCFilterCard'; import { getFilterFromTree } from '../interfaces'; import { v4 as uuidv4 } from 'uuid'; -export function CDCFilterCreator({ filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid }) { +export function CDCFilterCreator({ filterSelection, filter, setFilter, disableFilter, isInvalid, filterComponents }) { const onDelete = (newFilter) => { setFilter((filter) => produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); diff --git a/dist/cdc/creator/CDCFilterCreator.js.map b/dist/cdc/creator/CDCFilterCreator.js.map index 26e35621e..c5ec52e3f 100644 --- a/dist/cdc/creator/CDCFilterCreator.js.map +++ b/dist/cdc/creator/CDCFilterCreator.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAWlC,MAAM,UAAU,gBAAgB,CAAC,EAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAyB;IACvI,MAAM,QAAQ,GAAG,CAAC,SAAkB,EAAE,EAAE;QACtC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;YACnD,MAAM,EAAC,OAAO,EAAE,MAAM,EAAC,GAAG,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;YACtE,IAAI,OAAO,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;gBACxC,gEA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IAEF,IAAG,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,MAAM,KAAK,CAAC,+CAA+C,CAAC,CAAC;KAC9D;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAClB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,+CAAqB;gBACrB,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,GACrB,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,i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GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/filter/CDCTextFilter.js b/dist/cdc/filter/CDCTextFilter.js index 80ebfe8e8..919b72244 100644 --- a/dist/cdc/filter/CDCTextFilter.js +++ b/dist/cdc/filter/CDCTextFilter.js @@ -20,11 +20,11 @@ export function CDCTextFilterComponent({ value, onValueChanged, onFieldChanged, return React.createElement(React.Fragment, null, React.createElement("div", { className: "input-group m-1 row" }, React.createElement("div", { className: "col-4 p-0" }, - React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: { label: field, value: field }, options: [...config === null || config === void 0 ? void 0 : config.map((conf) => { return { label: conf.field, value: conf.field }; })], onChange: (e) => { + React.createElement(Select, { isDisabled: !onValueChanged || disabled, value: { label: field, value: field }, maxMenuHeight: 200, menuPlacement: "auto", options: [...config === null || config === void 0 ? void 0 : config.map((conf) => { return { label: conf.field, value: conf.field }; })], onChange: (e) => { onFieldChanged === null || onFieldChanged === void 0 ? void 0 : onFieldChanged(e.value); onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged([]); } })), React.createElement("div", { className: "col-8 p-0" }, - React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !field, isMulti: true, value: value === null || value === void 0 ? void 0 : value.map((v) => { return { label: v, value: v }; }), options: (_a = config === null || config === void 0 ? void 0 : config.find((f) => (f === null || f === void 0 ? void 0 : f.field) === field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { return { label: o, value: o }; }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged([...e.map((v) => v.value)]) })))); + React.createElement(Select, { closeMenuOnSelect: false, isDisabled: !onValueChanged || disabled || !field, maxMenuHeight: 200, menuPlacement: "auto", isMulti: true, value: value === null || value === void 0 ? void 0 : value.map((v) => { return { label: v, value: v }; }), options: (_a = config === null || config === void 0 ? void 0 : config.find((f) => (f === null || f === void 0 ? void 0 : f.field) === field)) === null || _a === void 0 ? void 0 : _a.options.map((o) => { return { label: o, value: o }; }), onChange: (e) => onValueChanged === null || onValueChanged === void 0 ? void 0 : onValueChanged([...e.map((v) => v.value)]) })))); } //# sourceMappingURL=CDCTextFilter.js.map \ No newline at end of file diff --git a/dist/cdc/filter/CDCTextFilter.js.map b/dist/cdc/filter/CDCTextFilter.js.map index 82e0616b7..a720cecb0 100644 --- a/dist/cdc/filter/CDCTextFilter.js.map +++ b/dist/cdc/filter/CDCTextFilter.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAe;IAC5E,OAAO;QACL,EAAE;QACF,IAAI,EAAE,eAAe;QACrB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;;IACrG,OAAO;QACL,6BAAK,SAAS,EAAC,qBAAqB;YAClC,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,EACvC,KAAK,EAAE,EAAC,KA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AC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC7D,CACE,CACF,CACL,CAAC;AACN,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCTextFilter.js","sourceRoot":"","sources":["../../../src/cdc/filter/CDCTextFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,sBAAsB;IAC7B,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAU,EAAE,KAAa,EAAE,KAAe;IAC5E,OAAO;QACL,EAAE;QACF,IAAI,EAAE,eAAe;QACrB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;;IACrG,OAAO;QACL,6BAAK,SAAS,EAAC,qBAAqB;YAClC,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,EACvC,KAAK,EAAE,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,EACnC,aAAa,EAAE,GAAG,EAClB,aAAa,EAAC,MAAM,EACpB,OAAO,EAAE,CAAC,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAA,CAAC,CAAC,CAAC,EACrF,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;wBACd,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,CAAC,KAAK,EAAE;wBAC1B,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,EAAE,EAAE;oBACvB,CAAC,GACD,CACE;YACN,6BAAK,SAAS,EAAC,WAAW;gBACxB,oBAAC,MAAM,IACL,iBAAiB,EAAE,KAAK,EACxB,UAAU,EAAE,CAAC,cAAc,IAAI,QAAQ,IAAI,CAAC,KAAK,EACjD,aAAa,EAAE,GAAG,EAClB,aAAa,EAAC,MAAM,EACpB,OAAO,QACP,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA,CAAC,GACvD,OAAO,QAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,MAAK,KAAK,2CAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC,CAAA,CAAC,GACnG,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC7D,CACE,CACF,CACL,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interfaces.d.ts b/dist/cdc/interfaces.d.ts index ea0a466c0..b20ad5bc6 100644 --- a/dist/cdc/interfaces.d.ts +++ b/dist/cdc/interfaces.d.ts @@ -19,6 +19,16 @@ export interface IFilter { field?: string; children?: IFilter[]; } +export interface ICDCConfiguration { + filters: IFilter[]; + components: { + [key: string]: { + component: IFilterComponent; + config?: any; + }; + }; + compareColumns: string[]; +} export declare const itemTypes: { FILTERCARD: string; }; diff --git a/dist/cdc/interfaces.js.map b/dist/cdc/interfaces.js.map index 80bc78635..6d7399f8d 100644 --- a/dist/cdc/interfaces.js.map +++ b/dist/cdc/interfaces.js.map @@ -1 +1 @@ -{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/cdc/interfaces.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE;YACX,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;SAClC;QACD,wCAAwC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;SACF;KACF;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AACvC,CAAC,CAAC;AA6BF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file +{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/cdc/interfaces.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,EAAU,EACyC,EAAE;IACrD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,MAAK,EAAE,EAAE;QACrB,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KACxC;SAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpC,iCAAiC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE;YACX,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,CAAC;SAClC;QACD,wCAAwC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACzC,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;SACF;KACF;IACD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AACvC,CAAC,CAAC;AA6BF,MAAM,UAAU,OAAO,CAAC,GAA0B;;IAChD,OAAO,cAAQ,GAAW,0CAAE,EAAE,CAAA,KAAK,QAAQ,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 98c571e1b..738e72004 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert} from './interfaces'; +import {IAlert, IFilter, IFilterComponent, IUploadAlert, ICDCConfiguration} from './interfaces'; import {getAlerts, runAlertById} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter, CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter, CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter} from './filter'; import {v4 as uuidv4} from 'uuid'; @@ -9,9 +9,7 @@ import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './filter/CDCT import {CDCAlertView} from './alert/CDCAlertView'; interface ICDCFilterDialogProps { - filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; - filtersByCDC: {[cdcId: string]: IFilter[]}; - compareColumnOptions: string[]; + cdcConfig: {[cdcId: string]: ICDCConfiguration}; } export const CDC_DEFAULT_ALERT_DATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: null, compare_columns: null}; @@ -24,7 +22,7 @@ export const runAlert = async (id: number): Promise => { }); }; -export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOptions}: ICDCFilterDialogProps) { +export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) { const [selectedAlert, setSelectedAlert] = React.useState(); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); @@ -32,9 +30,6 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp const [alertData, setAlertData] = React.useState(); const {status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts} = useAsync(getAlerts, true); - // TODO: CDCs are more complex than just filters, i.e. they also have fields. - const cdcs = Object.keys(filtersByCDC); - React.useEffect(() => { setAlertData(CDC_DEFAULT_ALERT_DATA); setFilter(CDC_DEFAULT_FILTER); @@ -102,14 +97,11 @@ export function CDCFilterDialog({filterComponents, filtersByCDC, compareColumnOp setAlertData={setAlertData} filter={filter} setFilter={setFilter} - filterComponents={filterComponents} - filterSelection={filtersByCDC[alertData.cdc_id]} onAlertChanged={onAlertChanged} setCreationMode={setCreationMode} selectedAlert={selectedAlert} - cdcs={cdcs} - compareColumnOptions={compareColumnOptions} creationMode={creationMode} + cdcConfig={cdcConfig} /> : null } @@ -138,32 +130,37 @@ export class CDCFilterDialogClass { this.init(); } -//{id: .., filters: filter[], compareColumns: [], config: [id]: config} --> überschreibt die config einer bestimmten private init() { ReactDOM.render( , this.node ); diff --git a/src/cdc/alert/CDCAlertView.tsx b/src/cdc/alert/CDCAlertView.tsx index f582558a4..5914689eb 100644 --- a/src/cdc/alert/CDCAlertView.tsx +++ b/src/cdc/alert/CDCAlertView.tsx @@ -1,31 +1,40 @@ -import React from 'react'; +import React, {useEffect} from 'react'; import Select from 'react-select'; -import {runAlert} from '..'; +import {CDC_DEFAULT_FILTER, IFilterComponent, runAlert} from '..'; import {deleteAlert, editAlert, saveAlert} from '../api'; import {CDCFilterCreator} from '../creator'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert, IReactSelectOption} from '../interfaces'; +import {IAlert, IFilter, IUploadAlert, IReactSelectOption, ICDCConfiguration} from '../interfaces'; import {CDCDataChangeTable} from './CDCDataChangeTable'; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; - filterSelection?: IFilter[]; filter: IFilter; setFilter: (filter: IFilter) => void; - filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; onAlertChanged: (id?: number) => void; selectedAlert?: IAlert; - cdcs: string[]; - compareColumnOptions: string[]; creationMode: boolean; setCreationMode: (mode: boolean) => void; + cdcConfig: {[cdcId: string]: ICDCConfiguration}; } -export function CDCAlertView({alertData, setAlertData, filterSelection, filter, setFilter, filterComponents, onAlertChanged, selectedAlert, cdcs, compareColumnOptions, setCreationMode, creationMode}: ICDCEditAlert) { +export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); - const validFilter = filter?.children.length > 0; - const validName = alertData?.name?.trim().length > 0; + const [filterSelection, setFilterSelection] = React.useState(); + const [compareColumns, setCompareColumns] = React.useState(); + const [filterComponents, setFilterComponents] = React.useState<{[key: string]: {component: IFilterComponent, config?: any}}>(); + const [validFilter, setValidFilter] = React.useState(); + const [validName, setValidName] = React.useState(); + + // TODO: CDCs are more complex than just filters, i.e. they also have fields. + const cdcs = Object.keys(cdcConfig); + + React.useEffect(() => { + setFilterSelection(cdcConfig[alertData?.cdc_id]?.filters); + setCompareColumns(cdcConfig[alertData?.cdc_id]?.compareColumns); + setFilterComponents(cdcConfig[alertData?.cdc_id]?.components) + }, [alertData?.cdc_id]); React.useEffect(() => { setEditMode(false); @@ -33,16 +42,20 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, }, [selectedAlert]); const onCreateSave = async () => { - if (validFilter && validName) { + const valFilter = filter?.children.length > 0; + const valName = alertData?.name?.trim().length > 0; + if (valFilter && valName) { const newAlert = await saveAlert({...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; }); + }); onAlertChanged(newAlert.id); setCreationMode(false); } + setValidFilter(valFilter); + setValidName(valName); }; const onEditSave = async () => { @@ -70,6 +83,11 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, onAlertChanged(); }; + const onCDCChanged = (e) => { + setAlertData({...alertData, cdc_id: e.value}); + setFilter(CDC_DEFAULT_FILTER); + } + const editButton = !editMode && !deleteMode && !creationMode ? (<> @@ -112,8 +130,8 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, {!creationMode && !editMode ?
    {alertData.name}
    : - <> setAlertData({...alertData, name: e.target.value})} required /> - {validName ? null : + <> setAlertData({...alertData, name: e.target.value})} required /> + {validName !== false ? null :
    Name must not be empty!
    } @@ -125,8 +143,8 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, isDisabled={!creationMode && !editMode} options={cdcs.map((c) => ({label: c, value: c}))} value={{label: alertData.cdc_id, value: alertData.cdc_id}} - onChange={(e) => setAlertData({...alertData, cdc_id: e.value})} - /> + onChange={(e) => onCDCChanged(e)} + />
    @@ -134,7 +152,7 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter, isMulti isDisabled={!creationMode && !editMode} closeMenuOnSelect={false} - options={compareColumnOptions.map((c) => ({label: c, value: c}))} + options={compareColumns?.map((c) => ({label: c, value: c}))} value={alertData.compare_columns?.map((c) => ({label: c, value: c}))} onChange={(e) => setAlertData({...alertData, compare_columns: e.map((col) => col.value)})} /> @@ -142,14 +160,14 @@ export function CDCAlertView({alertData, setAlertData, filterSelection, filter,
    - setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> + setAlertData({...alertData, enable_mail_notification: e.target.checked})} />
    {filterSelection || !filter ? - + :

    No filters available for this cdc

    }
    diff --git a/src/cdc/creator/CDCFilterCreator.tsx b/src/cdc/creator/CDCFilterCreator.tsx index c2501a8a9..53cde0740 100644 --- a/src/cdc/creator/CDCFilterCreator.tsx +++ b/src/cdc/creator/CDCFilterCreator.tsx @@ -5,17 +5,18 @@ import {HTML5Backend} from 'react-dnd-html5-backend'; import {FilterCard} from './CDCFilterCard'; import {getFilterFromTree, IFilter, IFilterComponent} from '../interfaces'; import {v4 as uuidv4} from 'uuid'; +import {CDCGroupingFilter} from '..'; interface ICDCFilterCreatorProps { - filterSelection?: IFilter[]; + filterComponents?: {[key: string]: {component: IFilterComponent, config?: any}}; + filterSelection?: IFilter[]; filter: IFilter; setFilter: React.Dispatch>; - filterComponents: {[key: string]: {component: IFilterComponent, config?: any}}; disableFilter?: boolean; isInvalid?: boolean; } -export function CDCFilterCreator({filterSelection, filter, setFilter, filterComponents, disableFilter, isInvalid}: ICDCFilterCreatorProps) { +export function CDCFilterCreator({filterSelection, filter, setFilter, disableFilter, isInvalid, filterComponents}: ICDCFilterCreatorProps) { const onDelete = (newFilter: IFilter) => { setFilter((filter) => produce(filter, (nextFilter) => { const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); diff --git a/src/cdc/filter/CDCTextFilter.tsx b/src/cdc/filter/CDCTextFilter.tsx index c0dad3a3b..0e9982ecc 100644 --- a/src/cdc/filter/CDCTextFilter.tsx +++ b/src/cdc/filter/CDCTextFilter.tsx @@ -25,7 +25,9 @@ export function CDCTextFilterComponent({value, onValueChanged, onFieldChanged, d
    {return {label: v, value: v};})} options={config?.find((f) => f?.field === field)?.options.map((o) => {return {label: o, value: o};})} diff --git a/src/cdc/interfaces.ts b/src/cdc/interfaces.ts index 2d70c0a3f..b965461ed 100644 --- a/src/cdc/interfaces.ts +++ b/src/cdc/interfaces.ts @@ -21,6 +21,12 @@ export interface IFilter { children?: IFilter[]; } +export interface ICDCConfiguration { + filters: IFilter[]; + components: {[key: string]: {component: IFilterComponent, config?: any}}; + compareColumns: string[]; +} + export const itemTypes = { FILTERCARD: 'filtercard' }; From 7ec5c8ed4ac1cf24375244b4f1298641631da84a Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Mon, 15 Nov 2021 14:14:20 +0100 Subject: [PATCH 31/40] add error handling to several endpoints + bug fixes --- dist/cdc/CDCFilterDialog.js | 62 +++++++++++------ dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/alert/CDCAlertView.js | 87 ++++++++++++----------- dist/cdc/alert/CDCAlertView.js.map | 2 +- dist/cdc/alert/CDCDataChangeTable.js | 3 +- dist/cdc/alert/CDCDataChangeTable.js.map | 2 +- dist/cdc/api.d.ts | 4 ++ dist/cdc/api.js | 3 + dist/cdc/api.js.map | 2 +- dist/cdc/creator/CDCFilterCreator.js.map | 2 +- src/cdc/CDCFilterDialog.tsx | 38 +++++++--- src/cdc/alert/CDCAlertView.tsx | 89 ++++++++++++------------ src/cdc/alert/CDCDataChangeTable.tsx | 6 +- src/cdc/api.ts | 4 ++ src/cdc/creator/CDCFilterCreator.tsx | 1 - tdp_core/cdc/api.py | 45 ++++++++---- tdp_core/cdc/filter.py | 3 + 17 files changed, 217 insertions(+), 138 deletions(-) diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index b602162c4..d6755eeda 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -6,6 +6,8 @@ import { CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter, CDCChe import { v4 as uuidv4 } from 'uuid'; import { CDCTextFilter, CDCTextFilterId, createCDCTextFilter } from './filter/CDCTextFilter'; import { CDCAlertView } from './alert/CDCAlertView'; +import { ErrorMessage } from './common'; +import { runAllAlerts } from '.'; export const CDC_DEFAULT_ALERT_DATA = { name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: null, compare_columns: null }; export const CDC_DEFAULT_FILTER = { ...createCDCGroupingFilter(uuidv4()) }; export const runAlert = async (id) => { @@ -21,6 +23,14 @@ export function CDCFilterDialog({ cdcConfig }) { const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); const { status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts } = useAsync(getAlerts, true); + const { status: syncStatus, error: syncError, execute: doSync } = useAsync(async () => { + var _a; + const result = await runAllAlerts(); + if (((_a = result.error) === null || _a === void 0 ? void 0 : _a.length) > 0) { + throw `Alert(s) [${result.error.join(',')}] could not be synchronized!`; + } + onAlertChanged(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id); + }, false); React.useEffect(() => { setAlertData(CDC_DEFAULT_ALERT_DATA); setFilter(CDC_DEFAULT_FILTER); @@ -49,6 +59,19 @@ export function CDCFilterDialog({ cdcConfig }) { } }).catch((e) => console.error(e)); }; + const reviewStatus = (alert) => { + var _a, _b; + switch (true) { + case (alert.latest_error != null): + return `Error from Sync: ${(_a = new Date(alert.latest_error_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()}`; + case (alert.latest_diff != null): + return 'Pending data revision'; + case (alert.confirmation_date != null): + return `Last confirmed: ${(_b = new Date(alert.confirmation_date)) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()}`; + default: + return 'No data revision yet'; + } + }; return React.createElement(React.Fragment, null, React.createElement("a", { style: { color: 'white', cursor: 'pointer' }, onClick: () => setShowDialog(true) }, React.createElement("i", { className: "fas fa-filter", style: { marginRight: 4 } }), @@ -63,8 +86,7 @@ export function CDCFilterDialog({ cdcConfig }) { React.createElement("div", { className: "modal-body" }, React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-3 overflow-auto" }, - React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, - React.createElement("h5", null, "Your alerts"), + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, React.createElement("small", null, React.createElement("button", { className: "btn btn-text-secondary", onClick: () => onCreateButtonClick() }, React.createElement("i", { className: "fas fa-plus" })))), @@ -72,29 +94,27 @@ export function CDCFilterDialog({ cdcConfig }) { alertStatus === 'error' ? React.createElement(React.Fragment, null, "Error ", alertError.toString()) : null, - alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => { - var _a; - return React.createElement("div", { key: alert.id }, - React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, - React.createElement("div", { className: "d-flex w-100 justify-content-between" }, - React.createElement("h6", { title: `${alert.name} for ${alert.cdc_id}`, className: "mb-1 overflow-hidden" }, - alert.name, - " ", - React.createElement("small", { className: "text-muted" }, - "for ", - alert.cdc_id)), - (alert === null || alert === void 0 ? void 0 : alert.latest_diff) ? React.createElement("small", null, - React.createElement("i", { className: "fas fa-circle text-primary" })) : null), - React.createElement("small", null, !(alert === null || alert === void 0 ? void 0 : alert.latest_diff) && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${(_a = new Date(alert.confirmation_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()}`))); - })) : null), + alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => React.createElement("div", { key: alert.id }, + React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, + React.createElement("div", { className: "d-flex w-100 justify-content-between" }, + React.createElement("h6", { title: `${alert.name} for ${alert.cdc_id}`, className: "mb-1 overflow-hidden" }, + alert.name, + " ", + React.createElement("small", { className: "text-muted" }, + "for ", + alert.cdc_id)), + (alert === null || alert === void 0 ? void 0 : alert.latest_diff) ? React.createElement("small", null, + React.createElement("i", { className: "fas fa-circle text-primary" })) : null, + (alert === null || alert === void 0 ? void 0 : alert.latest_error) ? React.createElement("small", null, + React.createElement("i", { className: "fas fa-exclamation-triangle text-danger" })) : null), + React.createElement("small", null, reviewStatus(alert)))))) : null), React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert || creationMode ? React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, creationMode: creationMode, cdcConfig: cdcConfig }) : null))), React.createElement("div", { className: "modal-footer" }, + React.createElement(ErrorMessage, { error: syncError }), React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), - React.createElement("button", { type: "button", onClick: () => { - Promise.all(alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => runAlert(alert === null || alert === void 0 ? void 0 : alert.id))).then(() => onAlertChanged(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id)); - }, className: "btn btn-secondary" }, "Sync"))))))); + React.createElement("button", { type: "button", disabled: syncStatus === 'pending', title: "Sync alerts", className: "btn btn-secondary", onClick: () => doSync() }, "Sync"))))))); } export class CDCFilterDialogClass { constructor(parent) { @@ -117,7 +137,7 @@ export class CDCFilterDialogClass { [CDCCheckboxFilterId]: { component: CDCCheckboxFilter, config: { fields: ['Eins', 'Zwei', 'Drei'] } }, [CDCRangeFilterId]: { component: CDCRangeFilter, config: { minValue: 1, maxValue: 10 } } }, - compareColumns: ['id', 'name', 'address.street', 'adress.city', 'address.zipcode'] + compareColumns: ['id', 'name', 'address.street', 'address.city', 'address.zipcode'] }, 'JSONPlaceholderPostsCDC': { filters: [ diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index a504b5bf2..c6f9ec3f0 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cdc/CDCFilterDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClN,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,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AAE,EAAC,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAC,EAAC;wBACjG,CAAC,gBAAgB,CAAC,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAC,EAAC;qBACrF;oBACD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,CAAC;iBACpF;gBACD,yBAAyB,EAAE;oBACzB,OAAO,EAAE;wBACP,uBAAuB,CAAC,MAAM,EAAE,CAAC;wBACjC,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAC,CAAC;qBACzD;oBACD,UAAU,EAAE;wBACV,CAAC,mBAAmB,CAAC,EAAE,EAAC,SAAS,EAAE,iBAAiB,EAAC;wBACrD,CAAC,gBAAgB,CAAC,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAC,EAAC;qBACtF;oBACD,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;iBAClC;aACF,GACD,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCAlertView.js b/dist/cdc/alert/CDCAlertView.js index 545954fdd..87a92bb42 100644 --- a/dist/cdc/alert/CDCAlertView.js +++ b/dist/cdc/alert/CDCAlertView.js @@ -1,11 +1,12 @@ import React from 'react'; import Select from 'react-select'; -import { CDC_DEFAULT_FILTER, runAlert } from '..'; +import { CDC_DEFAULT_FILTER, ErrorMessage, runAlert } from '..'; +import { useAsync } from '../../hooks'; import { deleteAlert, editAlert, saveAlert } from '../api'; import { CDCFilterCreator } from '../creator'; import { CDCDataChangeTable } from './CDCDataChangeTable'; export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }) { - var _a, _b; + var _a; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); const [filterSelection, setFilterSelection] = React.useState(); @@ -13,6 +14,40 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle const [filterComponents, setFilterComponents] = React.useState(); const [validFilter, setValidFilter] = React.useState(); const [validName, setValidName] = React.useState(); + const { status: deleteStatus, error: deleteError, execute: doDelete } = useAsync(async () => { + setEditMode(false); + await deleteAlert(selectedAlert.id); + onAlertChanged(); + }, false); + const { status: saveStatus, error: saveError, execute: doSave } = useAsync(async () => { + var _a; + const valFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; + const valName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; + if (valFilter && valName) { + let newAlert; + if (selectedAlert) { + newAlert = await editAlert(selectedAlert.id, { ...alertData, filter }) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + setEditMode(false); + } + else { + newAlert = await saveAlert({ ...alertData, filter }) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + setCreationMode(false); + } + onAlertChanged(newAlert.id); + } + setValidFilter(valFilter); + setValidName(valName); + }, false); // TODO: CDCs are more complex than just filters, i.e. they also have fields. const cdcs = Object.keys(cdcConfig); React.useEffect(() => { @@ -25,47 +60,13 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle setEditMode(false); setDeleteMode(false); }, [selectedAlert]); - const onCreateSave = async () => { - var _a; - const valFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; - const valName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; - if (valFilter && valName) { - const newAlert = await saveAlert({ ...alertData, filter }) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } - setValidFilter(valFilter); - setValidName(valName); - }; - const onEditSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, { ...alertData, filter }) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } - }; const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); setFilter(selectedAlert.filter); }; - const onDelete = async (id) => { - setEditMode(false); - await deleteAlert(id); - onAlertChanged(); - }; const onCDCChanged = (e) => { - setAlertData({ ...alertData, cdc_id: e.value }); + setAlertData({ ...alertData, cdc_id: e.value, compare_columns: null }); setFilter(CDC_DEFAULT_FILTER); }; const editButton = !editMode && !deleteMode && !creationMode ? (React.createElement(React.Fragment, null, @@ -73,17 +74,17 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle React.createElement("i", { className: "fas fa-pencil-alt" })), React.createElement("button", { title: "Delete Alert", className: "btn btn-text-secondary", onClick: () => setDeleteMode(true) }, React.createElement("i", { className: "fas fa-trash" })))) : (editMode || creationMode ? React.createElement(React.Fragment, null, - React.createElement("button", { title: "Save changes", className: "btn btn-text-secondary", onClick: editMode ? () => onEditSave() : () => onCreateSave() }, + React.createElement("button", { title: "Save changes", className: "btn btn-text-secondary", onClick: () => doSave() }, React.createElement("i", { className: "fas fa-save" })), React.createElement("button", { title: "Discard changes", className: "btn btn-text-secondary ms-1", onClick: editMode ? () => onDiscard() : () => setCreationMode(false) }, React.createElement("i", { className: "fas fa-times" }))) : React.createElement(React.Fragment, null, - React.createElement("button", { title: "Delete", className: "btn btn-text-secondary", onClick: () => onDelete(selectedAlert.id) }, + React.createElement("button", { title: "Delete", className: "btn btn-text-secondary", onClick: () => doDelete() }, React.createElement("i", { className: "fas fa-check" })), React.createElement("button", { title: "No Delete", className: "btn btn-text-secondary ms-1", onClick: () => setDeleteMode(false) }, React.createElement("i", { className: "fas fa-times" })))); return (React.createElement(React.Fragment, null, - React.createElement("div", { className: "d-flex w-100 justify-content-between mb-1" }, - React.createElement("h5", null, "Your options"), + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement(ErrorMessage, { error: deleteError || saveError }), React.createElement("small", null, editButton)), React.createElement("div", { className: "accordion", id: "editAlert" }, !editMode && !creationMode ? @@ -112,7 +113,9 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => ({ label: c, value: c })), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => onCDCChanged(e) })), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "Change Fields"), - React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumns === null || compareColumns === void 0 ? void 0 : compareColumns.map((c) => ({ label: c, value: c })), value: (_b = alertData.compare_columns) === null || _b === void 0 ? void 0 : _b.map((c) => ({ label: c, value: c })), onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) })), + React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumns === null || compareColumns === void 0 ? void 0 : compareColumns.map((c) => ({ label: c, value: c })), + //check for compare_columns because otherwise it would not reset the selection after the cdc_id was changed + value: alertData.compare_columns ? alertData.compare_columns.map((c) => ({ label: c, value: c })) : null, onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) })), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, diff --git a/dist/cdc/alert/CDCAlertView.js.map b/dist/cdc/alert/CDCAlertView.js.map index 3c6c91aa9..32ae2701b 100644 --- a/dist/cdc/alert/CDCAlertView.js.map +++ b/dist/cdc/alert/CDCAl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AY,CAAC,EAAC,GAAG,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAC,CAAC,GACzF,CACE;wBACN,6BAAK,SAAS,EAAC,UAAU;4BACvB,+BAAO,SAAS,EAAC,YAAY,yBAA2B;4BACxD,6BAAK,SAAS,EAAC,YAAY;gCACzB,+BAAO,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;gCACpO,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;oBACN,iCACG,eAAe,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC3B,oBAAC,gBAAgB,IAAC,eAAe,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,KAAK,KAAK,GAAI;wBACtM,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCDataChangeTable.js b/dist/cdc/alert/CDCDataChangeTable.js index 100a8d3bc..99a3c2e2e 100644 --- a/dist/cdc/alert/CDCDataChangeTable.js +++ b/dist/cdc/alert/CDCDataChangeTable.js @@ -29,7 +29,6 @@ export function CDCDataChangeTable({ selectedAlert, onAlertChanged }) { const alert = await confirmAlertById(selectedAlert.id); onAlertChanged(alert.id); }, false); - //loading icon when loading return (React.createElement(React.Fragment, null, selectedAlert.latest_diff || selectedAlert.confirmed_data ? (React.createElement(React.Fragment, null, React.createElement("table", { className: "table mb-0" }, React.createElement("thead", null, @@ -73,7 +72,7 @@ export function CDCDataChangeTable({ selectedAlert, onAlertChanged }) { React.createElement("td", null, hasChanged ? React.createElement(React.Fragment, null, "Changed") : null))); })) : null)), selectedAlert.latest_diff ? React.createElement("div", { className: "p-1" }, - React.createElement(ErrorMessage, { error: confirmError, onRetry: () => doConfirm() }), + React.createElement(ErrorMessage, { error: confirmError }), React.createElement("div", { className: "d-md-flex justify-content-md-end" }, React.createElement("button", { disabled: confirmStatus === 'pending', title: "Confirm changes", className: "btn btn-primary", onClick: () => doConfirm() }, "Confirm"))) : null)) : React.createElement("p", null, "No new data available"))); } diff --git a/dist/cdc/alert/CDCDataChangeTable.js.map b/dist/cdc/alert/CDCDataChangeTable.js.map index 8bcd71f12..3de30edeb 100644 --- a/dist/cdc/alert/CDCDataChangeTable.js.map +++ b/dist/cdc/alert/CDCDataChangeTable.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCDataChangeTable.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCDataChangeTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAQpD,MAAM,UAAU,kBAAkB,CAAC,EAAC,aAAa,EAAE,cAAc,EAAsB;;IACrF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAuD,IAAI,GAAG,EAAE,CAAC,CAAC;IAEpH,SAAS,CAAC,GAAG,EAAE;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C,CAAC,CAAC,IAAI,CACJ,CACF;QACP,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,KAAK;YAC/C,oBAAC,YAAY,IAAC,KAAK,EAAE,YAAY,GAAI;YACrC,6BAAK,SAAS,EAAC,kCAAkC;gBAC/C,gCAAQ,QAAQ,EAAE,aAAa,KAAK,SAAS,EAAE,KAAK,EAAC,iBAAiB,EAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,cAAkB,CAC3I,CACF,CAAC,CAAC,CAAC,IAAI,CACZ,CAAC,CAAC,CAAC,CAAC,uDAA4B,CAClC,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/api.d.ts b/dist/cdc/api.d.ts index 0200fc73e..ea1db11fc 100644 --- a/dist/cdc/api.d.ts +++ b/dist/cdc/api.d.ts @@ -16,3 +16,7 @@ export declare function deleteAlert(id: number): Promise; export declare function saveAlert(alert: IUploadAlert): Promise; export declare function runAlertById(id: number): Promise; export declare function confirmAlertById(id: number): Promise; +export declare function runAllAlerts(): Promise<{ + success: string[]; + error: string[]; +} | null>; diff --git a/dist/cdc/api.js b/dist/cdc/api.js index 861adbb84..31eeb1961 100644 --- a/dist/cdc/api.js +++ b/dist/cdc/api.js @@ -30,4 +30,7 @@ export async function runAlertById(id) { export async function confirmAlertById(id) { return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}/confirm`); } +export async function runAllAlerts() { + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/run`); +} //# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/dist/cdc/api.js.map b/dist/cdc/api.js.map index 895064432..b6383c2f0 100644 --- a/dist/cdc/api.js.map +++ b/dist/cdc/api.js.map @@ -1 +1 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/cdc/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;2DAS2D;AAE3D,OAAO,EAAC,IA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BAAkB,EAAE,MAAM,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAU;IAC/C,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AACnE,CAAC"} \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCreator.js.map b/dist/cdc/creator/CDCFilterCreator.js.map index c5ec52e3f..83daf25b5 100644 --- a/dist/cdc/creator/CDCFilterCreator.js.map +++ b/dist/cdc/creator/CDCFilterCreator.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAYlC,MAAM,UAAU,gBAAgB,CAAC,EAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAyB;IACvI,MAAM,QAAQ,GAAG,CAAC,SAAkB,EAAE,EAAE;QACtC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;YACnD,MAAM,EAAC,OAAO,EAAE,MAAM,EAAC,GAA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AAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YACrB,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAG,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,MAAM,KAAK,CAAC,+CAA+C,CAAC,CAAC;KAC9D;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAClB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,+CAAqB;gBACrB,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,GACrB,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WA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,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 738e72004..3a45da153 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -1,12 +1,14 @@ import * as React from 'react'; import ReactDOM from 'react-dom'; import {BSModal, useAsync} from '../hooks'; -import {IAlert, IFilter, IFilterComponent, IUploadAlert, ICDCConfiguration} from './interfaces'; +import {IAlert, IFilter, IUploadAlert, ICDCConfiguration} from './interfaces'; import {getAlerts, runAlertById} from './api'; import {CDCGroupingFilterId, CDCGroupingFilter, createCDCGroupingFilter, CDCCheckboxFilter, CDCCheckboxFilterId, createCDCCheckboxFilter, CDCRangeFilter, CDCRangeFilterId, createCDCRangeFilter} from './filter'; import {v4 as uuidv4} from 'uuid'; import {CDCTextFilter, CDCTextFilterId, createCDCTextFilter} from './filter/CDCTextFilter'; import {CDCAlertView} from './alert/CDCAlertView'; +import {ErrorMessage} from './common'; +import {runAllAlerts} from '.'; interface ICDCFilterDialogProps { cdcConfig: {[cdcId: string]: ICDCConfiguration}; @@ -29,6 +31,13 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) { const [filter, setFilter] = React.useState(); const [alertData, setAlertData] = React.useState(); const {status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts} = useAsync(getAlerts, true); + const {status: syncStatus, error: syncError, execute: doSync} = useAsync(async () => { + const result = await runAllAlerts() + if (result.error?.length > 0) { + throw `Alert(s) [${result.error.join(',')}] could not be synchronized!`; + } + onAlertChanged(selectedAlert?.id); + }, false); React.useEffect(() => { setAlertData(CDC_DEFAULT_ALERT_DATA); @@ -61,6 +70,19 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) { }).catch((e) => console.error(e)); }; + const reviewStatus = (alert: IAlert) => { + switch (true) { + case (alert.latest_error != null): + return `Error from Sync: ${new Date(alert.latest_error_date)?.toLocaleDateString()}`; + case (alert.latest_diff != null): + return 'Pending data revision'; + case (alert.confirmation_date != null): + return `Last confirmed: ${new Date(alert.confirmation_date)?.toLocaleDateString()}`; + default: + return 'No data revision yet'; + } + } + return <> setShowDialog(true)}> Alert Filter @@ -74,8 +96,7 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) {
    -
    -
    Your alerts
    +
    {alertStatus === 'pending' ? <>Loading... : null} @@ -85,8 +106,9 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) {
    {alert.name} for {alert.cdc_id}
    {alert?.latest_diff ? : null} + {alert?.latest_error ? : null}
    - {!alert?.latest_diff && !alert.confirmed_data ? 'No data revision yet' : alert.latest_diff ? 'Pending data revision' : `Last confirmed: ${new Date(alert.confirmation_date)?.toLocaleDateString()}`} + {reviewStatus(alert)}
    )}
    : null}
    @@ -109,10 +131,9 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) {
    + - +
    @@ -147,7 +168,7 @@ export class CDCFilterDialogClass { [CDCCheckboxFilterId]: {component: CDCCheckboxFilter, config: {fields: ['Eins', 'Zwei', 'Drei']}}, [CDCRangeFilterId]: {component: CDCRangeFilter, config: {minValue: 1, maxValue: 10}} }, - compareColumns: ['id', 'name', 'address.street', 'adress.city', 'address.zipcode'] + compareColumns: ['id', 'name', 'address.street', 'address.city', 'address.zipcode'] }, 'JSONPlaceholderPostsCDC': { filters: [ @@ -166,3 +187,4 @@ export class CDCFilterDialogClass { ); } } + diff --git a/src/cdc/alert/CDCAlertView.tsx b/src/cdc/alert/CDCAlertView.tsx index 5914689eb..30aef90e1 100644 --- a/src/cdc/alert/CDCAlertView.tsx +++ b/src/cdc/alert/CDCAlertView.tsx @@ -1,6 +1,7 @@ import React, {useEffect} from 'react'; import Select from 'react-select'; -import {CDC_DEFAULT_FILTER, IFilterComponent, runAlert} from '..'; +import {CDC_DEFAULT_FILTER, ErrorMessage, IFilterComponent, runAlert} from '..'; +import {useAsync} from '../../hooks'; import {deleteAlert, editAlert, saveAlert} from '../api'; import {CDCFilterCreator} from '../creator'; import {IAlert, IFilter, IUploadAlert, IReactSelectOption, ICDCConfiguration} from '../interfaces'; @@ -27,6 +28,40 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler const [validFilter, setValidFilter] = React.useState(); const [validName, setValidName] = React.useState(); + const {status: deleteStatus, error: deleteError, execute: doDelete} = useAsync(async () => { + setEditMode(false); + await deleteAlert(selectedAlert.id); + onAlertChanged(); + }, false); + + const {status: saveStatus, error: saveError, execute: doSave} = useAsync(async () => { + const valFilter = filter?.children.length > 0; + const valName = alertData?.name?.trim().length > 0; + if (valFilter && valName) { + let newAlert; + if (selectedAlert) { + newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + setEditMode(false); + } else { + newAlert = await saveAlert({...alertData, filter}) + .then((alert) => { + return runAlert(alert.id).then((a) => { + return a ? a : alert; + }); + }); + setCreationMode(false); + } + onAlertChanged(newAlert.id); + } + setValidFilter(valFilter); + setValidName(valName); + }, false); + // TODO: CDCs are more complex than just filters, i.e. they also have fields. const cdcs = Object.keys(cdcConfig); @@ -41,35 +76,6 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler setDeleteMode(false); }, [selectedAlert]); - const onCreateSave = async () => { - const valFilter = filter?.children.length > 0; - const valName = alertData?.name?.trim().length > 0; - if (valFilter && valName) { - const newAlert = await saveAlert({...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setCreationMode(false); - } - setValidFilter(valFilter); - setValidName(valName); - }; - - const onEditSave = async () => { - if (validFilter && validName) { - const newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) - .then((alert) => { - return runAlert(alert.id).then((a) => { - return a ? a : alert; - }); - }); - onAlertChanged(newAlert.id); - setEditMode(false); - } - }; const onDiscard = () => { setEditMode(false); @@ -77,14 +83,8 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler setFilter(selectedAlert.filter); }; - const onDelete = async (id: number) => { - setEditMode(false); - await deleteAlert(id); - onAlertChanged(); - }; - const onCDCChanged = (e) => { - setAlertData({...alertData, cdc_id: e.value}); + setAlertData({...alertData, cdc_id: e.value, compare_columns: null}); setFilter(CDC_DEFAULT_FILTER); } @@ -92,16 +92,16 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler ) : (editMode || creationMode ? <> - + : <> - + ); return (<> -
    -
    Your options
    +
    + {editButton}
    @@ -113,7 +113,7 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler
    - +
    : null} @@ -144,7 +144,7 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler options={cdcs.map((c) => ({label: c, value: c}))} value={{label: alertData.cdc_id, value: alertData.cdc_id}} onChange={(e) => onCDCChanged(e)} - /> + />
    @@ -153,7 +153,8 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler isDisabled={!creationMode && !editMode} closeMenuOnSelect={false} options={compareColumns?.map((c) => ({label: c, value: c}))} - value={alertData.compare_columns?.map((c) => ({label: c, value: c}))} + //check for compare_columns because otherwise it would not reset the selection after the cdc_id was changed + value={alertData.compare_columns ? alertData.compare_columns.map((c) => ({label: c, value: c})) : null} onChange={(e) => setAlertData({...alertData, compare_columns: e.map((col) => col.value)})} />
    diff --git a/src/cdc/alert/CDCDataChangeTable.tsx b/src/cdc/alert/CDCDataChangeTable.tsx index 8c7e86024..952bc1608 100644 --- a/src/cdc/alert/CDCDataChangeTable.tsx +++ b/src/cdc/alert/CDCDataChangeTable.tsx @@ -35,8 +35,6 @@ export function CDCDataChangeTable({selectedAlert, onAlertChanged}: ICDCDataChan onAlertChanged(alert.id); }, false); - //loading icon when loading - return (<> {selectedAlert.latest_diff || selectedAlert.confirmed_data ? (<> @@ -96,7 +94,7 @@ export function CDCDataChangeTable({selectedAlert, onAlertChanged}: ICDCDataChan
    {selectedAlert.latest_diff ?
    - doConfirm()} /> +
    @@ -104,3 +102,5 @@ export function CDCDataChangeTable({selectedAlert, onAlertChanged}: ICDCDataChan ) :

    No new data available

    } ); } + + diff --git a/src/cdc/api.ts b/src/cdc/api.ts index a2d43e9a9..a5949466b 100644 --- a/src/cdc/api.ts +++ b/src/cdc/api.ts @@ -39,3 +39,7 @@ export async function runAlertById(id: number): Promise { export async function confirmAlertById(id: number): Promise { return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/${id}/confirm`); } + +export async function runAllAlerts(): Promise<{success: string[], error: string[]} | null> { + return AppContext.getInstance().getAPIJSON(`/tdp/cdc/alert/run`); +} diff --git a/src/cdc/creator/CDCFilterCreator.tsx b/src/cdc/creator/CDCFilterCreator.tsx index 53cde0740..711c53c12 100644 --- a/src/cdc/creator/CDCFilterCreator.tsx +++ b/src/cdc/creator/CDCFilterCreator.tsx @@ -5,7 +5,6 @@ import {HTML5Backend} from 'react-dnd-html5-backend'; import {FilterCard} from './CDCFilterCard'; import {getFilterFromTree, IFilter, IFilterComponent} from '../interfaces'; import {v4 as uuidv4} from 'uuid'; -import {CDCGroupingFilter} from '..'; interface ICDCFilterCreatorProps { filterComponents?: {[key: string]: {component: IFilterComponent, config?: any}}; diff --git a/tdp_core/cdc/api.py b/tdp_core/cdc/api.py index 3b8072c4d..72c6cb965 100644 --- a/tdp_core/cdc/api.py +++ b/tdp_core/cdc/api.py @@ -1,5 +1,6 @@ import logging from datetime import datetime +from re import A from flask_smorest import Api, Blueprint from phovea_server.ns import Namespace, abort, no_cache from phovea_server.security import login_required, can_write, can_read, current_username @@ -24,6 +25,18 @@ 'cdc', __name__, url_prefix='/' ) +def run_alert(alert: CDCAlert): + new_data, diff = cdc_manager.run_alert(alert) + + if diff: + # We have a new diff! Send email? Store in db? ... + alert.latest_compare_date = datetime.utcnow() + alert.latest_fetched_data = new_data + alert.latest_diff = diff + # TODO else: also set latest diff to empty + + alert.latest_error = None + alert.latest_error_date = None @app.errorhandler(400) @app.errorhandler(404) @@ -118,6 +131,25 @@ def delete_alert_by_id(id: int): return "", 200 +@no_cache +@login_required +@blp.route('/alert/run', methods=["GET"]) +@blp.response(CDCAlertSchema(many=True,), code=200) +def run_all_alerts(): + session = create_session() + alerts = session.query(CDCAlert).all() + result = {'success': [], 'error': []} + for alert in alerts: + try: + run_alert(alert) + result['success'].append(alert.id) + except: + result['error'].append(alert.id) + + session.commit() + return jsonify(result) + + @no_cache @login_required @blp.route('/alert//run', methods=["GET"]) @@ -131,18 +163,7 @@ def run_alert_by_id(id: int): abort(401) try: - new_data, diff = cdc_manager.run_alert(alert) - - if diff: - # We have a new diff! Send email? Store in db? ... - alert.latest_compare_date = datetime.utcnow() - alert.latest_fetched_data = new_data - alert.latest_diff = diff - # TODO else: also set latest diff to empty - - alert.latest_error = None - alert.latest_error_date = None - + run_alert(alert) session.commit() return alert, 200 diff --git a/tdp_core/cdc/filter.py b/tdp_core/cdc/filter.py index 41801618e..650de1cf6 100644 --- a/tdp_core/cdc/filter.py +++ b/tdp_core/cdc/filter.py @@ -48,9 +48,12 @@ class FieldFilterMixin: def access(item, field: str) -> Any: for field_name in field.split("."): assert not field_name.startswith("_"), "Private access detected." + if item is None: + return None # get array-calls m = match(r"(.*)\[(.*)\\]", field) + if m: field_name, field_idx = m.groups() item = getattr(item, field_name).__getitem__(field_idx) From 96a91695ceefe3496f32db4842a6f4af49cfc1a7 Mon Sep 17 00:00:00 2001 From: dvtschachinger Date: Tue, 16 Nov 2021 13:41:55 +0100 Subject: [PATCH 32/40] filter error --- dist/cdc/CDCFilterDialog.d.ts | 12 +- dist/cdc/CDCFilterDialog.js | 97 +++++++-------- dist/cdc/CDCFilterDialog.js.map | 2 +- dist/cdc/alert/CDCAlertView.d.ts | 6 +- dist/cdc/alert/CDCAlertView.js | 83 +++++++------ dist/cdc/alert/CDCAlertView.js.map | 2 +- dist/cdc/alert/CDCDataChangeTable.d.ts | 2 +- dist/cdc/alert/CDCDataChangeTable.js | 104 ++++++++-------- dist/cdc/alert/CDCDataChangeTable.js.map | 2 +- dist/cdc/common/ErrorMessage.js | 2 +- dist/cdc/common/ErrorMessage.js.map | 2 +- dist/cdc/creator/CDCFilterCard.js | 2 +- dist/cdc/creator/CDCFilterCard.js.map | 2 +- dist/cdc/creator/CDCFilterCreator.d.ts | 4 +- dist/cdc/creator/CDCFilterCreator.js | 10 +- dist/cdc/creator/CDCFilterCreator.js.map | 2 +- dist/cdc/interfaces.d.ts | 2 +- src/cdc/CDCFilterDialog.tsx | 119 +++++++++---------- src/cdc/alert/CDCAlertView.tsx | 85 +++++++------ src/cdc/alert/CDCDataChangeTable.tsx | 144 ++++++++++++----------- src/cdc/common/ErrorMessage.tsx | 22 ++-- src/cdc/common/index.ts | 2 +- src/cdc/creator/CDCFilterCard.tsx | 2 +- src/cdc/creator/CDCFilterCreator.tsx | 13 +- src/cdc/filter/CDCTextFilter.tsx | 2 +- src/cdc/index.ts | 2 +- src/cdc/interfaces.ts | 4 +- tdp_core/cdc/CDCAlert.py | 5 + tdp_core/cdc/api.py | 56 +++++---- 29 files changed, 407 insertions(+), 385 deletions(-) diff --git a/dist/cdc/CDCFilterDialog.d.ts b/dist/cdc/CDCFilterDialog.d.ts index 2ebed44cb..e2fb79605 100644 --- a/dist/cdc/CDCFilterDialog.d.ts +++ b/dist/cdc/CDCFilterDialog.d.ts @@ -1,19 +1,11 @@ /// -import { IAlert, IFilter, IUploadAlert, ICDCConfiguration } from './interfaces'; +import { IAlert, IUploadAlert, ICDCConfiguration } from './interfaces'; interface ICDCFilterDialogProps { cdcConfig: { [cdcId: string]: ICDCConfiguration; }; } -export declare const CDC_DEFAULT_ALERT_DATA: IUploadAlert; -export declare const CDC_DEFAULT_FILTER: { - id: string; - operator?: "AND" | "OR"; - type: string; - value?: any; - field?: string; - children?: IFilter[]; -}; +export declare const CDC_DEFAULT_ALERT_DATA: () => IUploadAlert; export declare const runAlert: (id: number) => Promise; export declare function CDCFilterDialog({ cdcConfig }: ICDCFilterDialogProps): JSX.Element; export declare class CDCFilterDialogClass { diff --git a/dist/cdc/CDCFilterDialog.js b/dist/cdc/CDCFilterDialog.js index d6755eeda..e36da0502 100644 --- a/dist/cdc/CDCFilterDialog.js +++ b/dist/cdc/CDCFilterDialog.js @@ -8,8 +8,7 @@ import { CDCTextFilter, CDCTextFilterId, createCDCTextFilter } from './filter/CD import { CDCAlertView } from './alert/CDCAlertView'; import { ErrorMessage } from './common'; import { runAllAlerts } from '.'; -export const CDC_DEFAULT_ALERT_DATA = { name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: null, compare_columns: null }; -export const CDC_DEFAULT_FILTER = { ...createCDCGroupingFilter(uuidv4()) }; +export const CDC_DEFAULT_ALERT_DATA = () => ({ name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: createCDCGroupingFilter(uuidv4()), compare_columns: null }); export const runAlert = async (id) => { return runAlertById(id).then((alert) => { return alert; }).catch((e) => { alert(`${e}: Invalid filter parameter in alert: ${id}`); @@ -17,48 +16,41 @@ export const runAlert = async (id) => { }); }; export function CDCFilterDialog({ cdcConfig }) { - const [selectedAlert, setSelectedAlert] = React.useState(); + const [selectedAlert, setSelectedAlert] = React.useState(null); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); - const [filter, setFilter] = React.useState(); - const [alertData, setAlertData] = React.useState(); + const [alertData, setAlertData] = React.useState(null); + const onAlertChanged = async (id) => { + //refetches alerts and makes new selection + fetchAlerts().then((alerts) => { + //if no id there is no need to iterate through alerts + if (!id) { + setSelectedAlert(null); + } + else { + setSelectedAlert(alerts.find((alert) => alert.id === id)); + } + }); + }; const { status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts } = useAsync(getAlerts, true); const { status: syncStatus, error: syncError, execute: doSync } = useAsync(async () => { var _a; const result = await runAllAlerts(); if (((_a = result.error) === null || _a === void 0 ? void 0 : _a.length) > 0) { - throw `Alert(s) [${result.error.join(',')}] could not be synchronized!`; + throw new Error(`Alert(s) [${result.error.join(',')}] could not be synchronized!`); } onAlertChanged(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id); }, false); - React.useEffect(() => { - setAlertData(CDC_DEFAULT_ALERT_DATA); - setFilter(CDC_DEFAULT_FILTER); - }, []); const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); - setAlertData(CDC_DEFAULT_ALERT_DATA); - setFilter(CDC_DEFAULT_FILTER); + setAlertData(CDC_DEFAULT_ALERT_DATA()); }; const onAlertClick = async (alert) => { setAlertData(alert); - setFilter(alert.filter); setCreationMode(false); setSelectedAlert(alert); }; - const onAlertChanged = async (id) => { - //refetches alerts and makes new selection - fetchAlerts().then((alerts) => { - //if no id there is no need to iterate through alerts - if (!id) { - setSelectedAlert(null); - } - else { - setSelectedAlert(alerts.find((alert) => alert.id === id)); - } - }).catch((e) => console.error(e)); - }; const reviewStatus = (alert) => { var _a, _b; switch (true) { @@ -83,36 +75,33 @@ export function CDCFilterDialog({ cdcConfig }) { React.createElement("div", { className: "modal-header" }, React.createElement("h5", { className: "modal-title" }, "Alerts"), React.createElement("button", { type: "button", className: "btn-close", "data-bs-dismiss": "modal", "aria-label": "Close" })), - React.createElement("div", { className: "modal-body" }, - React.createElement("div", { className: "row" }, - React.createElement("div", { className: "col-3 overflow-auto" }, - React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement("small", null, - React.createElement("button", { className: "btn btn-text-secondary", onClick: () => onCreateButtonClick() }, - React.createElement("i", { className: "fas fa-plus" })))), - alertStatus === 'pending' ? React.createElement(React.Fragment, null, "Loading...") : null, - alertStatus === 'error' ? React.createElement(React.Fragment, null, - "Error ", - alertError.toString()) : null, - alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => React.createElement("div", { key: alert.id }, - React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, - React.createElement("div", { className: "d-flex w-100 justify-content-between" }, - React.createElement("h6", { title: `${alert.name} for ${alert.cdc_id}`, className: "mb-1 overflow-hidden" }, - alert.name, - " ", - React.createElement("small", { className: "text-muted" }, - "for ", - alert.cdc_id)), - (alert === null || alert === void 0 ? void 0 : alert.latest_diff) ? React.createElement("small", null, - React.createElement("i", { className: "fas fa-circle text-primary" })) : null, - (alert === null || alert === void 0 ? void 0 : alert.latest_error) ? React.createElement("small", null, - React.createElement("i", { className: "fas fa-exclamation-triangle text-danger" })) : null), - React.createElement("small", null, reviewStatus(alert)))))) : null), - React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert || creationMode ? - React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, filter: filter, setFilter: setFilter, onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, creationMode: creationMode, cdcConfig: cdcConfig }) - : null))), + React.createElement("div", { className: "modal-body" }, syncStatus === 'pending' || alertStatus === 'pending' ? + React.createElement("i", { className: "fas fa-spinner fa-spin" }) + : + React.createElement("div", { className: "row" }, + React.createElement("div", { className: "col-3 overflow-auto" }, + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement("small", null, + React.createElement("button", { className: "btn btn-text-secondary", onClick: () => onCreateButtonClick() }, + React.createElement("i", { className: "fas fa-plus" })))), + alertError ? React.createElement(ErrorMessage, { error: new Error(`While loading occured ${alertError}`), onRetry: () => fetchAlerts() }) : null, + alertStatus === 'success' ? React.createElement("div", { className: "list-group" }, alerts.map((alert) => React.createElement("div", { key: alert.id }, + React.createElement("a", { href: "#", className: `list-group-item list-group-item-action${(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.id) === (alert === null || alert === void 0 ? void 0 : alert.id) ? ' border-primary' : ''}`, onClick: () => onAlertClick(alert), "aria-current": "true" }, + React.createElement("div", { className: "d-flex w-100 justify-content-between" }, + React.createElement("h6", { title: `${alert.name} for ${alert.cdc_id}`, className: "mb-1 overflow-hidden" }, + alert.name, + " ", + React.createElement("small", { className: "text-muted" }, + "for ", + alert.cdc_id)), + React.createElement("small", null, + React.createElement("i", { className: (alert === null || alert === void 0 ? void 0 : alert.latest_error) ? "fas fa-exclamation-triangle text-danger" : (alert === null || alert === void 0 ? void 0 : alert.latest_diff) ? "fas fa-circle text-primary" : null }))), + React.createElement("small", null, reviewStatus(alert)))))) : null), + React.createElement("div", { className: "col-9 overflow-auto" }, selectedAlert || creationMode ? + React.createElement(CDCAlertView, { alertData: alertData, setAlertData: setAlertData, onAlertChanged: onAlertChanged, setCreationMode: setCreationMode, selectedAlert: selectedAlert, creationMode: creationMode, cdcConfig: cdcConfig }) + : null))), React.createElement("div", { className: "modal-footer" }, - React.createElement(ErrorMessage, { error: syncError }), + syncError ? React.createElement(ErrorMessage, { error: new Error(`While synchronizing an error occured: ${syncError}`) }) : null, React.createElement("button", { type: "button", className: "btn btn-secondary", "data-bs-dismiss": "modal" }, "Close"), React.createElement("button", { type: "button", disabled: syncStatus === 'pending', title: "Sync alerts", className: "btn btn-secondary", onClick: () => doSync() }, "Sync"))))))); } diff --git a/dist/cdc/CDCFilterDialog.js.map b/dist/cdc/CDCFilterDialog.js.map index c6f9ec3f0..d5a910b0c 100644 --- a/dist/cdc/CDCFilterDialog.js.map +++ b/dist/cdc/CDCFilterDialog.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterDialog.js","sourceRoot":"","sources":["../../src/cd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AAC;qBACrF;oBACD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,CAAC;iBACpF;gBACD,yBAAyB,EAAE;oBACzB,OAAO,EAAE;wBACP,uBAAuB,CAAC,MAAM,EAAE,CAAC;wBACjC,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAC,CAAC;qBACzD;oBACD,UAAU,EAAE;wBACV,CAAC,mBAAmB,CAAC,EAAE,EAAC,SAAS,EAAE,iBAAiB,EAAC;wBACrD,CAAC,gBAAgB,CAAC,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAC,EAAC;qBACtF;oBACD,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;iBAClC;aACF,GACD,EACF,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCAlertView.d.ts b/dist/cdc/alert/CDCAlertView.d.ts index 437c59951..4b69777b4 100644 --- a/dist/cdc/alert/CDCAlertView.d.ts +++ b/dist/cdc/alert/CDCAlertView.d.ts @@ -1,10 +1,8 @@ /// -import { IAlert, IFilter, IUploadAlert, ICDCConfiguration } from '../interfaces'; +import { IAlert, IUploadAlert, ICDCConfiguration } from '../interfaces'; interface ICDCEditAlert { alertData: IUploadAlert; setAlertData: (formData: IUploadAlert) => void; - filter: IFilter; - setFilter: (filter: IFilter) => void; onAlertChanged: (id?: number) => void; selectedAlert?: IAlert; creationMode: boolean; @@ -13,5 +11,5 @@ interface ICDCEditAlert { [cdcId: string]: ICDCConfiguration; }; } -export declare function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }: ICDCEditAlert): JSX.Element; +export declare function CDCAlertView({ alertData, setAlertData, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }: ICDCEditAlert): JSX.Element; export {}; diff --git a/dist/cdc/alert/CDCAlertView.js b/dist/cdc/alert/CDCAlertView.js index 87a92bb42..632b5fc56 100644 --- a/dist/cdc/alert/CDCAlertView.js +++ b/dist/cdc/alert/CDCAlertView.js @@ -1,32 +1,32 @@ import React from 'react'; import Select from 'react-select'; -import { CDC_DEFAULT_FILTER, ErrorMessage, runAlert } from '..'; -import { useAsync } from '../../hooks'; +import { ErrorMessage, runAlert } from '..'; +import { useAsync, useSyncedRef } from '../../hooks'; import { deleteAlert, editAlert, saveAlert } from '../api'; import { CDCFilterCreator } from '../creator'; import { CDCDataChangeTable } from './CDCDataChangeTable'; -export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }) { - var _a; +export function CDCAlertView({ alertData, setAlertData, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig }) { + var _a, _b, _c, _d; const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); - const [filterSelection, setFilterSelection] = React.useState(); - const [compareColumns, setCompareColumns] = React.useState(); - const [filterComponents, setFilterComponents] = React.useState(); - const [validFilter, setValidFilter] = React.useState(); - const [validName, setValidName] = React.useState(); + const [validFilter, setValidFilter] = React.useState(true); + const [validName, setValidName] = React.useState(true); + const [validCompareColumns, setValidCompareColumns] = React.useState(true); + const alertDataRef = useSyncedRef(alertData); const { status: deleteStatus, error: deleteError, execute: doDelete } = useAsync(async () => { setEditMode(false); await deleteAlert(selectedAlert.id); onAlertChanged(); }, false); const { status: saveStatus, error: saveError, execute: doSave } = useAsync(async () => { - var _a; - const valFilter = (filter === null || filter === void 0 ? void 0 : filter.children.length) > 0; - const valName = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _a === void 0 ? void 0 : _a.trim().length) > 0; - if (valFilter && valName) { + var _a, _b, _c; + const valFilter = ((_a = alertData === null || alertData === void 0 ? void 0 : alertData.filter) === null || _a === void 0 ? void 0 : _a.children.length) > 0; + const valName = ((_b = alertData === null || alertData === void 0 ? void 0 : alertData.name) === null || _b === void 0 ? void 0 : _b.trim().length) > 0; + const valCompareColumns = ((_c = alertData === null || alertData === void 0 ? void 0 : alertData.compare_columns) === null || _c === void 0 ? void 0 : _c.length) > 0; + if (valFilter && valName && valCompareColumns) { let newAlert; if (selectedAlert) { - newAlert = await editAlert(selectedAlert.id, { ...alertData, filter }) + newAlert = await editAlert(selectedAlert.id, { ...alertData }) .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; @@ -35,7 +35,7 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle setEditMode(false); } else { - newAlert = await saveAlert({ ...alertData, filter }) + newAlert = await saveAlert({ ...alertData }) .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; @@ -47,29 +47,24 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle } setValidFilter(valFilter); setValidName(valName); + setValidCompareColumns(valCompareColumns); }, false); // TODO: CDCs are more complex than just filters, i.e. they also have fields. const cdcs = Object.keys(cdcConfig); + const filterSelection = (_a = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _a === void 0 ? void 0 : _a.filters; + const compareColumns = (_b = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _b === void 0 ? void 0 : _b.compareColumns; + const filterComponents = (_c = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _c === void 0 ? void 0 : _c.components; React.useEffect(() => { - var _a, _b, _c; - setFilterSelection((_a = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _a === void 0 ? void 0 : _a.filters); - setCompareColumns((_b = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _b === void 0 ? void 0 : _b.compareColumns); - setFilterComponents((_c = cdcConfig[alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]) === null || _c === void 0 ? void 0 : _c.components); - }, [alertData === null || alertData === void 0 ? void 0 : alertData.cdc_id]); - React.useEffect(() => { - setEditMode(false); - setDeleteMode(false); + if (selectedAlert) { + setEditMode(false); + setDeleteMode(false); + } }, [selectedAlert]); const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); - setFilter(selectedAlert.filter); - }; - const onCDCChanged = (e) => { - setAlertData({ ...alertData, cdc_id: e.value, compare_columns: null }); - setFilter(CDC_DEFAULT_FILTER); }; - const editButton = !editMode && !deleteMode && !creationMode ? (React.createElement(React.Fragment, null, + const editButton = saveStatus === 'pending' || deleteStatus === 'pending' ? (React.createElement("i", { className: "fas fa-spinner fa-spin" })) : !editMode && !deleteMode && !creationMode ? (React.createElement(React.Fragment, null, React.createElement("button", { title: "Edit Alert", className: "btn btn-text-secondary", onClick: () => setEditMode(true) }, React.createElement("i", { className: "fas fa-pencil-alt" })), React.createElement("button", { title: "Delete Alert", className: "btn btn-text-secondary", onClick: () => setDeleteMode(true) }, @@ -84,13 +79,19 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle React.createElement("i", { className: "fas fa-times" })))); return (React.createElement(React.Fragment, null, React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement(ErrorMessage, { error: deleteError || saveError }), React.createElement("small", null, editButton)), + (selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.latest_error) ? + React.createElement(ErrorMessage, { error: new Error(`In the sync from ${new Date(selectedAlert.latest_error_date)} an error occured: ${selectedAlert.latest_error}`) }) + : deleteError ? + React.createElement(ErrorMessage, { error: new Error(`While deleting an error occured: ${deleteError}`) }) + : saveError ? + React.createElement(ErrorMessage, { error: new Error(`While saving an error occured: ${saveError}`) }) + : null, React.createElement("div", { className: "accordion", id: "editAlert" }, !editMode && !creationMode ? React.createElement("div", { key: "one", className: "accordion-item" }, React.createElement("h2", { className: "accordion-header", id: "heading-one" }, - React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_a = new Date(selectedAlert.latest_compare_date)) === null || _a === void 0 ? void 0 : _a.toLocaleDateString()) : 'No new data'}`)), + React.createElement("button", { className: "accordion-button", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse-one", "aria-expanded": "true", "aria-controls": "collapse-one" }, `${selectedAlert.latest_diff ? 'Latest revision from: ' + ((_d = new Date(selectedAlert.latest_compare_date)) === null || _d === void 0 ? void 0 : _d.toLocaleDateString()) : 'No new data'}`)), React.createElement("div", { id: "collapse-one", className: "accordion-collapse collapse show", "aria-labelledby": "heading-one", "data-bs-parent": "#editAlert" }, React.createElement(CDCDataChangeTable, { selectedAlert: selectedAlert, onAlertChanged: onAlertChanged }))) : null, @@ -105,24 +106,30 @@ export function CDCAlertView({ alertData, setAlertData, filter, setFilter, onAle React.createElement("h6", null, alertData.name) : React.createElement(React.Fragment, null, - React.createElement("input", { type: "text", className: `form-control${validName !== false ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }), required: true }), - validName !== false ? null : + React.createElement("input", { type: "text", className: `form-control${validName ? '' : ' is-invalid'}`, value: alertData.name, onChange: (e) => setAlertData({ ...alertData, name: e.target.value }), required: true }), + validName ? null : React.createElement("div", { className: "invalid-feedback" }, "Name must not be empty!"))), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "CDC"), - React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => ({ label: c, value: c })), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => onCDCChanged(e) })), + React.createElement(Select, { isDisabled: !creationMode && !editMode, options: cdcs.map((c) => ({ label: c, value: c })), value: { label: alertData.cdc_id, value: alertData.cdc_id }, onChange: (e) => setAlertData({ ...alertData, cdc_id: e.value, compare_columns: null }) })), React.createElement("div", { className: "mb-3 col pe-2" }, React.createElement("label", { className: "form-label" }, "Change Fields"), - React.createElement(Select, { isMulti: true, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumns === null || compareColumns === void 0 ? void 0 : compareColumns.map((c) => ({ label: c, value: c })), + React.createElement(Select, { isMulti: true, className: `${validCompareColumns ? '' : 'form-control is-invalid'}`, isDisabled: !creationMode && !editMode, closeMenuOnSelect: false, options: compareColumns === null || compareColumns === void 0 ? void 0 : compareColumns.map((c) => ({ label: c, value: c })), //check for compare_columns because otherwise it would not reset the selection after the cdc_id was changed - value: alertData.compare_columns ? alertData.compare_columns.map((c) => ({ label: c, value: c })) : null, onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) })), + value: alertData.compare_columns ? alertData.compare_columns.map((c) => ({ label: c, value: c })) : null, onChange: (e) => setAlertData({ ...alertData, compare_columns: e.map((col) => col.value) }) }), + validCompareColumns ? null : + React.createElement("div", { className: "invalid-feedback" }, "Change fields must not be empty!")), React.createElement("div", { className: "mb-3 col" }, React.createElement("label", { className: "form-label" }, "Email notification"), React.createElement("div", { className: "form-check" }, React.createElement("input", { className: "form-check-input", type: "checkbox", disabled: !creationMode && !editMode, checked: alertData.enable_mail_notification, onChange: (e) => setAlertData({ ...alertData, enable_mail_notification: e.target.checked }) }), React.createElement("label", { className: "form-check-label ms-2" }, "Send me an email")))), - React.createElement("div", null, filterSelection || !filter ? - React.createElement(CDCFilterCreator, { filterSelection: !creationMode && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: filter, setFilter: setFilter, isInvalid: validFilter === false }) + React.createElement("div", null, filterSelection && (alertData === null || alertData === void 0 ? void 0 : alertData.filter) ? + React.createElement(CDCFilterCreator, { filterSelection: !creationMode && !editMode ? null : filterSelection, filterComponents: filterComponents, filter: alertData.filter, setFilter: (v) => { + console.log("TEST123", alertData); + const current = alertDataRef.current; + setAlertData({ ...current, filter: v(current.filter) }); + }, isInvalid: !validFilter }) : React.createElement("p", null, "No filters available for this cdc"))))))); } diff --git a/dist/cdc/alert/CDCAlertView.js.map b/dist/cdc/alert/CDCAlertView.js.map index 32ae2701b..e4c0d8799 100644 --- a/dist/cdc/alert/CDCAlertView.js.map +++ b/dist/cdc/alert/CDCAlertView.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCAlertView.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCAlertView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAoB,QAAQ,EAAC,MAAM,IAAI,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAcxD,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAgB;;IAC/J,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IACnE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAa,CAAC;IAC1E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAY,CAAC;IACvE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAA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AI,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAC,GAAG,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAC,CAAC,GAAI;gCACpO,+BAAO,SAAS,EAAC,uBAAuB,uBAAyB,CAC7D,CACF,CACF;oBACN,iCACG,eAAe,KAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CAAA,CAAC,CAAC;wBACrC,oBAAC,gBAAgB,IAAC,eAAe,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gCACrK,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gCAClC,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;gCACrC,YAAY,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC;4BACxD,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,GAAI;wBAC9B,CAAC;4BACD,mEAAwC,CACtC,CACF,CACF,CACF,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/alert/CDCDataChangeTable.d.ts b/dist/cdc/alert/CDCDataChangeTable.d.ts index 16bd6f8a3..770a6081a 100644 --- a/dist/cdc/alert/CDCDataChangeTable.d.ts +++ b/dist/cdc/alert/CDCDataChangeTable.d.ts @@ -1,5 +1,5 @@ /// -import { IAlert } from "../interfaces"; +import { IAlert } from '../interfaces'; interface ICDCDataChangeTable { selectedAlert: IAlert; onAlertChanged: (id?: number) => void; diff --git a/dist/cdc/alert/CDCDataChangeTable.js b/dist/cdc/alert/CDCDataChangeTable.js index 99a3c2e2e..f3f4ee39e 100644 --- a/dist/cdc/alert/CDCDataChangeTable.js +++ b/dist/cdc/alert/CDCDataChangeTable.js @@ -1,8 +1,8 @@ -import { get } from "lodash"; -import React, { useEffect } from "react"; -import { useAsync } from "../../hooks"; -import { confirmAlertById } from "../api"; -import { ErrorMessage } from "../common/ErrorMessage"; +import { get } from 'lodash'; +import React, { useEffect } from 'react'; +import { useAsync } from '../../hooks'; +import { confirmAlertById } from '../api'; +import { ErrorMessage } from '../common/ErrorMessage'; export function CDCDataChangeTable({ selectedAlert, onAlertChanged }) { var _a, _b, _c, _d; const [dataChange, setDataChange] = React.useState(new Map()); @@ -29,51 +29,53 @@ export function CDCDataChangeTable({ selectedAlert, onAlertChanged }) { const alert = await confirmAlertById(selectedAlert.id); onAlertChanged(alert.id); }, false); - return (React.createElement(React.Fragment, null, selectedAlert.latest_diff || selectedAlert.confirmed_data ? (React.createElement(React.Fragment, null, - React.createElement("table", { className: "table mb-0" }, - React.createElement("thead", null, - React.createElement("tr", null, - React.createElement("th", { scope: "col" }, "ID"), - selectedAlert.compare_columns.map((field, i) => React.createElement("th", { key: field, scope: "col" }, field)), - React.createElement("th", { scope: "col" }, "Status"))), - React.createElement("tbody", { style: { maxHeight: 600, overflow: 'auto' } }, - selectedAlert.latest_diff ? React.createElement(React.Fragment, null, (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : - _b.map((d) => { - const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); - return (React.createElement("tr", { key: d, className: "table-success" }, - React.createElement("td", { scope: "row" }, data._cdc_compare_id), - selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), - React.createElement("td", null, "Added"))); - }), (_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : - _d.map((d) => { - const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); - return (React.createElement("tr", { key: d, className: "table-danger" }, - React.createElement("td", { scope: "row" }, data._cdc_compare_id), - selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), - React.createElement("td", null, "Removed"))); - })) : null, - selectedAlert.confirmed_data ? React.createElement(React.Fragment, null, selectedAlert.confirmed_data - // Only show entries which are not already shown above - .filter((item) => { var _a, _b, _c, _d; return !((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(item._cdc_compare_id)) && !((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(item._cdc_compare_id)); }) - // Sort such that rows with changes are on top - .sort((a, b) => (dataChange.has(b._cdc_compare_id) ? 1 : 0) - (dataChange.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { - var _a, _b, _c, _d; - const id = d._cdc_compare_id; - const hasChanged = dataChange.has(id); - // TODO: All these .find() and .includes() should be refactored as they are O(n). - const isAlreadyHandled = ((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(id)) || ((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(id)); - return (isAlreadyHandled ? null : - React.createElement("tr", { key: id, className: `${hasChanged ? 'table-primary' : ''}` }, - React.createElement("td", { scope: "row" }, d._cdc_compare_id), - selectedAlert.compare_columns.map((field) => (React.createElement(React.Fragment, { key: field }, hasChanged ? (dataChange.get(id).has(field) ? (React.createElement("td", null, - React.createElement("s", null, dataChange.get(id).get(field).old), - " ", - dataChange.get(id).get(field).new)) : (React.createElement("td", null, get(d, field)))) : (React.createElement("td", { key: field }, get(d, field)))))), - React.createElement("td", null, hasChanged ? React.createElement(React.Fragment, null, "Changed") : null))); - })) : null)), - selectedAlert.latest_diff ? React.createElement("div", { className: "p-1" }, - React.createElement(ErrorMessage, { error: confirmError }), - React.createElement("div", { className: "d-md-flex justify-content-md-end" }, - React.createElement("button", { disabled: confirmStatus === 'pending', title: "Confirm changes", className: "btn btn-primary", onClick: () => doConfirm() }, "Confirm"))) : null)) : React.createElement("p", null, "No new data available"))); + return (React.createElement(React.Fragment, null, confirmStatus === 'pending' ? + React.createElement("i", { className: "fas fa-spinner fa-spin" }) + : React.createElement(React.Fragment, null, selectedAlert.latest_diff || selectedAlert.confirmed_data ? (React.createElement(React.Fragment, null, + React.createElement("table", { className: "table mb-0" }, + React.createElement("thead", null, + React.createElement("tr", null, + React.createElement("th", { scope: "col" }, "ID"), + selectedAlert.compare_columns.map((field, i) => React.createElement("th", { key: field, scope: "col" }, field)), + React.createElement("th", { scope: "col" }, "Status"))), + React.createElement("tbody", { style: { maxHeight: 600, overflow: 'auto' } }, + selectedAlert.latest_diff ? React.createElement(React.Fragment, null, (_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : + _b.map((d) => { + const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); + return (React.createElement("tr", { key: d, className: "table-success" }, + React.createElement("td", { scope: "row" }, data._cdc_compare_id), + selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), + React.createElement("td", null, "Added"))); + }), (_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : + _d.map((d) => { + const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); + return (React.createElement("tr", { key: d, className: "table-danger" }, + React.createElement("td", { scope: "row" }, data._cdc_compare_id), + selectedAlert.compare_columns.map((field, i) => React.createElement("td", { key: field }, get(data, field))), + React.createElement("td", null, "Removed"))); + })) : null, + selectedAlert.confirmed_data ? React.createElement(React.Fragment, null, selectedAlert.confirmed_data + // Only show entries which are not already shown above + .filter((item) => { var _a, _b, _c, _d; return !((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(item._cdc_compare_id)) && !((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(item._cdc_compare_id)); }) + // Sort such that rows with changes are on top + .sort((a, b) => (dataChange.has(b._cdc_compare_id) ? 1 : 0) - (dataChange.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { + var _a, _b, _c, _d; + const id = d._cdc_compare_id; + const hasChanged = dataChange.has(id); + // TODO: All these .find() and .includes() should be refactored as they are O(n). + const isAlreadyHandled = ((_b = (_a = selectedAlert.latest_diff) === null || _a === void 0 ? void 0 : _a.dictionary_item_added) === null || _b === void 0 ? void 0 : _b.includes(id)) || ((_d = (_c = selectedAlert.latest_diff) === null || _c === void 0 ? void 0 : _c.dictionary_item_removed) === null || _d === void 0 ? void 0 : _d.includes(id)); + return (isAlreadyHandled ? null : + React.createElement("tr", { key: id, className: `${hasChanged ? 'table-primary' : ''}` }, + React.createElement("td", { scope: "row" }, d._cdc_compare_id), + selectedAlert.compare_columns.map((field) => (React.createElement(React.Fragment, { key: field }, hasChanged ? (dataChange.get(id).has(field) ? (React.createElement("td", null, + React.createElement("s", null, dataChange.get(id).get(field).old), + " ", + dataChange.get(id).get(field).new)) : (React.createElement("td", null, get(d, field)))) : (React.createElement("td", { key: field }, get(d, field)))))), + React.createElement("td", null, hasChanged ? React.createElement(React.Fragment, null, "Changed") : null))); + })) : null)), + selectedAlert.latest_diff ? React.createElement("div", { className: "p-1" }, + confirmError ? React.createElement(ErrorMessage, { error: new Error(`While confirming an error occured: ${confirmError}`) }) : null, + React.createElement("div", { className: "d-md-flex justify-content-md-end" }, + React.createElement("button", { title: "Confirm changes", className: "btn btn-primary", onClick: () => doConfirm() }, "Confirm"))) : null)) : React.createElement("p", { className: "m-3" }, "No new data available")))); } //# sourceMappingURL=CDCDataChangeTable.js.map \ No newline at end of file diff --git a/dist/cdc/alert/CDCDataChangeTable.js.map b/dist/cdc/alert/CDCDataChangeTable.js.map index 3de30edeb..04bfc6a1c 100644 --- a/dist/cdc/alert/CDCDataChangeTable.js.map +++ b/dist/cdc/alert/CDCDataChangeTable.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCDataChangeTable.js","sourceRoot":"","sources":["../../../src/cdc/alert/CDCDataChangeTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAQpD,MAAM,UAAU,kBAAkB,CAAC,EAAC,aAAa,EAAE,cAAc,EAAsB;;IACrF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAuD,IAAI,GAAG,EAAE,CAAC,CAAC;IAEpH,SAAS,CAAC,GAAG,EAAE;;QACb,UAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,0CAAE,cAAc,EAAE;YAC9C,MAAM,MAAM,GAAyD,IAAI,GAAG,EAAE,CAAC;YAC/E,YAAA,aAAa,CAAC,WAAW,0CAAE,cAAc,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACnD,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACpD,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAA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EAAE,cAAkB,CACpG,CACF,CAAC,CAAC,CAAC,IAAI,CACZ,CAAC,CAAC,CAAC,CAAC,2BAAG,SAAS,EAAC,KAAK,4BAA0B,CAClD,CACJ,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/common/ErrorMessage.js b/dist/cdc/common/ErrorMessage.js index ad131c13a..670eabc3f 100644 --- a/dist/cdc/common/ErrorMessage.js +++ b/dist/cdc/common/ErrorMessage.js @@ -1,7 +1,7 @@ import * as React from 'react'; export function ErrorMessage({ error, onRetry }) { return error ? (React.createElement("div", { className: "alert alert-danger flex-fill d-flex align-items-center", role: "alert" }, - React.createElement("i", { className: "fas fa-fw fa-exclamation" }), + React.createElement("i", { className: "fas fa-exclamation-triangle text-danger me-1" }), React.createElement("div", { className: "flex-fill" }, error.toString()), onRetry ? (React.createElement("button", { type: "button", className: "btn btn-sm btn-outline-danger", onClick: onRetry }, "Retry")) : null)) : null; } diff --git a/dist/cdc/common/ErrorMessage.js.map b/dist/cdc/common/ErrorMessage.js.map index dc2789c24..9364b5784 100644 --- a/dist/cdc/common/ErrorMessage.js.map +++ b/dist/cdc/common/ErrorMessage.js.map @@ -1 +1 @@ -{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../../src/cdc/common/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,YAAY,CAAC,EAAC,KAAK,EAAE,OAAO,EAA8C;IACzF,OAAO,KAAK,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAC,wDAAwD,EAAC,IAAI,EAAC,OAAO;QACnF,2BAAG,SAAS,EAAC,0BAA0B,GAAG;QAC1C,6BAAK,SAAS,EAAC,WAAW,IAAE,KAAK,CAAC,QAAQ,EAAE,CAAO;QAClD,OAAO,CAAC,CAAC,CAAC,CACV,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,+BAA+B,EAAC,OAAO,EAAE,OAAO,YAEvE,CACT,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC"} \ No newline at end of file +{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../../src/cdc/common/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,YAAY,CAAC,EAAC,KAAK,EAAE,OAAO,EAA8C;IACxF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAC,wDAAwD,EAAC,IAAI,EAAC,OAAO;QAClF,2BAAG,SAAS,EAAC,8CAA8C,GAAE;QAC7D,6BAAK,SAAS,EAAC,WAAW,IAAE,KAAK,CAAC,QAAQ,EAAE,CAAO;QAClD,OAAO,CAAC,CAAC,CAAC,CACT,gCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,+BAA+B,EAAC,OAAO,EAAE,OAAO,YAEvE,CACV,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCard.js b/dist/cdc/creator/CDCFilterCard.js index bb62e6ec0..f18436a16 100644 --- a/dist/cdc/creator/CDCFilterCard.js +++ b/dist/cdc/creator/CDCFilterCard.js @@ -11,7 +11,7 @@ export function FilterCard({ filter, onDrop, onDelete, onChange, onValueChanged, isDragging: !!monitor.isDragging(), draggedItem: monitor.getItem() }) - })); + }), [filter, onDrop, onDelete, onChange, onValueChanged, onFieldChanged, filterComponents]); const hasChildren = filter.children && filter.children.length >= 0; const filterComponent = filterComponents[filter.type]; if (!filterComponent) { diff --git a/dist/cdc/creator/CDCFilterCard.js.map b/dist/cdc/creator/CDCFilterCard.js.map index 26387fd43..5f1e33f7c 100644 --- a/dist/cdc/creator/CDCFilterCard.js.map +++ b/dist/cdc/creator/CDCFilterCard.js.map @@ -1 +1 @@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AAG,CAAC,EAAC,GAC7C,CACH,CAAC,CAAC,CAAC,IAAI,QACP,MAAM,CAAC,QAAQ;mBAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC,CAC/C,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,EAAE;oBAC3B,oBAAC,UAAU,IACT,GAAG,EAAE,KAAK,CAAC,EAAE,EACb,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B;oBACD,MAAM,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CACzC,oBAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GAAG,CAAC,EACZ,OAAO,EACL,WAAW,KAAK,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,IAAI,CAAC,aAAa,GAE/E,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF;QACL,SAAS,CAAC,CAAC;YACV,6BAAK,SAAS,EAAC,uBAAuB,gCAEhC,CAAC,CAAC;YACR,IAAI,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file +{"version":3,"file":"CDCFilterCard.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA4B,SAAS,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAgBpC,MAAM,UAAU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,EAAE,KAAK,CAAC,EAAE;oBAC3B,oBAAC,UAAU,IACT,GAAG,EAAE,KAAK,CAAC,EAAE,EACb,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B;oBACD,MAAM,IAAI,WAAW,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CACzC,oBAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GAAG,CAAC,EACZ,OAAO,EACL,WAAW,KAAK,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,KAAK,KAAK,IAAI,CAAC,aAAa,GAE/E,CACH,CAAC,CAAC,CAAC,IAAI,CACO,CAClB,EACG,CACF;QACL,SAAS,CAAC,CAAC;YACV,6BAAK,SAAS,EAAC,uBAAuB,gCAEhC,CAAC,CAAC;YACR,IAAI,CACL,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/dist/cdc/creator/CDCFilterCreator.d.ts b/dist/cdc/creator/CDCFilterCreator.d.ts index fad02cb29..61047363f 100644 --- a/dist/cdc/creator/CDCFilterCreator.d.ts +++ b/dist/cdc/creator/CDCFilterCreator.d.ts @@ -1,4 +1,4 @@ -import React from 'react'; +/// import { IFilter, IFilterComponent } from '../interfaces'; interface ICDCFilterCreatorProps { filterComponents?: { @@ -9,7 +9,7 @@ interface ICDCFilterCreatorProps { }; filterSelection?: IFilter[]; filter: IFilter; - setFilter: React.Dispatch>; + setFilter: (value: IFilter) => void; disableFilter?: boolean; isInvalid?: boolean; } diff --git a/dist/cdc/creator/CDCFilterCreator.js b/dist/cdc/creator/CDCFilterCreator.js index 624d8f64f..8823095a1 100644 --- a/dist/cdc/creator/CDCFilterCreator.js +++ b/dist/cdc/creator/CDCFilterCreator.js @@ -7,7 +7,7 @@ import { getFilterFromTree } from '../interfaces'; import { v4 as uuidv4 } from 'uuid'; export function CDCFilterCreator({ filterSelection, filter, setFilter, disableFilter, isInvalid, filterComponents }) { const onDelete = (newFilter) => { - setFilter((filter) => produce(filter, (nextFilter) => { + setFilter(produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); if (current && parent && parent.children) { // Find the index of the current element in the parents children @@ -20,8 +20,12 @@ export function CDCFilterCreator({ filterSelection, filter, setFilter, disableFi })); }; const onDrop = (item, { target, index }) => { + console.log("filter", filter); + console.log("item", item); + console.log("target", target); + console.log("index", index); // Add item to target children array - setFilter((filter) => produce(filter, (nextFilter) => { + setFilter(produce(filter, (nextFilter) => { // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilter, // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES // ARE NOT UP-TO-DATE! @@ -58,7 +62,7 @@ export function CDCFilterCreator({ filterSelection, filter, setFilter, disableFi })); }; const onChange = (newFilter, changeFunc) => { - setFilter((filter) => produce(filter, (nextFilter) => { + setFilter(produce(filter, (nextFilter) => { const { current, parent } = getFilterFromTree(nextFilter, newFilter.id); if (current) { changeFunc(current); diff --git a/dist/cdc/creator/CDCFilterCreator.js.map b/dist/cdc/creator/CDCFilterCreator.js.map index 83daf25b5..0dd37917e 100644 --- a/dist/cdc/creator/CDCFilterCreator.js.map +++ b/dist/cdc/creator/CDCFilterCreator.js.map @@ -1 +1 @@ -{"version":3,"file":"CDCFilterCreator.js","sourceRoot":"","sources":["../../../src/cdc/creator/CDCFilterCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,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G,KAAK,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAG,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAC1B,MAAM,KAAK,CAAC,+CAA+C,CAAC,CAAC;KAC9D;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;QAChC,6BAAK,SAAS,EAAC,KAAK;YAClB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,+CAAqB;gBACrB,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,GACrB,CACE;YACL,eAAe,CAAC,CAAC;gBAChB,6BAAK,SAAS,EAAC,QAAQ;oBACrB,8CAAoB;oBACnB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1B,oBAAC,UAAU,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,GAAI,CACvG,CAAC,CACE;gBACN,CAAC,CAAC,IAAI,CACJ,CACM,CACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/dist/cdc/interfaces.d.ts b/dist/cdc/interfaces.d.ts index b20ad5bc6..c54beed3a 100644 --- a/dist/cdc/interfaces.d.ts +++ b/dist/cdc/interfaces.d.ts @@ -1,5 +1,5 @@ /// -import { ISecureItem } from "phovea_core"; +import { ISecureItem } from 'phovea_core'; export interface IFilterComponent { clazz: (props: { value: V; diff --git a/src/cdc/CDCFilterDialog.tsx b/src/cdc/CDCFilterDialog.tsx index 3a45da153..4bcb4f3cc 100644 --- a/src/cdc/CDCFilterDialog.tsx +++ b/src/cdc/CDCFilterDialog.tsx @@ -14,8 +14,7 @@ interface ICDCFilterDialogProps { cdcConfig: {[cdcId: string]: ICDCConfiguration}; } -export const CDC_DEFAULT_ALERT_DATA: IUploadAlert = {name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: null, compare_columns: null}; -export const CDC_DEFAULT_FILTER = {...createCDCGroupingFilter(uuidv4())}; +export const CDC_DEFAULT_ALERT_DATA: () => IUploadAlert = () => ({name: '', enable_mail_notification: false, cdc_id: 'JSONPlaceholderUserCDC', filter: createCDCGroupingFilter(uuidv4()), compare_columns: null}); export const runAlert = async (id: number): Promise => { return runAlertById(id).then((alert) => {return alert;}).catch((e) => { @@ -25,51 +24,45 @@ export const runAlert = async (id: number): Promise => { }; export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) { - const [selectedAlert, setSelectedAlert] = React.useState(); + const [selectedAlert, setSelectedAlert] = React.useState(null); const [showDialog, setShowDialog] = React.useState(false); const [creationMode, setCreationMode] = React.useState(false); - const [filter, setFilter] = React.useState(); - const [alertData, setAlertData] = React.useState(); + const [alertData, setAlertData] = React.useState(null); + + const onAlertChanged = async (id?: number) => { + //refetches alerts and makes new selection + fetchAlerts().then((alerts) => { + //if no id there is no need to iterate through alerts + if (!id) { + setSelectedAlert(null); + } else { + setSelectedAlert(alerts.find((alert) => alert.id === id)); + } + }); + }; + const {status: alertStatus, error: alertError, execute: fetchAlerts, value: alerts} = useAsync(getAlerts, true); + const {status: syncStatus, error: syncError, execute: doSync} = useAsync(async () => { - const result = await runAllAlerts() + const result = await runAllAlerts(); if (result.error?.length > 0) { - throw `Alert(s) [${result.error.join(',')}] could not be synchronized!`; + throw new Error(`Alert(s) [${result.error.join(',')}] could not be synchronized!`); } onAlertChanged(selectedAlert?.id); }, false); - React.useEffect(() => { - setAlertData(CDC_DEFAULT_ALERT_DATA); - setFilter(CDC_DEFAULT_FILTER); - }, []); - const onCreateButtonClick = () => { setCreationMode(true); setSelectedAlert(null); - setAlertData(CDC_DEFAULT_ALERT_DATA); - setFilter(CDC_DEFAULT_FILTER); + setAlertData(CDC_DEFAULT_ALERT_DATA()); }; const onAlertClick = async (alert: IAlert) => { setAlertData(alert); - setFilter(alert.filter); setCreationMode(false); setSelectedAlert(alert); }; - const onAlertChanged = async (id?: number) => { - //refetches alerts and makes new selection - fetchAlerts().then((alerts) => { - //if no id there is no need to iterate through alerts - if (!id) { - setSelectedAlert(null); - } else { - setSelectedAlert(alerts.find((alert) => alert.id === id)); - } - }).catch((e) => console.error(e)); - }; - const reviewStatus = (alert: IAlert) => { switch (true) { case (alert.latest_error != null): @@ -81,7 +74,7 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) { default: return 'No data revision yet'; } - } + }; return <> setShowDialog(true)}> Alert Filter @@ -94,44 +87,44 @@ export function CDCFilterDialog({cdcConfig}: ICDCFilterDialogProps) {
    -
    -
    -
    - + {syncStatus === 'pending' || alertStatus === 'pending' ? + + : +
    +
    +
    + +
    + {alertError ? fetchAlerts()} /> : null} + {alertStatus === 'success' ? : null} +
    +
    + {selectedAlert || creationMode ? + + : null + }
    - {alertStatus === 'pending' ? <>Loading... : null} - {alertStatus === 'error' ? <>Error {alertError.toString()} : null} - {alertStatus === 'success' ? : null} -
    -
    - {selectedAlert || creationMode ? - - : null - }
    -
    + }
    - + {syncError ? : null}
    @@ -149,8 +142,8 @@ export class CDCFilterDialogClass { this.node = document.createElement('div'); parent.appendChild(this.node); this.init(); - } + private init() { ReactDOM.render( void; - filter: IFilter; - setFilter: (filter: IFilter) => void; onAlertChanged: (id?: number) => void; selectedAlert?: IAlert; creationMode: boolean; @@ -19,14 +17,14 @@ interface ICDCEditAlert { cdcConfig: {[cdcId: string]: ICDCConfiguration}; } -export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig}: ICDCEditAlert) { +export function CDCAlertView({alertData, setAlertData, onAlertChanged, selectedAlert, setCreationMode, creationMode, cdcConfig}: ICDCEditAlert) { const [editMode, setEditMode] = React.useState(false); const [deleteMode, setDeleteMode] = React.useState(false); - const [filterSelection, setFilterSelection] = React.useState(); - const [compareColumns, setCompareColumns] = React.useState(); - const [filterComponents, setFilterComponents] = React.useState<{[key: string]: {component: IFilterComponent, config?: any}}>(); - const [validFilter, setValidFilter] = React.useState(); - const [validName, setValidName] = React.useState(); + const [validFilter, setValidFilter] = React.useState(true); + const [validName, setValidName] = React.useState(true); + const [validCompareColumns, setValidCompareColumns] = React.useState(true); + + const alertDataRef = useSyncedRef(alertData); const {status: deleteStatus, error: deleteError, execute: doDelete} = useAsync(async () => { setEditMode(false); @@ -35,12 +33,13 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler }, false); const {status: saveStatus, error: saveError, execute: doSave} = useAsync(async () => { - const valFilter = filter?.children.length > 0; + const valFilter = alertData?.filter?.children.length > 0; const valName = alertData?.name?.trim().length > 0; - if (valFilter && valName) { + const valCompareColumns = alertData?.compare_columns?.length > 0; + if (valFilter && valName && valCompareColumns) { let newAlert; if (selectedAlert) { - newAlert = await editAlert(selectedAlert.id, {...alertData, filter}) + newAlert = await editAlert(selectedAlert.id, {...alertData}) .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; @@ -48,7 +47,7 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler }); setEditMode(false); } else { - newAlert = await saveAlert({...alertData, filter}) + newAlert = await saveAlert({...alertData}) .then((alert) => { return runAlert(alert.id).then((a) => { return a ? a : alert; @@ -60,35 +59,32 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler } setValidFilter(valFilter); setValidName(valName); + setValidCompareColumns(valCompareColumns); }, false); // TODO: CDCs are more complex than just filters, i.e. they also have fields. const cdcs = Object.keys(cdcConfig); - React.useEffect(() => { - setFilterSelection(cdcConfig[alertData?.cdc_id]?.filters); - setCompareColumns(cdcConfig[alertData?.cdc_id]?.compareColumns); - setFilterComponents(cdcConfig[alertData?.cdc_id]?.components) - }, [alertData?.cdc_id]); + const filterSelection = cdcConfig[alertData?.cdc_id]?.filters; + const compareColumns = cdcConfig[alertData?.cdc_id]?.compareColumns; + const filterComponents = cdcConfig[alertData?.cdc_id]?.components; React.useEffect(() => { - setEditMode(false); - setDeleteMode(false); + if (selectedAlert) { + setEditMode(false); + setDeleteMode(false); + } }, [selectedAlert]); const onDiscard = () => { setEditMode(false); setAlertData(selectedAlert); - setFilter(selectedAlert.filter); }; - const onCDCChanged = (e) => { - setAlertData({...alertData, cdc_id: e.value, compare_columns: null}); - setFilter(CDC_DEFAULT_FILTER); - } - - const editButton = !editMode && !deleteMode && !creationMode ? (<> + const editButton = saveStatus === 'pending' || deleteStatus === 'pending' ? ( + + ) : !editMode && !deleteMode && !creationMode ? (<> ) : (editMode || creationMode ? <> @@ -101,9 +97,16 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler return (<>
    - {editButton}
    + {selectedAlert?.latest_error ? + + : deleteError ? + + : saveError ? + + : null + }
    {!editMode && !creationMode ?
    @@ -130,8 +133,8 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler {!creationMode && !editMode ?
    {alertData.name}
    : - <> setAlertData({...alertData, name: e.target.value})} required /> - {validName !== false ? null : + <> setAlertData({...alertData, name: e.target.value})} required /> + {validName ? null :
    Name must not be empty!
    } @@ -143,13 +146,14 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler isDisabled={!creationMode && !editMode} options={cdcs.map((c) => ({label: c, value: c}))} value={{label: alertData.cdc_id, value: alertData.cdc_id}} - onChange={(e) => onCDCChanged(e)} + onChange={(e) => setAlertData({...alertData, cdc_id: e.value, compare_columns: null})} />
    isMulti + className={`${validCompareColumns ? '' : 'form-control is-invalid'}`} isDisabled={!creationMode && !editMode} closeMenuOnSelect={false} options={compareColumns?.map((c) => ({label: c, value: c}))} @@ -157,6 +161,11 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler value={alertData.compare_columns ? alertData.compare_columns.map((c) => ({label: c, value: c})) : null} onChange={(e) => setAlertData({...alertData, compare_columns: e.map((col) => col.value)})} /> + {validCompareColumns ? null : +
    + Change fields must not be empty! +
    + }
    @@ -167,8 +176,12 @@ export function CDCAlertView({alertData, setAlertData, filter, setFilter, onAler
    - {filterSelection || !filter ? - + {filterSelection && alertData?.filter ? + { + console.log("TEST123", alertData); + const current = alertDataRef.current; + setAlertData({...current, filter: v(current.filter)}); + }} isInvalid={!validFilter} /> :

    No filters available for this cdc

    }
    diff --git a/src/cdc/alert/CDCDataChangeTable.tsx b/src/cdc/alert/CDCDataChangeTable.tsx index 952bc1608..4dd46da44 100644 --- a/src/cdc/alert/CDCDataChangeTable.tsx +++ b/src/cdc/alert/CDCDataChangeTable.tsx @@ -1,9 +1,9 @@ -import {get} from "lodash"; -import React, {useEffect} from "react"; -import {useAsync} from "../../hooks"; -import {confirmAlertById} from "../api"; -import {ErrorMessage} from "../common/ErrorMessage"; -import {IAlert} from "../interfaces"; +import {get} from 'lodash'; +import React, {useEffect} from 'react'; +import {useAsync} from '../../hooks'; +import {confirmAlertById} from '../api'; +import {ErrorMessage} from '../common/ErrorMessage'; +import {IAlert} from '../interfaces'; interface ICDCDataChangeTable { selectedAlert: IAlert; @@ -36,70 +36,74 @@ export function CDCDataChangeTable({selectedAlert, onAlertChanged}: ICDCDataChan }, false); return (<> - {selectedAlert.latest_diff || selectedAlert.confirmed_data ? (<> - - - - - {selectedAlert.compare_columns.map((field, i) => )} - - - - - {selectedAlert.latest_diff ? <> - {selectedAlert.latest_diff?.dictionary_item_added?.map((d) => { - const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); - return ( - - {selectedAlert.compare_columns.map((field, i) => )} - - ); - })} - {selectedAlert.latest_diff?.dictionary_item_removed?.map((d) => { - const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); - return ( - - {selectedAlert.compare_columns.map((field, i) => )} - - ); - })} - : null} - {selectedAlert.confirmed_data ? <> - {selectedAlert.confirmed_data - // Only show entries which are not already shown above - .filter((item) => !selectedAlert.latest_diff?.dictionary_item_added?.includes(item._cdc_compare_id) && !selectedAlert.latest_diff?.dictionary_item_removed?.includes(item._cdc_compare_id)) - // Sort such that rows with changes are on top - .sort((a, b) => (dataChange.has(b._cdc_compare_id) ? 1 : 0) - (dataChange.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { - const id = d._cdc_compare_id; - const hasChanged = dataChange.has(id); - // TODO: All these .find() and .includes() should be refactored as they are O(n). - const isAlreadyHandled = selectedAlert.latest_diff?.dictionary_item_added?.includes(id) || selectedAlert.latest_diff?.dictionary_item_removed?.includes(id); - return (isAlreadyHandled ? null : - - - {selectedAlert.compare_columns.map((field) => ( - - {hasChanged ? ( - dataChange.get(id).has(field) ? () : () - ) : ( - - )} - - ))} - - - ); - })} - : null} - -
    ID{field}Status
    {data._cdc_compare_id}{get(data, field)}Added
    {data._cdc_compare_id}{get(data, field)}Removed
    {d._cdc_compare_id}{dataChange.get(id).get(field).old} {dataChange.get(id).get(field).new}{get(d, field)}{get(d, field)}{hasChanged ? <>Changed : null}
    - {selectedAlert.latest_diff ?
    - -
    - -
    -
    : null} - ) :

    No new data available

    } + {confirmStatus === 'pending' ? + + : <> + {selectedAlert.latest_diff || selectedAlert.confirmed_data ? (<> + + + + + {selectedAlert.compare_columns.map((field, i) => )} + + + + + {selectedAlert.latest_diff ? <> + {selectedAlert.latest_diff?.dictionary_item_added?.map((d) => { + const data = selectedAlert.latest_fetched_data.find((a) => a._cdc_compare_id === d); + return ( + + {selectedAlert.compare_columns.map((field, i) => )} + + ); + })} + {selectedAlert.latest_diff?.dictionary_item_removed?.map((d) => { + const data = selectedAlert.confirmed_data.find((a) => a._cdc_compare_id === d); + return ( + + {selectedAlert.compare_columns.map((field, i) => )} + + ); + })} + : null} + {selectedAlert.confirmed_data ? <> + {selectedAlert.confirmed_data + // Only show entries which are not already shown above + .filter((item) => !selectedAlert.latest_diff?.dictionary_item_added?.includes(item._cdc_compare_id) && !selectedAlert.latest_diff?.dictionary_item_removed?.includes(item._cdc_compare_id)) + // Sort such that rows with changes are on top + .sort((a, b) => (dataChange.has(b._cdc_compare_id) ? 1 : 0) - (dataChange.has(a._cdc_compare_id) ? 1 : 0)).map((d) => { + const id = d._cdc_compare_id; + const hasChanged = dataChange.has(id); + // TODO: All these .find() and .includes() should be refactored as they are O(n). + const isAlreadyHandled = selectedAlert.latest_diff?.dictionary_item_added?.includes(id) || selectedAlert.latest_diff?.dictionary_item_removed?.includes(id); + return (isAlreadyHandled ? null : + + + {selectedAlert.compare_columns.map((field) => ( + + {hasChanged ? ( + dataChange.get(id).has(field) ? () : () + ) : ( + + )} + + ))} + + + ); + })} + : null} + +
    ID{field}Status
    {data._cdc_compare_id}{get(data, field)}Added
    {data._cdc_compare_id}{get(data, field)}Removed
    {d._cdc_compare_id}{dataChange.get(id).get(field).old} {dataChange.get(id).get(field).new}{get(d, field)}{get(d, field)}{hasChanged ? <>Changed : null}
    + {selectedAlert.latest_diff ?
    + {confirmError ? : null} +
    + +
    +
    : null} + ) :

    No new data available

    } + } ); } diff --git a/src/cdc/common/ErrorMessage.tsx b/src/cdc/common/ErrorMessage.tsx index f4c8b4f35..b0bd7dfc9 100644 --- a/src/cdc/common/ErrorMessage.tsx +++ b/src/cdc/common/ErrorMessage.tsx @@ -1,15 +1,15 @@ import * as React from 'react'; export function ErrorMessage({error, onRetry}: {error: Error | null; onRetry?: () => void}) { - return error ? ( -
    - -
    {error.toString()}
    - {onRetry ? ( - - ) : null} -
    - ) : null; + return error ? ( +
    + +
    {error.toString()}
    + {onRetry ? ( + + ) : null} +
    + ) : null; } diff --git a/src/cdc/common/index.ts b/src/cdc/common/index.ts index d4f9176e1..3dee9621e 100644 --- a/src/cdc/common/index.ts +++ b/src/cdc/common/index.ts @@ -1 +1 @@ -export * from './ErrorMessage'; \ No newline at end of file +export * from './ErrorMessage'; diff --git a/src/cdc/creator/CDCFilterCard.tsx b/src/cdc/creator/CDCFilterCard.tsx index a2c898a0d..76c83a78c 100644 --- a/src/cdc/creator/CDCFilterCard.tsx +++ b/src/cdc/creator/CDCFilterCard.tsx @@ -25,7 +25,7 @@ export function FilterCard({filter, onDrop, onDelete, onChange, onValueChanged, isDragging: !!monitor.isDragging(), draggedItem: (monitor.getItem() as unknown) as IFilter | undefined }) - })); + }), [filter, onDrop, onDelete, onChange, onValueChanged, onFieldChanged, filterComponents]); const hasChildren = filter.children && filter.children.length >= 0; const filterComponent = filterComponents[filter.type]; diff --git a/src/cdc/creator/CDCFilterCreator.tsx b/src/cdc/creator/CDCFilterCreator.tsx index 711c53c12..39dcc21a1 100644 --- a/src/cdc/creator/CDCFilterCreator.tsx +++ b/src/cdc/creator/CDCFilterCreator.tsx @@ -10,14 +10,15 @@ interface ICDCFilterCreatorProps { filterComponents?: {[key: string]: {component: IFilterComponent, config?: any}}; filterSelection?: IFilter[]; filter: IFilter; - setFilter: React.Dispatch>; + // setFilter: React.Dispatch>; + setFilter: (value: IFilter) => void; disableFilter?: boolean; isInvalid?: boolean; } export function CDCFilterCreator({filterSelection, filter, setFilter, disableFilter, isInvalid, filterComponents}: ICDCFilterCreatorProps) { const onDelete = (newFilter: IFilter) => { - setFilter((filter) => produce(filter, (nextFilter) => { + setFilter(produce(filter, (nextFilter) => { const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); if (current && parent && parent.children) { // Find the index of the current element in the parents children @@ -35,8 +36,12 @@ export function CDCFilterCreator({filterSelection, filter, setFilter, disableFil item: IFilter, {target, index}: {target: IFilter; index: number} ) => { + console.log("filter", filter) + console.log("item", item) + console.log("target", target) + console.log("index", index) // Add item to target children array - setFilter((filter) => produce(filter, (nextFilter) => { + setFilter(produce(filter, (nextFilter) => { // DANGER: BE SURE TO ONLY REFERENCE SOMETHING FROM nextFilter, // AND NOTHING FROM 'OUTSIDE' LIKE item, or target. THESE REFERENCES // ARE NOT UP-TO-DATE! @@ -76,7 +81,7 @@ export function CDCFilterCreator({filterSelection, filter, setFilter, disableFil }; const onChange = (newFilter: IFilter, changeFunc: (filter: IFilter) => void) => { - setFilter((filter) => produce(filter, (nextFilter) => { + setFilter(produce(filter, (nextFilter) => { const {current, parent} = getFilterFromTree(nextFilter, newFilter.id); if (current) { changeFunc(current); diff --git a/src/cdc/filter/CDCTextFilter.tsx b/src/cdc/filter/CDCTextFilter.tsx index 0e9982ecc..592589242 100644 --- a/src/cdc/filter/CDCTextFilter.tsx +++ b/src/cdc/filter/CDCTextFilter.tsx @@ -25,7 +25,7 @@ export function CDCTextFilterComponent({value, onValueChanged, onFieldChanged, d
    setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> - + setAlertData({...alertData, enable_mail_notification: e.target.checked})} /> +