From 910baa9fd76ae25376d14e3ce7bdbd0a055136e5 Mon Sep 17 00:00:00 2001 From: Rinat Arsaev <11846445+A77AY@users.noreply.github.com> Date: Fri, 21 Apr 2023 16:49:05 +0400 Subject: [PATCH] IMP-58: Move to Ng Core Lib (#214) --- .github/workflows/pr.yaml | 17 +- .vscode/settings.json | 24 --- .vscode/tasks.json | 41 ----- angular.json | 31 ---- package-lock.json | 155 +++++------------- package.json | 16 +- projects/ng-core/.prettierignore | 1 - projects/ng-core/README.md | 25 --- projects/ng-core/karma.conf.js | 41 ----- projects/ng-core/ng-package.json | 7 - projects/ng-core/package.json | 11 -- .../components/actions/actions.component.html | 10 -- .../components/actions/actions.component.scss | 14 -- .../components/actions/actions.component.ts | 9 - .../lib/components/actions/actions.module.ts | 11 -- .../src/lib/components/actions/index.ts | 2 - .../base-dialog/base-dialog.component.html | 32 ---- .../base-dialog/base-dialog.component.scss | 43 ----- .../base-dialog/base-dialog.component.ts | 32 ---- .../base-dialog/base-dialog.module.ts | 30 ---- .../base-dialog-actions.component.html | 1 - .../base-dialog-actions.component.ts | 7 - .../src/lib/components/base-dialog/index.ts | 8 - .../services/base-dialog.service.ts | 45 ----- .../src/lib/components/base-dialog/tokens.ts | 20 --- .../types/base-dialog-response-status.ts | 5 - .../base-dialog/types/base-dialog-response.ts | 7 - .../utils/base-dialog-superclass.ts | 43 ----- projects/ng-core/src/lib/components/index.ts | 2 - projects/ng-core/src/lib/index.ts | 3 - projects/ng-core/src/lib/pipes/index.ts | 2 - .../ng-core/src/lib/pipes/inline-json.pipe.ts | 12 -- .../ng-core/src/lib/pipes/pipes.module.ts | 11 -- projects/ng-core/src/lib/utils/clean.ts | 46 ------ .../src/lib/utils/compare-different-types.ts | 8 - projects/ng-core/src/lib/utils/index.ts | 5 - projects/ng-core/src/lib/utils/inline-json.ts | 32 ---- projects/ng-core/src/lib/utils/is-empty.ts | 7 - projects/ng-core/src/lib/utils/split-ids.ts | 9 - projects/ng-core/src/public-api.ts | 5 - projects/ng-core/src/test.ts | 12 -- projects/ng-core/tsconfig.lib.json | 21 --- projects/ng-core/tsconfig.lib.prod.json | 10 -- projects/ng-core/tsconfig.spec.json | 10 -- src/app/sections/claim/claim.component.ts | 12 +- src/app/sections/claim/claim.module.ts | 4 +- .../add-modification-dialog.component.html | 8 +- .../add-modification-dialog.component.ts | 14 +- .../change-status-dialog.component.html | 8 +- .../change-status-dialog.component.ts | 6 +- ...dification-unit-timeline-item.component.ts | 12 +- .../create-deposit-dialog.component.html | 8 +- .../create-deposit-dialog.module.ts | 4 +- .../domain-info/domain-info.component.html | 4 +- .../domain-info/domain-info.component.ts | 8 +- .../domain-obj-creation.component.html | 4 +- .../domain-obj-modification.component.html | 4 +- .../domain-obj-review.component.html | 4 +- .../create-chargeback-dialog.component.html | 8 +- .../create-chargeback-dialog.component.ts | 4 +- .../payment-details.component.html | 4 +- .../payment-details.component.ts | 8 +- .../payment-details/payment-details.module.ts | 4 +- .../cancel-payout-dialog.component.ts | 6 +- .../create-payout-dialog.component.html | 8 +- .../create-payout-dialog.component.ts | 6 +- .../payouts/payouts/payouts.component.html | 4 +- .../payouts/payouts/payouts.component.ts | 6 +- .../payouts/payouts/payouts.module.ts | 4 +- .../services/payout-actions.service.ts | 10 +- .../repair-by-scenario-dialog.component.html | 8 +- .../repair-by-scenario-dialog.component.ts | 6 +- .../sections/repairing/repairing.component.ts | 10 +- .../sections/repairing/repairing.module.ts | 4 +- ...nge-delegate-ruleset-dialog.component.html | 8 +- ...hange-delegate-ruleset-dialog.component.ts | 4 +- .../change-delegate-ruleset-dialog.module.ts | 4 +- .../change-target-dialog.component.html | 8 +- .../change-target-dialog.component.ts | 4 +- .../change-target-dialog.module.ts | 4 +- .../attach-new-ruleset-dialog.component.html | 8 +- .../attach-new-ruleset-dialog.component.ts | 4 +- .../party-delegate-rulesets.component.ts | 6 +- .../party-delegate-rulesets.module.ts | 4 +- ...d-party-routing-rule-dialog.component.html | 8 +- ...add-party-routing-rule-dialog.component.ts | 6 +- .../add-party-routing-rule-dialog.module.ts | 4 +- ...ialize-routing-rules-dialog.component.html | 8 +- ...itialize-routing-rules-dialog.component.ts | 4 +- .../initialize-routing-rules-dialog.module.ts | 4 +- .../party-routing-ruleset.component.ts | 10 +- .../routing-rules-list.component.ts | 16 +- .../add-routing-rule-dialog.component.html | 8 +- .../add-routing-rule-dialog.component.ts | 4 +- .../add-routing-rule-dialog.module.ts | 4 +- .../add-routing-rule-dialog.service.ts | 4 +- .../routing-ruleset.component.ts | 10 +- .../create-claim-dialog.component.html | 8 +- .../create-claim-dialog.component.ts | 4 +- .../search-claims.component.html | 4 +- .../search-claims/search-claims.component.ts | 6 +- .../search-claims/search-claims.module.ts | 4 +- .../shop-details/shop-details.component.html | 4 +- .../shop-details/shop-details.component.ts | 12 +- .../create-source.component.html | 8 +- .../create-source/create-source.component.ts | 4 +- .../sections/sources/sources.component.html | 4 +- src/app/sections/sources/sources.component.ts | 6 +- src/app/sections/sources/sources.module.ts | 4 +- .../create-adjustment-dialog.component.html | 8 +- .../create-adjustment-dialog.component.ts | 6 +- .../withdrawals/withdrawals.component.ts | 8 +- .../withdrawals/withdrawals.module.ts | 4 +- ...ge-chargeback-status-dialog.component.html | 8 +- ...ange-chargeback-status-dialog.component.ts | 6 +- .../chargebacks/chargebacks.component.ts | 8 +- .../details-dialog.component.html | 4 +- .../details-dialog.component.ts | 6 +- .../other-filters-dialog.component.html | 8 +- .../other-filters-dialog.component.ts | 8 +- .../other-filters-dialog.module.ts | 4 +- .../payments-other-search-filters.service.ts | 8 +- .../create-payment-adjustment.component.html | 8 +- .../create-payment-adjustment.component.ts | 4 +- .../payments-searcher.component.html | 4 +- .../payments-searcher.component.ts | 8 +- .../payments-searcher.module.ts | 4 +- .../thrift-editor/thrift-editor.component.ts | 8 +- .../confirm-action-dialog.component.html | 8 +- .../confirm-action-dialog.component.ts | 8 +- .../confirm-action-dialog.module.ts | 4 +- tsconfig.json | 3 +- 132 files changed, 322 insertions(+), 1118 deletions(-) delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/tasks.json delete mode 100644 projects/ng-core/.prettierignore delete mode 100644 projects/ng-core/README.md delete mode 100644 projects/ng-core/karma.conf.js delete mode 100644 projects/ng-core/ng-package.json delete mode 100644 projects/ng-core/package.json delete mode 100644 projects/ng-core/src/lib/components/actions/actions.component.html delete mode 100644 projects/ng-core/src/lib/components/actions/actions.component.scss delete mode 100644 projects/ng-core/src/lib/components/actions/actions.component.ts delete mode 100644 projects/ng-core/src/lib/components/actions/actions.module.ts delete mode 100644 projects/ng-core/src/lib/components/actions/index.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/base-dialog.component.html delete mode 100644 projects/ng-core/src/lib/components/base-dialog/base-dialog.component.scss delete mode 100644 projects/ng-core/src/lib/components/base-dialog/base-dialog.component.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/base-dialog.module.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.html delete mode 100644 projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/index.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/services/base-dialog.service.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/tokens.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response-status.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response.ts delete mode 100644 projects/ng-core/src/lib/components/base-dialog/utils/base-dialog-superclass.ts delete mode 100644 projects/ng-core/src/lib/components/index.ts delete mode 100644 projects/ng-core/src/lib/index.ts delete mode 100644 projects/ng-core/src/lib/pipes/index.ts delete mode 100644 projects/ng-core/src/lib/pipes/inline-json.pipe.ts delete mode 100644 projects/ng-core/src/lib/pipes/pipes.module.ts delete mode 100644 projects/ng-core/src/lib/utils/clean.ts delete mode 100644 projects/ng-core/src/lib/utils/compare-different-types.ts delete mode 100644 projects/ng-core/src/lib/utils/index.ts delete mode 100644 projects/ng-core/src/lib/utils/inline-json.ts delete mode 100644 projects/ng-core/src/lib/utils/is-empty.ts delete mode 100644 projects/ng-core/src/lib/utils/split-ids.ts delete mode 100644 projects/ng-core/src/public-api.ts delete mode 100644 projects/ng-core/src/test.ts delete mode 100644 projects/ng-core/tsconfig.lib.json delete mode 100644 projects/ng-core/tsconfig.lib.prod.json delete mode 100644 projects/ng-core/tsconfig.spec.json diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index de37fd09..0d5f2312 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -9,8 +9,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/init - - name: Building libraries - run: npm run build-libs - name: Cache all uses: actions/cache@v3 id: cache @@ -30,19 +28,6 @@ jobs: key: ${{ github.sha }} - name: Check run: npm run lint - eslint-libs: - name: ESLint Libs - runs-on: ubuntu-latest - needs: [init] - steps: - - name: Cache all - uses: actions/cache@v3 - id: cache - with: - path: ./* - key: ${{ github.sha }} - - name: Check - run: npm run lint-libs prettier: name: Prettier runs-on: ubuntu-latest @@ -68,4 +53,4 @@ jobs: path: ./* key: ${{ github.sha }} - name: Build - run: npm run build-app + run: npm run build diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 16c03681..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "workbench.colorCustomizations": { - "activityBar.activeBackground": "#ab307e", - "activityBar.activeBorder": "#25320e", - "activityBar.background": "#ab307e", - "activityBar.foreground": "#e7e7e7", - "activityBar.inactiveForeground": "#e7e7e799", - "activityBarBadge.background": "#25320e", - "activityBarBadge.foreground": "#e7e7e7", - "sash.hoverBorder": "#ab307e", - "statusBar.background": "#832561", - "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#ab307e", - "statusBarItem.remoteBackground": "#832561", - "statusBarItem.remoteForeground": "#e7e7e7", - "titleBar.activeBackground": "#832561", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveBackground": "#83256199", - "titleBar.inactiveForeground": "#e7e7e799", - "commandCenter.border": "#e7e7e799" - }, - "peacock.color": "#832561", - "tasksStatusbar.taskLabelFilter": "Start" -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 60c1c038..00000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "Libs", - "type": "shell", - "command": "npm run dev-libs", - "presentation": { - "group": "stage" - } - }, - { - "label": "Stage", - "type": "shell", - "command": "sleep 0.5 && npm run stage", - "presentation": { - "group": "stage" - } - }, - { - "label": "Dev", - "type": "shell", - "command": "sleep 0.5 && npm run dev", - "presentation": { - "group": "stage" - } - }, - { - "label": "Start stage & libs", - "dependsOn": ["Libs", "Stage"], - "problemMatcher": [] - }, - { - "label": "Start dev & libs", - "dependsOn": ["Libs", "Dev"], - "problemMatcher": [] - } - ] -} diff --git a/angular.json b/angular.json index 1dc5f1e1..b3742817 100644 --- a/angular.json +++ b/angular.json @@ -155,37 +155,6 @@ } } } - }, - "ng-core": { - "projectType": "library", - "root": "projects/ng-core", - "sourceRoot": "projects/ng-core/src", - "prefix": "v", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "project": "projects/ng-core/ng-package.json" - }, - "configurations": { - "production": { - "tsConfig": "projects/ng-core/tsconfig.lib.prod.json" - }, - "development": { - "tsConfig": "projects/ng-core/tsconfig.lib.json" - } - }, - "defaultConfiguration": "production" - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "projects/ng-core/src/test.ts", - "tsConfig": "projects/ng-core/tsconfig.spec.json", - "karmaConfig": "projects/ng-core/karma.conf.js" - } - } - } } }, "cli": { diff --git a/package-lock.json b/package-lock.json index a8657538..d2cc5f91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,12 +34,13 @@ "@vality/dominant-cache-proto": "2.0.1-99f38c9.0", "@vality/fistful-proto": "2.0.1-4ff4ea3.0", "@vality/magista-proto": "2.0.1-cf0eff8.0", + "@vality/ng-core": "0.3.1-pr-7-478c28d.0", "@vality/payout-manager-proto": "2.0.1-b079679.0", "@vality/repairer-proto": "2.0.1-8f7973d.0", "@vality/thrift-ts": "2.4.1-8ad5123.0", "@vality/woody": "0.1.1", "angular2-prettyjson": "3.0.1", - "coerce-property": "0.3.2", + "coerce-property": "15.0.1", "css-element-queries": "1.2.3", "element-resize-detector": "1.2.4", "humanize-duration": "3.21.0", @@ -76,7 +77,6 @@ "@types/uuid": "3.4.3", "@typescript-eslint/eslint-plugin": "5.46.1", "@typescript-eslint/parser": "5.46.1", - "concurrently": "7.3.0", "cross-env": "7.0.3", "dotenv": "16.0.0", "eslint": "8.29.0", @@ -5221,6 +5221,23 @@ "resolved": "https://registry.npmjs.org/@vality/magista-proto/-/magista-proto-2.0.1-cf0eff8.0.tgz", "integrity": "sha512-59ncaJpt7tXFLOq9KrDu4OgrDQr9vTQ3j30T0hjN+ZIsPBsE+lld/pGKASWLLQfwvTtvp9laAuKgQGX9GuvIiQ==" }, + "node_modules/@vality/ng-core": { + "version": "0.3.1-pr-7-478c28d.0", + "resolved": "https://registry.npmjs.org/@vality/ng-core/-/ng-core-0.3.1-pr-7-478c28d.0.tgz", + "integrity": "sha512-p5E6pw14mj7pwxmXX3AbYPdWYbMlPMiZklE1zDRFGoSSQMYLI7knUT4/ap1btgKXC2xdf7RARBcBdujg7ugWgA==", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/cdk": ">=15.0.0", + "@angular/common": ">=15.0.0", + "@angular/core": ">=15.0.0", + "@angular/material": ">=15.0.0", + "coerce-property": ">=0.3.2", + "lodash-es": "^4.0.0", + "utility-types": ">=3.0.0" + } + }, "node_modules/@vality/payout-manager-proto": { "version": "2.0.1-b079679.0", "resolved": "https://registry.npmjs.org/@vality/payout-manager-proto/-/payout-manager-proto-2.0.1-b079679.0.tgz", @@ -8191,10 +8208,16 @@ } }, "node_modules/coerce-property": { - "version": "0.3.2", - "license": "MIT", + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/coerce-property/-/coerce-property-15.0.1.tgz", + "integrity": "sha512-BFuCajc/anzod6ExgyfEm2jaAE0OhSHEIBsmFj0bB7rQIrhgBiLPxpo3XWi7AyE5VVlFsLpkgIEGrDIWzJWc1Q==", + "dependencies": { + "tslib": "^2.3.0" + }, "peerDependencies": { - "@angular/cdk": ">=7.3.0" + "@angular/cdk": ">=15.0.0", + "@angular/common": ">=15.0.0", + "@angular/core": ">=15.0.0" } }, "node_modules/collection-visit": { @@ -8314,50 +8337,6 @@ "typedarray": "^0.0.6" } }, - "node_modules/concurrently": { - "version": "7.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "date-fns": "^2.16.1", - "lodash": "^4.17.21", - "rxjs": "^7.0.0", - "shell-quote": "^1.7.3", - "spawn-command": "^0.0.2-1", - "supports-color": "^8.1.0", - "tree-kill": "^1.2.2", - "yargs": "^17.3.1" - }, - "bin": { - "concurrently": "dist/bin/concurrently.js" - }, - "engines": { - "node": "^12.20.0 || ^14.13.0 || >=16.0.0" - } - }, - "node_modules/concurrently/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/concurrently/node_modules/supports-color": { - "version": "8.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/connect": { "version": "3.7.0", "dev": true, @@ -8874,18 +8853,6 @@ "version": "1.0.1", "license": "MIT" }, - "node_modules/date-fns": { - "version": "2.29.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/date-format": { "version": "4.0.11", "dev": true, @@ -17090,11 +17057,6 @@ "node": ">=0.10.0" } }, - "node_modules/shell-quote": { - "version": "1.7.3", - "dev": true, - "license": "MIT" - }, "node_modules/short-uuid": { "version": "4.1.0", "license": "MIT", @@ -17483,11 +17445,6 @@ "dev": true, "license": "MIT" }, - "node_modules/spawn-command": { - "version": "0.0.2-1", - "dev": true, - "license": "MIT" - }, "node_modules/spdx-correct": { "version": "3.1.1", "dev": true, @@ -22975,6 +22932,14 @@ "resolved": "https://registry.npmjs.org/@vality/magista-proto/-/magista-proto-2.0.1-cf0eff8.0.tgz", "integrity": "sha512-59ncaJpt7tXFLOq9KrDu4OgrDQr9vTQ3j30T0hjN+ZIsPBsE+lld/pGKASWLLQfwvTtvp9laAuKgQGX9GuvIiQ==" }, + "@vality/ng-core": { + "version": "0.3.1-pr-7-478c28d.0", + "resolved": "https://registry.npmjs.org/@vality/ng-core/-/ng-core-0.3.1-pr-7-478c28d.0.tgz", + "integrity": "sha512-p5E6pw14mj7pwxmXX3AbYPdWYbMlPMiZklE1zDRFGoSSQMYLI7knUT4/ap1btgKXC2xdf7RARBcBdujg7ugWgA==", + "requires": { + "tslib": "^2.3.0" + } + }, "@vality/payout-manager-proto": { "version": "2.0.1-b079679.0", "resolved": "https://registry.npmjs.org/@vality/payout-manager-proto/-/payout-manager-proto-2.0.1-b079679.0.tgz", @@ -25094,8 +25059,12 @@ "version": "1.1.0" }, "coerce-property": { - "version": "0.3.2", - "requires": {} + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/coerce-property/-/coerce-property-15.0.1.tgz", + "integrity": "sha512-BFuCajc/anzod6ExgyfEm2jaAE0OhSHEIBsmFj0bB7rQIrhgBiLPxpo3XWi7AyE5VVlFsLpkgIEGrDIWzJWc1Q==", + "requires": { + "tslib": "^2.3.0" + } }, "collection-visit": { "version": "1.0.0", @@ -25177,34 +25146,6 @@ "typedarray": "^0.0.6" } }, - "concurrently": { - "version": "7.3.0", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "date-fns": "^2.16.1", - "lodash": "^4.17.21", - "rxjs": "^7.0.0", - "shell-quote": "^1.7.3", - "spawn-command": "^0.0.2-1", - "supports-color": "^8.1.0", - "tree-kill": "^1.2.2", - "yargs": "^17.3.1" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "dev": true - }, - "supports-color": { - "version": "8.1.1", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "connect": { "version": "3.7.0", "dev": true, @@ -25544,10 +25485,6 @@ "cyclist": { "version": "1.0.1" }, - "date-fns": { - "version": "2.29.1", - "dev": true - }, "date-format": { "version": "4.0.11", "dev": true @@ -30817,10 +30754,6 @@ "shebang-regex": { "version": "1.0.0" }, - "shell-quote": { - "version": "1.7.3", - "dev": true - }, "short-uuid": { "version": "4.1.0", "requires": { @@ -31082,10 +31015,6 @@ "version": "1.4.8", "dev": true }, - "spawn-command": { - "version": "0.0.2-1", - "dev": true - }, "spdx-correct": { "version": "3.1.1", "dev": true, diff --git a/package.json b/package.json index b8987015..77537ded 100644 --- a/package.json +++ b/package.json @@ -4,23 +4,17 @@ "private": true, "scripts": { "postinstall": "ngcc", - "start": "concurrently -n LIB,APP -c magenta,cyan npm:dev-libs \"sleep 0.5 && npm run dev\"", - "dev": "ng serve --proxy-config proxy.conf.js --port 4200", + "start": "ng serve --proxy-config proxy.conf.js --port 4200", "stage": "cross-env NODE_ENV=stage ng serve --proxy-config proxy.conf.js --port 4201 --configuration=stage", - "dev-libs": "ng build ng-core --watch", - "build-app": "ng build --extra-webpack-config webpack.extra.js", - "build-libs": "ng build ng-core", - "build": "npm run build-libs && npm run build-app", + "build": "ng build --extra-webpack-config webpack.extra.js", "test": "ng test", "lint": "eslint \"src/**/*.{ts,js,html}\" --max-warnings 420", "lint-fix": "npm run lint -- --fix", "lint-errors": "npm run lint -- --quiet", - "lint-libs": "eslint \"projects/**/*.{ts,js,html}\" --max-warnings 0", - "lint-libs-fix": "npm run lint-libs -- --fix", "prettier-preset": "prettier \"**/*.{html,js,ts,css,scss,md,json,prettierrc,svg,huskyrc,yml,yaml}\"", "prettier": "npm run prettier-preset -- --list-different", "prettier-fix": "npm run prettier-preset -- --write", - "fix": "concurrently -n LIB,APP -c magenta,cyan npm:lint-libs-fix npm:lint-fix && npm run prettier-fix" + "fix": "npm:lint-fix && npm run prettier-fix" }, "dependencies": { "@angular/animations": "15.0.3", @@ -48,12 +42,13 @@ "@vality/dominant-cache-proto": "2.0.1-99f38c9.0", "@vality/fistful-proto": "2.0.1-4ff4ea3.0", "@vality/magista-proto": "2.0.1-cf0eff8.0", + "@vality/ng-core": "0.3.1-pr-7-478c28d.0", "@vality/payout-manager-proto": "2.0.1-b079679.0", "@vality/repairer-proto": "2.0.1-8f7973d.0", "@vality/thrift-ts": "2.4.1-8ad5123.0", "@vality/woody": "0.1.1", "angular2-prettyjson": "3.0.1", - "coerce-property": "0.3.2", + "coerce-property": "15.0.1", "css-element-queries": "1.2.3", "element-resize-detector": "1.2.4", "humanize-duration": "3.21.0", @@ -90,7 +85,6 @@ "@types/uuid": "3.4.3", "@typescript-eslint/eslint-plugin": "5.46.1", "@typescript-eslint/parser": "5.46.1", - "concurrently": "7.3.0", "cross-env": "7.0.3", "dotenv": "16.0.0", "eslint": "8.29.0", diff --git a/projects/ng-core/.prettierignore b/projects/ng-core/.prettierignore deleted file mode 100644 index ec6d3cdd..00000000 --- a/projects/ng-core/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -package.json diff --git a/projects/ng-core/README.md b/projects/ng-core/README.md deleted file mode 100644 index 162c77a8..00000000 --- a/projects/ng-core/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# NgCore - -This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.0. - -## Code scaffolding - -Run `ng generate component component-name --project ng-core` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ng-core`. - -> Note: Don't forget to add `--project ng-core` or else it will be added to the default project in your `angular.json` file. - -## Build - -Run `ng build ng-core` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Publishing - -After building your library with `ng build ng-core`, go to the dist folder `cd dist/ng-core` and run `npm publish`. - -## Running unit tests - -Run `ng test ng-core` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/projects/ng-core/karma.conf.js b/projects/ng-core/karma.conf.js deleted file mode 100644 index e006db62..00000000 --- a/projects/ng-core/karma.conf.js +++ /dev/null @@ -1,41 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma'), - ], - client: { - jasmine: { - // you can add configuration options for Jasmine here - // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html - // for example, you can disable the random execution with `random: false` - // or set a specific seed with `seed: 4321` - }, - clearContext: false, // leave Jasmine Spec Runner output visible in browser - }, - jasmineHtmlReporter: { - suppressAll: true, // removes the duplicated traces - }, - coverageReporter: { - dir: require('path').join(__dirname, '../../coverage/ng-core'), - subdir: '.', - reporters: [{ type: 'html' }, { type: 'text-summary' }], - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - singleRun: false, - restartOnFileChange: true, - }); -}; diff --git a/projects/ng-core/ng-package.json b/projects/ng-core/ng-package.json deleted file mode 100644 index fe644b73..00000000 --- a/projects/ng-core/ng-package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/ng-core", - "lib": { - "entryFile": "src/public-api.ts" - } -} diff --git a/projects/ng-core/package.json b/projects/ng-core/package.json deleted file mode 100644 index d73feb94..00000000 --- a/projects/ng-core/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@vality/ng-core", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^14.0.0", - "@angular/core": "^14.0.0" - }, - "dependencies": { - "tslib": "^2.3.0" - } -} \ No newline at end of file diff --git a/projects/ng-core/src/lib/components/actions/actions.component.html b/projects/ng-core/src/lib/components/actions/actions.component.html deleted file mode 100644 index 7e03ef76..00000000 --- a/projects/ng-core/src/lib/components/actions/actions.component.html +++ /dev/null @@ -1,10 +0,0 @@ -
- -
diff --git a/projects/ng-core/src/lib/components/actions/actions.component.scss b/projects/ng-core/src/lib/components/actions/actions.component.scss deleted file mode 100644 index 9301bcfe..00000000 --- a/projects/ng-core/src/lib/components/actions/actions.component.scss +++ /dev/null @@ -1,14 +0,0 @@ -::ng-deep .cc-actions { - & > *:first-child:not(:last-child) { - margin-right: auto !important; - @media screen and (max-width: 959px) { - margin-right: initial !important; - } - } - & > *:first-child:last-child { - margin-left: auto !important; - @media screen and (max-width: 959px) { - margin-left: initial !important; - } - } -} diff --git a/projects/ng-core/src/lib/components/actions/actions.component.ts b/projects/ng-core/src/lib/components/actions/actions.component.ts deleted file mode 100644 index 765b9acd..00000000 --- a/projects/ng-core/src/lib/components/actions/actions.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component, ChangeDetectionStrategy } from '@angular/core'; - -@Component({ - selector: 'cc-actions', - templateUrl: 'actions.component.html', - styleUrls: ['actions.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ActionsComponent {} diff --git a/projects/ng-core/src/lib/components/actions/actions.module.ts b/projects/ng-core/src/lib/components/actions/actions.module.ts deleted file mode 100644 index 594d32d1..00000000 --- a/projects/ng-core/src/lib/components/actions/actions.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NgModule } from '@angular/core'; -import { FlexLayoutModule } from '@angular/flex-layout'; - -import { ActionsComponent } from './actions.component'; - -@NgModule({ - imports: [FlexLayoutModule], - declarations: [ActionsComponent], - exports: [ActionsComponent], -}) -export class ActionsModule {} diff --git a/projects/ng-core/src/lib/components/actions/index.ts b/projects/ng-core/src/lib/components/actions/index.ts deleted file mode 100644 index 26dc132e..00000000 --- a/projects/ng-core/src/lib/components/actions/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './actions.module'; -export * from './actions.component'; diff --git a/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.html b/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.html deleted file mode 100644 index 68f8ad42..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
-
{{ title }}
- clear -
- - - -
- -
-
- - - -
- -
-
- - -
diff --git a/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.scss b/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.scss deleted file mode 100644 index 028c2894..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.scss +++ /dev/null @@ -1,43 +0,0 @@ -$base-padding: 24px; -$max-height-mobile: 100vh; -$max-height-desktop: 90vh; - -:host { - display: flex; - flex-direction: column; - flex-grow: 1; - height: 100%; -} - -.base-dialog { - max-height: calc(#{$max-height-desktop} - #{$base-padding * 2}) !important; - - @media screen and (max-width: 959px) { - max-height: calc(#{$max-height-mobile} - #{$base-padding * 2}) !important; - } - - &-title { - padding: $base-padding; - - &-close { - cursor: pointer; - font-size: 24px; - - &:hover { - opacity: 0.5; - } - } - } - - &-content { - // instead of flex="grow". Don't need wrong rule "max-height": 100% to support scroll content - flex: 1 1 100%; - box-sizing: border-box; - padding: $base-padding; - overflow: auto; - } - - &-actions { - padding: $base-padding; - } -} diff --git a/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.ts b/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.ts deleted file mode 100644 index 74a5c7f1..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/base-dialog.component.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { coerceBoolean } from 'coerce-property'; - -import { BaseDialogResponseStatus } from './types/base-dialog-response-status'; - -@Component({ - selector: 'cc-base-dialog', - templateUrl: 'base-dialog.component.html', - styleUrls: ['base-dialog.component.scss'], -}) -export class BaseDialogComponent { - @Input() title!: string; - - @coerceBoolean @Input() disabled = false; - @coerceBoolean @Input() inProgress = false; - @Input() progress?: number; - - @coerceBoolean @Input() hasDivider = true; - - @coerceBoolean @Input() noContent = false; - @coerceBoolean @Input() noActions = false; - - @Output() cancel = new EventEmitter(); - - cancelData = { - status: BaseDialogResponseStatus.Cancelled, - }; - - cancelDialog(): void { - this.cancel.emit(); - } -} diff --git a/projects/ng-core/src/lib/components/base-dialog/base-dialog.module.ts b/projects/ng-core/src/lib/components/base-dialog/base-dialog.module.ts deleted file mode 100644 index 80b63929..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/base-dialog.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FlexLayoutModule } from '@angular/flex-layout'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatIconModule } from '@angular/material/icon'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; - -import { ActionsModule } from '../actions'; -import { BaseDialogComponent } from './base-dialog.component'; -import { BaseDialogActionsComponent } from './components/base-dialog-actions/base-dialog-actions.component'; - -const SHARED_DECLARATIONS = [BaseDialogComponent, BaseDialogActionsComponent]; - -@NgModule({ - imports: [ - CommonModule, - FlexLayoutModule, - MatDividerModule, - MatButtonModule, - ActionsModule, - MatIconModule, - MatProgressBarModule, - MatDialogModule, - ], - declarations: SHARED_DECLARATIONS, - exports: SHARED_DECLARATIONS, -}) -export class BaseDialogModule {} diff --git a/projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.html b/projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.html deleted file mode 100644 index 3ed94ffe..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.ts b/projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.ts deleted file mode 100644 index fe7f20f6..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/components/base-dialog-actions/base-dialog-actions.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'cc-base-dialog-actions', - templateUrl: './base-dialog-actions.component.html', -}) -export class BaseDialogActionsComponent {} diff --git a/projects/ng-core/src/lib/components/base-dialog/index.ts b/projects/ng-core/src/lib/components/base-dialog/index.ts deleted file mode 100644 index aa8b652a..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './base-dialog.module'; -export * from './types/base-dialog-response-status'; -export * from './types/base-dialog-response'; -export * from './utils/base-dialog-superclass'; -export * from './tokens'; -export * from './base-dialog.component'; -export * from './components/base-dialog-actions/base-dialog-actions.component'; -export * from './services/base-dialog.service'; diff --git a/projects/ng-core/src/lib/components/base-dialog/services/base-dialog.service.ts b/projects/ng-core/src/lib/components/base-dialog/services/base-dialog.service.ts deleted file mode 100644 index f80835da..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/services/base-dialog.service.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { ComponentType } from '@angular/cdk/overlay'; -import { Inject, Injectable, Optional } from '@angular/core'; -import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog'; - -import { DEFAULT_DIALOG_CONFIG, DIALOG_CONFIG, DialogConfig } from '../tokens'; -import { BaseDialogResponse } from '../types/base-dialog-response'; -import { BaseDialogSuperclass } from '../utils/base-dialog-superclass'; - -@Injectable({ - providedIn: 'root', -}) -export class BaseDialogService { - constructor( - private dialog: MatDialog, - @Optional() - @Inject(DIALOG_CONFIG) - private readonly dialogConfig: DialogConfig - ) { - if (!dialogConfig) this.dialogConfig = DEFAULT_DIALOG_CONFIG; - } - - open( - dialogComponent: ComponentType>, - /** - * Workaround when both conditions for the 'data' argument must be true: - * - typing did not require passing when it is optional (for example: {param: number} | void) - * - typing required to pass when it is required (for example: {param: number}) - */ - ...[data, configOrConfigName]: D extends void - ? [] - : [data: D, configOrConfigName?: Omit, 'data'> | keyof DialogConfig] - ): MatDialogRef> { - let config: Partial>; - if (!configOrConfigName) config = {}; - else if (typeof configOrConfigName === 'string') - config = this.dialogConfig[configOrConfigName]; - else config = configOrConfigName; - - return this.dialog.open(dialogComponent as never, { - data, - ...(dialogComponent as typeof BaseDialogSuperclass).defaultDialogConfig, - ...config, - }); - } -} diff --git a/projects/ng-core/src/lib/components/base-dialog/tokens.ts b/projects/ng-core/src/lib/components/base-dialog/tokens.ts deleted file mode 100644 index 8cf01e6b..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/tokens.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { InjectionToken } from '@angular/core'; -import { MatDialogConfig } from '@angular/material/dialog'; -import { ValuesType } from 'utility-types'; - -export type DialogConfig = Record<'small' | 'medium' | 'large', MatDialogConfig>; - -export const DIALOG_CONFIG = new InjectionToken('dialogConfig'); - -export const BASE_CONFIG: ValuesType = { - maxHeight: '90vh', - disableClose: true, - autoFocus: false, - width: '552px', -}; - -export const DEFAULT_DIALOG_CONFIG: DialogConfig = { - small: { ...BASE_CONFIG, width: '360px' }, - medium: BASE_CONFIG, - large: { ...BASE_CONFIG, width: '800px' }, -}; diff --git a/projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response-status.ts b/projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response-status.ts deleted file mode 100644 index 52613bf6..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response-status.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum BaseDialogResponseStatus { - Success = 'success', - Error = 'error', - Cancelled = 'canceled', -} diff --git a/projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response.ts b/projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response.ts deleted file mode 100644 index deaf6d04..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/types/base-dialog-response.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BaseDialogResponseStatus } from './base-dialog-response-status'; - -export interface BaseDialogResponse { - status: S | BaseDialogResponseStatus; - data?: T; - error?: unknown; -} diff --git a/projects/ng-core/src/lib/components/base-dialog/utils/base-dialog-superclass.ts b/projects/ng-core/src/lib/components/base-dialog/utils/base-dialog-superclass.ts deleted file mode 100644 index 7ea5baa0..00000000 --- a/projects/ng-core/src/lib/components/base-dialog/utils/base-dialog-superclass.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Directive, Injector } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; - -import { DEFAULT_DIALOG_CONFIG } from '../tokens'; -import { BaseDialogResponse } from '../types/base-dialog-response'; -import { BaseDialogResponseStatus } from '../types/base-dialog-response-status'; - -@Directive() -export class BaseDialogSuperclass< - DialogComponent, - DialogData = void, - DialogResponseData = void, - DialogResponseStatus = void, - DialogResponse = BaseDialogResponse -> { - static defaultDialogConfig = DEFAULT_DIALOG_CONFIG.medium; - - dialogData: DialogData = this.injector.get(MAT_DIALOG_DATA) as DialogData; - dialogRef = this.injector.get(MatDialogRef) as MatDialogRef; - - constructor(private injector: Injector) {} - - closeWithCancellation(data?: DialogResponseData) { - this.dialogRef.close({ - status: BaseDialogResponseStatus.Cancelled, - data, - } as never); - } - - closeWithSuccess(data?: DialogResponseData) { - this.dialogRef.close({ - status: BaseDialogResponseStatus.Success, - data, - } as never); - } - - closeWithError(data?: DialogResponseData) { - this.dialogRef.close({ - status: BaseDialogResponseStatus.Error, - data, - } as never); - } -} diff --git a/projects/ng-core/src/lib/components/index.ts b/projects/ng-core/src/lib/components/index.ts deleted file mode 100644 index 53400852..00000000 --- a/projects/ng-core/src/lib/components/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './actions'; -export * from './base-dialog'; diff --git a/projects/ng-core/src/lib/index.ts b/projects/ng-core/src/lib/index.ts deleted file mode 100644 index 949c6f87..00000000 --- a/projects/ng-core/src/lib/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './components'; -export * from './utils'; -export * from './pipes'; diff --git a/projects/ng-core/src/lib/pipes/index.ts b/projects/ng-core/src/lib/pipes/index.ts deleted file mode 100644 index 490bf13a..00000000 --- a/projects/ng-core/src/lib/pipes/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './pipes.module'; -export * from './inline-json.pipe'; diff --git a/projects/ng-core/src/lib/pipes/inline-json.pipe.ts b/projects/ng-core/src/lib/pipes/inline-json.pipe.ts deleted file mode 100644 index 09b01736..00000000 --- a/projects/ng-core/src/lib/pipes/inline-json.pipe.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; - -import { inlineJson } from '../utils'; - -@Pipe({ - name: 'inlineJson', -}) -export class InlineJsonPipe implements PipeTransform { - transform(value: unknown, maxReadableLever: number | false = 1): unknown { - return inlineJson(value, maxReadableLever === false ? Infinity : maxReadableLever); - } -} diff --git a/projects/ng-core/src/lib/pipes/pipes.module.ts b/projects/ng-core/src/lib/pipes/pipes.module.ts deleted file mode 100644 index b3d2577c..00000000 --- a/projects/ng-core/src/lib/pipes/pipes.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { InlineJsonPipe } from './inline-json.pipe'; - -@NgModule({ - declarations: [InlineJsonPipe], - exports: [InlineJsonPipe], - imports: [CommonModule], -}) -export class PipesModule {} diff --git a/projects/ng-core/src/lib/utils/clean.ts b/projects/ng-core/src/lib/utils/clean.ts deleted file mode 100644 index df69f21e..00000000 --- a/projects/ng-core/src/lib/utils/clean.ts +++ /dev/null @@ -1,46 +0,0 @@ -import isEmpty from 'lodash-es/isEmpty'; -import isNil from 'lodash-es/isNil'; -import isObject from 'lodash-es/isObject'; -import { ValuesType } from 'utility-types'; - -function isEmptyPrimitive(value: unknown): boolean { - return isNil(value) || value === ''; -} - -function isEmptyObjectOrPrimitive(value: unknown): boolean { - return isObject(value) ? isEmpty(value) : isEmptyPrimitive(value); -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function clean | ArrayLike | Record>( - value: T, - allowRootRemoval = false, - isNotDeep = false, - filterPredicate: (v: unknown, k?: PropertyKey) => boolean = (v) => !isEmptyObjectOrPrimitive(v) -): T | null { - if (!isObject(value) || (value.constructor !== Object && !Array.isArray(value))) return value; - if (allowRootRemoval && !filterPredicate(value as never)) return null; - let result: unknown; - const cleanChild = (v: unknown) => - isNotDeep ? v : clean(v as never, allowRootRemoval, isNotDeep, filterPredicate); - if (Array.isArray(value)) - result = (value as ValuesType[]) - .slice() - .map((v) => cleanChild(v)) - .filter((v, idx) => filterPredicate(v, idx)); - else - result = Object.fromEntries( - (Object.entries(value) as [keyof T, ValuesType][]) - .map(([k, v]) => [k, cleanChild(v)] as const) - .filter(([k, v]) => filterPredicate(v, k)) - ); - return allowRootRemoval && !filterPredicate(result) ? null : (result as never); -} - -export function cleanPrimitiveProps( - obj: T, - allowRootRemoval = false, - isNotDeep = false -) { - return clean(obj, allowRootRemoval, isNotDeep, (v) => !isEmptyPrimitive(v)); -} diff --git a/projects/ng-core/src/lib/utils/compare-different-types.ts b/projects/ng-core/src/lib/utils/compare-different-types.ts deleted file mode 100644 index 3c0cc7d8..00000000 --- a/projects/ng-core/src/lib/utils/compare-different-types.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Use with sorting (arr.sort(fn)) - */ -export function compareDifferentTypes(a: T, b: T): number { - return typeof a === 'number' && typeof b === 'number' - ? a - b - : String(a).localeCompare(String(b)); -} diff --git a/projects/ng-core/src/lib/utils/index.ts b/projects/ng-core/src/lib/utils/index.ts deleted file mode 100644 index 8cbf5ff8..00000000 --- a/projects/ng-core/src/lib/utils/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './clean'; -export * from './inline-json'; -export * from './compare-different-types'; -export * from './split-ids'; -export * from './is-empty'; diff --git a/projects/ng-core/src/lib/utils/inline-json.ts b/projects/ng-core/src/lib/utils/inline-json.ts deleted file mode 100644 index 4597fb27..00000000 --- a/projects/ng-core/src/lib/utils/inline-json.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { isPrimitive } from 'utility-types'; - -export function inlineJson(value: unknown, maxReadableLever = 1): string { - if (value === '') { - return "''"; - } - if (isPrimitive(value)) { - return String(value); - } - if (Array.isArray(value) || value instanceof Map || value instanceof Set) { - const content = - maxReadableLever > 0 - ? Array.from(value) - .map((v) => inlineJson(v, maxReadableLever)) - .join(', ') - : Array.from(value).length - ? '…' - : ''; - if (value instanceof Set) return ['Set(', content, ')'].filter(Boolean).join(''); - if (value instanceof Map) return ['Map(', content, ')'].filter(Boolean).join(''); - return ['[', content, ']'].filter(Boolean).join(''); - } - const content = - maxReadableLever > 0 - ? ' ' + - Object.entries(value as never) - .map(([k, v]) => `${k}: ${inlineJson(v, maxReadableLever - 1)}`) - .join(', ') + - ' ' - : ''; - return ['{', content, '}'].filter(Boolean).join(''); -} diff --git a/projects/ng-core/src/lib/utils/is-empty.ts b/projects/ng-core/src/lib/utils/is-empty.ts deleted file mode 100644 index 8c0f1cb0..00000000 --- a/projects/ng-core/src/lib/utils/is-empty.ts +++ /dev/null @@ -1,7 +0,0 @@ -import _isEmpty from 'lodash-es/isEmpty'; -import isNil from 'lodash-es/isNil'; -import isObject from 'lodash-es/isObject'; - -export function isEmpty(value: unknown): boolean { - return isObject(value) ? _isEmpty(value) : isNil(value) || value === ''; -} diff --git a/projects/ng-core/src/lib/utils/split-ids.ts b/projects/ng-core/src/lib/utils/split-ids.ts deleted file mode 100644 index d38a67ec..00000000 --- a/projects/ng-core/src/lib/utils/split-ids.ts +++ /dev/null @@ -1,9 +0,0 @@ -const SEPARATORS = ',.;'; - -export function splitIds(ids: string): string[] { - if (!ids) return []; - return ids - .split(new RegExp(`[${SEPARATORS}\\s]`)) - .map((id) => id.trim()) - .filter(Boolean); -} diff --git a/projects/ng-core/src/public-api.ts b/projects/ng-core/src/public-api.ts deleted file mode 100644 index 91fe6f63..00000000 --- a/projects/ng-core/src/public-api.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* - * Public API Surface of ng-core - */ - -export * from './lib'; diff --git a/projects/ng-core/src/test.ts b/projects/ng-core/src/test.ts deleted file mode 100644 index dc612307..00000000 --- a/projects/ng-core/src/test.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js'; -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); diff --git a/projects/ng-core/tsconfig.lib.json b/projects/ng-core/tsconfig.lib.json deleted file mode 100644 index efcc4151..00000000 --- a/projects/ng-core/tsconfig.lib.json +++ /dev/null @@ -1,21 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/lib", - "declaration": true, - "declarationMap": true, - "inlineSources": true, - "types": [], - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true - }, - "angularCompilerOptions": { - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true, - "strictTemplates": true - }, - "exclude": ["src/test.ts", "**/*.spec.ts"] -} diff --git a/projects/ng-core/tsconfig.lib.prod.json b/projects/ng-core/tsconfig.lib.prod.json deleted file mode 100644 index 560c2391..00000000 --- a/projects/ng-core/tsconfig.lib.prod.json +++ /dev/null @@ -1,10 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.lib.json", - "compilerOptions": { - "declarationMap": false - }, - "angularCompilerOptions": { - "compilationMode": "partial" - } -} diff --git a/projects/ng-core/tsconfig.spec.json b/projects/ng-core/tsconfig.spec.json deleted file mode 100644 index 4ed8f505..00000000 --- a/projects/ng-core/tsconfig.spec.json +++ /dev/null @@ -1,10 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": ["jasmine"] - }, - "files": ["src/test.ts"], - "include": ["**/*.spec.ts", "**/*.d.ts"] -} diff --git a/src/app/sections/claim/claim.component.ts b/src/app/sections/claim/claim.component.ts index cd532193..95e4207f 100644 --- a/src/app/sections/claim/claim.component.ts +++ b/src/app/sections/claim/claim.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogResponseStatus, BaseDialogService } from '@vality/ng-core'; +import { DialogResponseStatus, DialogService } from '@vality/ng-core'; import { BehaviorSubject, combineLatest, defer, merge, Observable, Subject, switchMap } from 'rxjs'; import { first, map, shareReplay } from 'rxjs/operators'; @@ -63,7 +63,7 @@ export class ClaimComponent { private partyManagementService: PartyManagementService, private notificationService: NotificationService, private allowedClaimStatusesService: AllowedClaimStatusesService, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private notificationErrorService: NotificationErrorService ) {} @@ -76,14 +76,14 @@ export class ClaimComponent { .pipe( first(), switchMap(([party, claim]) => - this.baseDialogService + this.dialogService .open(AddModificationDialogComponent, { party, claim }) .afterClosed() ), untilDestroyed(this) ) .subscribe((result) => { - if (result.status === BaseDialogResponseStatus.Success) this.reloadClaim(); + if (result.status === DialogResponseStatus.Success) this.reloadClaim(); }); } @@ -92,14 +92,14 @@ export class ClaimComponent { .pipe( first(), switchMap(([party, claim]) => - this.baseDialogService + this.dialogService .open(ChangeStatusDialogComponent, { partyID: party.id, claim }) .afterClosed() ), untilDestroyed(this) ) .subscribe((result) => { - if (result.status === BaseDialogResponseStatus.Success) this.reloadClaim(); + if (result.status === DialogResponseStatus.Success) this.reloadClaim(); }); } } diff --git a/src/app/sections/claim/claim.module.ts b/src/app/sections/claim/claim.module.ts index a879bcd4..b9c15cd2 100644 --- a/src/app/sections/claim/claim.module.ts +++ b/src/app/sections/claim/claim.module.ts @@ -15,7 +15,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { RouterModule } from '@angular/router'; -import { ActionsModule, BaseDialogModule } from '@vality/ng-core'; +import { ActionsModule, DialogModule } from '@vality/ng-core'; import { JsonViewerModule } from '@cc/app/shared/components/json-viewer/json-viewer.module'; import { StatusModule } from '@cc/app/shared/components/status'; @@ -70,7 +70,7 @@ import { TimelineItemLoadingComponent } from './components/timeline-item-loading MatMenuModule, MatDialogModule, MatProgressBarModule, - BaseDialogModule, + DialogModule, ActionsModule, HumanizeDurationModule, ], diff --git a/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.html b/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.html index d768fccc..f27b068e 100644 --- a/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.html +++ b/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.html @@ -1,4 +1,4 @@ - @@ -8,7 +8,7 @@ [party]="dialogData.party" [type]="isUpdate ? 'PartyModificationChange' : 'PartyModification'" > - + - - + + diff --git a/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.ts b/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.ts index f8fa5f77..43d87e03 100644 --- a/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.ts +++ b/src/app/sections/claim/components/add-modification-dialog/add-modification-dialog.component.ts @@ -8,11 +8,7 @@ import { PartyModificationChange, } from '@vality/domain-proto/claim_management'; import { Party } from '@vality/domain-proto/domain'; -import { - BaseDialogResponseStatus, - BaseDialogSuperclass, - DEFAULT_DIALOG_CONFIG, -} from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass, DEFAULT_DIALOG_CONFIG } from '@vality/ng-core'; import { BehaviorSubject } from 'rxjs'; import { ClaimManagementService } from '@cc/app/api/claim-management'; @@ -26,7 +22,7 @@ import { NotificationErrorService } from '../../../../shared/services/notificati selector: 'cc-add-modification-dialog', templateUrl: './add-modification-dialog.component.html', }) -export class AddModificationDialogComponent extends BaseDialogSuperclass< +export class AddModificationDialogComponent extends DialogSuperclass< AddModificationDialogComponent, { party: Party; claim: Claim; modificationUnit?: ModificationUnit } > { @@ -64,7 +60,7 @@ export class AddModificationDialogComponent extends BaseDialogSuperclass< .subscribe({ next: () => { this.notificationService.success('Modification added successfully'); - this.dialogRef.close({ status: BaseDialogResponseStatus.Success }); + this.dialogRef.close({ status: DialogResponseStatus.Success }); }, error: this.notificationErrorService.error, }); @@ -84,13 +80,13 @@ export class AddModificationDialogComponent extends BaseDialogSuperclass< .subscribe({ next: () => { this.notificationService.success('Modification updated successfully'); - this.dialogRef.close({ status: BaseDialogResponseStatus.Success }); + this.dialogRef.close({ status: DialogResponseStatus.Success }); }, error: this.notificationErrorService.error, }); } cancel() { - this.dialogRef.close({ status: BaseDialogResponseStatus.Cancelled }); + this.dialogRef.close({ status: DialogResponseStatus.Cancelled }); } } diff --git a/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.html b/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.html index c5a865d5..73ed6832 100644 --- a/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.html +++ b/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.html @@ -1,4 +1,4 @@ - +
- + - -
+ + diff --git a/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.ts b/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.ts index 5b23f983..aaa78562 100644 --- a/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.ts +++ b/src/app/sections/claim/components/change-status-dialog/change-status-dialog.component.ts @@ -2,7 +2,7 @@ import { Component, Injector } from '@angular/core'; import { Validators, FormBuilder } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { Claim, ClaimStatus } from '@vality/domain-proto/claim_management'; -import { BaseDialogResponseStatus, BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass } from '@vality/ng-core'; import { BehaviorSubject, Observable } from 'rxjs'; import { ClaimManagementService } from '@cc/app/api/claim-management'; @@ -17,7 +17,7 @@ import { NotificationErrorService } from '../../../../shared/services/notificati selector: 'cc-change-status-dialog', templateUrl: './change-status-dialog.component.html', }) -export class ChangeStatusDialogComponent extends BaseDialogSuperclass< +export class ChangeStatusDialogComponent extends DialogSuperclass< ChangeStatusDialogComponent, { partyID: string; claim: Claim } > { @@ -68,7 +68,7 @@ export class ChangeStatusDialogComponent extends BaseDialogSuperclass< } result$.pipe(progressTo(this.progress$), untilDestroyed(this)).subscribe({ next: () => { - this.dialogRef.close({ status: BaseDialogResponseStatus.Success }); + this.dialogRef.close({ status: DialogResponseStatus.Success }); this.notificationService.success('Status successfully changed'); }, error: this.notificationErrorService.error, diff --git a/src/app/sections/claim/components/modification-unit-timeline-item/modification-unit-timeline-item.component.ts b/src/app/sections/claim/components/modification-unit-timeline-item/modification-unit-timeline-item.component.ts index 907dba7c..3141247d 100644 --- a/src/app/sections/claim/components/modification-unit-timeline-item/modification-unit-timeline-item.component.ts +++ b/src/app/sections/claim/components/modification-unit-timeline-item/modification-unit-timeline-item.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { Claim, ModificationUnit } from '@vality/domain-proto/claim_management'; -import { BaseDialogResponseStatus, BaseDialogService } from '@vality/ng-core'; +import { DialogResponseStatus, DialogService } from '@vality/ng-core'; import { coerceBoolean } from 'coerce-property'; import isEmpty from 'lodash-es/isEmpty'; import { BehaviorSubject, switchMap, from } from 'rxjs'; @@ -45,7 +45,7 @@ export class ModificationUnitTimelineItemComponent { constructor( private partyManagementService: PartyManagementService, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private claimManagementService: ClaimManagementService, private notificationService: NotificationService, private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService, @@ -66,7 +66,7 @@ export class ModificationUnitTimelineItemComponent { .pipe( first(), switchMap((party) => - this.baseDialogService + this.dialogService .open(AddModificationDialogComponent, { party, claim: this.claim, @@ -77,16 +77,16 @@ export class ModificationUnitTimelineItemComponent { untilDestroyed(this) ) .subscribe((result) => { - if (result.status === BaseDialogResponseStatus.Success) this.claimChanged.emit(); + if (result.status === DialogResponseStatus.Success) this.claimChanged.emit(); }); } remove() { - this.baseDialogService + this.dialogService .open(ConfirmActionDialogComponent, { title: 'Confirm deletion' }) .afterClosed() .pipe( - filter(({ status }) => status === BaseDialogResponseStatus.Success), + filter(({ status }) => status === DialogResponseStatus.Success), switchMap(() => this.partyManagementService.Get(this.claim.party_id)), switchMap((party) => this.claimManagementService.RemoveModification( diff --git a/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.component.html b/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.component.html index 7da6cbaf..e35fa0da 100644 --- a/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.component.html +++ b/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.component.html @@ -1,4 +1,4 @@ - +
@@ -26,7 +26,7 @@
- + - -
+ + diff --git a/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.module.ts b/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.module.ts index 99b4920e..c5afce8a 100644 --- a/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.module.ts +++ b/src/app/sections/deposits/create-deposit-dialog/create-deposit-dialog.module.ts @@ -8,7 +8,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { UserInfoBasedIdGeneratorModule } from '@cc/app/shared/services/user-info-based-id-generator/user-info-based-id-generator.module'; @@ -26,7 +26,7 @@ import { CreateDepositDialogComponent } from './create-deposit-dialog.component' MatButtonModule, MatProgressBarModule, UserInfoBasedIdGeneratorModule, - BaseDialogModule, + DialogModule, ], declarations: [CreateDepositDialogComponent], }) diff --git a/src/app/sections/domain/domain-info/domain-info.component.html b/src/app/sections/domain/domain-info/domain-info.component.html index e6e829c2..9ce155b3 100644 --- a/src/app/sections/domain/domain-info/domain-info.component.html +++ b/src/app/sections/domain/domain-info/domain-info.component.html @@ -18,11 +18,11 @@ type="DomainObject" (changeKind)="kind = $event" > - + - + diff --git a/src/app/sections/domain/domain-info/domain-info.component.ts b/src/app/sections/domain/domain-info/domain-info.component.ts index c394cf00..ec459eb5 100644 --- a/src/app/sections/domain/domain-info/domain-info.component.ts +++ b/src/app/sections/domain/domain-info/domain-info.component.ts @@ -3,7 +3,7 @@ import { MatSidenav } from '@angular/material/sidenav'; import { Router } from '@angular/router'; import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy'; import { DomainObject, Reference } from '@vality/domain-proto/domain'; -import { BaseDialogService, BaseDialogResponseStatus } from '@vality/ng-core'; +import { DialogService, DialogResponseStatus } from '@vality/ng-core'; import { from } from 'rxjs'; import { filter, switchMap } from 'rxjs/operators'; @@ -48,7 +48,7 @@ export class DomainInfoComponent { constructor( private router: Router, private domainStoreService: DomainStoreService, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private notificationService: NotificationService, private notificationErrorService: NotificationErrorService, private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService, @@ -60,12 +60,12 @@ export class DomainInfoComponent { } delete() { - this.baseDialogService + this.dialogService .open(ConfirmActionDialogComponent, { title: 'Delete object' }) .afterClosed() .pipe( untilDestroyed(this), - filter(({ status }) => status === BaseDialogResponseStatus.Success), + filter(({ status }) => status === DialogResponseStatus.Success), switchMap(() => this.domainStoreService.commit({ ops: [{ remove: { object: this.objWithRef.obj } }], diff --git a/src/app/sections/domain/domain-obj-creation/domain-obj-creation.component.html b/src/app/sections/domain/domain-obj-creation/domain-obj-creation.component.html index 6435cd3d..820a2cb5 100644 --- a/src/app/sections/domain/domain-obj-creation/domain-obj-creation.component.html +++ b/src/app/sections/domain/domain-obj-creation/domain-obj-creation.component.html @@ -27,7 +27,7 @@ > - + - + diff --git a/src/app/sections/domain/domain-obj-modification/domain-obj-modification.component.html b/src/app/sections/domain/domain-obj-modification/domain-obj-modification.component.html index 1c86bc47..a8dfaf85 100644 --- a/src/app/sections/domain/domain-obj-modification/domain-obj-modification.component.html +++ b/src/app/sections/domain/domain-obj-modification/domain-obj-modification.component.html @@ -22,7 +22,7 @@ > - + - + diff --git a/src/app/sections/domain/domain-obj-review/domain-obj-review.component.html b/src/app/sections/domain/domain-obj-review/domain-obj-review.component.html index afc87a83..a738522c 100644 --- a/src/app/sections/domain/domain-obj-review/domain-obj-review.component.html +++ b/src/app/sections/domain/domain-obj-review/domain-obj-review.component.html @@ -15,7 +15,7 @@ > - + - + diff --git a/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.html b/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.html index 9b7729af..1689c500 100644 --- a/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.html +++ b/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.html @@ -1,4 +1,4 @@ - + - + - - + + diff --git a/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.ts b/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.ts index 95cb6965..20d8c7e4 100644 --- a/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.ts +++ b/src/app/sections/payment-details/create-chargeback-dialog/create-chargeback-dialog.component.ts @@ -3,7 +3,7 @@ import { FormControl } from '@angular/forms'; import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy'; import { InvoicePaymentChargeback } from '@vality/domain-proto/domain'; import { InvoicePaymentChargebackParams } from '@vality/domain-proto/payment_processing'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { from } from 'rxjs'; import * as short from 'short-uuid'; @@ -17,7 +17,7 @@ import { NotificationErrorService } from '@cc/app/shared/services/notification-e selector: 'cc-create-chargeback-dialog', templateUrl: './create-chargeback-dialog.component.html', }) -export class CreateChargebackDialogComponent extends BaseDialogSuperclass< +export class CreateChargebackDialogComponent extends DialogSuperclass< CreateChargebackDialogComponent, { invoiceID: string; paymentID: string }, InvoicePaymentChargeback diff --git a/src/app/sections/payment-details/payment-details.component.html b/src/app/sections/payment-details/payment-details.component.html index 7dfbc687..30069868 100644 --- a/src/app/sections/payment-details/payment-details.component.html +++ b/src/app/sections/payment-details/payment-details.component.html @@ -23,11 +23,11 @@

Chargebacks

- + - +
@@ -51,7 +51,7 @@ export class PaymentDetailsComponent { .afterClosed() .pipe(untilDestroyed(this)) .subscribe(({ status }) => { - if (status === BaseDialogResponseStatus.Success) this.updateChargebacks$.next(); + if (status === DialogResponseStatus.Success) this.updateChargebacks$.next(); }); } } diff --git a/src/app/sections/payment-details/payment-details.module.ts b/src/app/sections/payment-details/payment-details.module.ts index 4fb5a021..2fec4046 100644 --- a/src/app/sections/payment-details/payment-details.module.ts +++ b/src/app/sections/payment-details/payment-details.module.ts @@ -6,7 +6,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatDialogModule } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { ActionsModule, BaseDialogModule } from '@vality/ng-core'; +import { ActionsModule, DialogModule } from '@vality/ng-core'; import { StatusModule } from '@cc/app/shared/components'; import { DetailsItemModule } from '@cc/components/details-item'; @@ -38,7 +38,7 @@ import { PaymentRefundsModule } from './payment-refunds'; PaymentRefundsModule, ChargebacksComponent, ActionsModule, - BaseDialogModule, + DialogModule, MetadataFormModule, ReactiveFormsModule, ], diff --git a/src/app/sections/payouts/payouts/components/cancel-payout-dialog/cancel-payout-dialog.component.ts b/src/app/sections/payouts/payouts/components/cancel-payout-dialog/cancel-payout-dialog.component.ts index 32f2193a..daa7f00e 100644 --- a/src/app/sections/payouts/payouts/components/cancel-payout-dialog/cancel-payout-dialog.component.ts +++ b/src/app/sections/payouts/payouts/components/cancel-payout-dialog/cancel-payout-dialog.component.ts @@ -1,7 +1,7 @@ import { Component, Injector } from '@angular/core'; import { FormControl } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogResponseStatus, BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass } from '@vality/ng-core'; import { PayoutID } from '@vality/payout-manager-proto/payout_manager'; import { BehaviorSubject } from 'rxjs'; @@ -16,7 +16,7 @@ import { NotificationErrorService } from '../../../../../shared/services/notific selector: 'cc-cancel-payout-dialog', templateUrl: './cancel-payout-dialog.component.html', }) -export class CancelPayoutDialogComponent extends BaseDialogSuperclass< +export class CancelPayoutDialogComponent extends DialogSuperclass< CancelPayoutDialogComponent, { id: PayoutID } > { @@ -38,7 +38,7 @@ export class CancelPayoutDialogComponent extends BaseDialogSuperclass< .pipe(progressTo(this.progress$), untilDestroyed(this)) .subscribe({ next: () => { - this.dialogRef.close({ status: BaseDialogResponseStatus.Success }); + this.dialogRef.close({ status: DialogResponseStatus.Success }); this.notificationService.success('Payout canceled successfully'); }, error: this.notificationErrorService.error, diff --git a/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.html b/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.html index f6e00612..8dc2dbcc 100644 --- a/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.html +++ b/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.html @@ -1,4 +1,4 @@ - +
- + - -
+ + diff --git a/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.ts b/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.ts index 0b5dbe6d..6007d5e0 100644 --- a/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.ts +++ b/src/app/sections/payouts/payouts/components/create-payout-dialog/create-payout-dialog.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, Injector } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogResponseStatus, BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass } from '@vality/ng-core'; import { PayoutParams } from '@vality/payout-manager-proto/payout_manager'; import isNil from 'lodash-es/isNil'; import omitBy from 'lodash-es/omitBy'; @@ -28,7 +28,7 @@ interface CreatePayoutDialogForm { templateUrl: './create-payout-dialog.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class CreatePayoutDialogComponent extends BaseDialogSuperclass { +export class CreatePayoutDialogComponent extends DialogSuperclass { progress$ = new BehaviorSubject(0); control = this.fb.group({ partyId: null, @@ -71,7 +71,7 @@ export class CreatePayoutDialogComponent extends BaseDialogSuperclass { this.notificationService.success('Payout created successfully'); - this.dialogRef.close({ status: BaseDialogResponseStatus.Success }); + this.dialogRef.close({ status: DialogResponseStatus.Success }); }, error: this.notificationErrorService.error, }); diff --git a/src/app/sections/payouts/payouts/payouts.component.html b/src/app/sections/payouts/payouts/payouts.component.html index b81d75dc..e8ac6fbf 100644 --- a/src/app/sections/payouts/payouts/payouts.component.html +++ b/src/app/sections/payouts/payouts/payouts.component.html @@ -1,9 +1,9 @@

Payouts

- + - +
diff --git a/src/app/sections/payouts/payouts/payouts.component.ts b/src/app/sections/payouts/payouts/payouts.component.ts index bd6f7a84..bce79255 100644 --- a/src/app/sections/payouts/payouts/payouts.component.ts +++ b/src/app/sections/payouts/payouts/payouts.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogService } from '@vality/ng-core'; +import { DialogService } from '@vality/ng-core'; import omitBy from 'lodash-es/omitBy'; import * as moment from 'moment/moment'; @@ -33,7 +33,7 @@ export class PayoutsComponent implements OnInit { constructor( private fetchPayoutsService: FetchPayoutsService, private qp: QueryParamsService>, - private baseDialogService: BaseDialogService + private dialogService: DialogService ) {} ngOnInit() { @@ -70,6 +70,6 @@ export class PayoutsComponent implements OnInit { } create() { - this.baseDialogService.open(CreatePayoutDialogComponent); + this.dialogService.open(CreatePayoutDialogComponent); } } diff --git a/src/app/sections/payouts/payouts/payouts.module.ts b/src/app/sections/payouts/payouts/payouts.module.ts index 92585b03..456b57d0 100644 --- a/src/app/sections/payouts/payouts/payouts.module.ts +++ b/src/app/sections/payouts/payouts/payouts.module.ts @@ -13,7 +13,7 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { MatTableModule } from '@angular/material/table'; -import { BaseDialogModule, ActionsModule } from '@vality/ng-core'; +import { DialogModule, ActionsModule } from '@vality/ng-core'; import { PayoutToolFieldModule, ShopFieldModule, StatusModule } from '@cc/app/shared/components'; import { MerchantFieldModule } from '@cc/app/shared/components/merchant-field'; @@ -61,7 +61,7 @@ import { PayoutsComponent } from './payouts.component'; MatDialogModule, ShopFieldModule, PayoutToolFieldModule, - BaseDialogModule, + DialogModule, ActionsModule, DateRangeModule, ], diff --git a/src/app/sections/payouts/services/payout-actions.service.ts b/src/app/sections/payouts/services/payout-actions.service.ts index a531f912..fd29a803 100644 --- a/src/app/sections/payouts/services/payout-actions.service.ts +++ b/src/app/sections/payouts/services/payout-actions.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { PayoutID, PayoutStatus } from '@vality/magista-proto/magista'; -import { BaseDialogResponseStatus, BaseDialogService } from '@vality/ng-core'; +import { DialogResponseStatus, DialogService } from '@vality/ng-core'; import { switchMap } from 'rxjs'; import { filter } from 'rxjs/operators'; @@ -16,7 +16,7 @@ import { CancelPayoutDialogComponent } from '../payouts/components/cancel-payout export class PayoutActionsService { constructor( private payoutManagementService: PayoutManagementService, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private notificationErrorService: NotificationErrorService ) {} @@ -29,15 +29,15 @@ export class PayoutActionsService { } cancel(id: PayoutID) { - this.baseDialogService.open(CancelPayoutDialogComponent, { id }); + this.dialogService.open(CancelPayoutDialogComponent, { id }); } confirm(id: PayoutID) { - this.baseDialogService + this.dialogService .open(ConfirmActionDialogComponent, { title: 'Confirm payout' }) .afterClosed() .pipe( - filter(({ status }) => status === BaseDialogResponseStatus.Success), + filter(({ status }) => status === DialogResponseStatus.Success), switchMap(() => this.payoutManagementService.ConfirmPayout(id)), untilDestroyed(this) ) diff --git a/src/app/sections/repairing/components/repair-by-scenario-dialog/repair-by-scenario-dialog.component.html b/src/app/sections/repairing/components/repair-by-scenario-dialog/repair-by-scenario-dialog.component.html index 89256824..ca3873e7 100644 --- a/src/app/sections/repairing/components/repair-by-scenario-dialog/repair-by-scenario-dialog.component.html +++ b/src/app/sections/repairing/components/repair-by-scenario-dialog/repair-by-scenario-dialog.component.html @@ -1,4 +1,4 @@ - +
Type @@ -55,7 +55,7 @@
- + - -
+ + diff --git a/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.component.ts b/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.component.ts index 638c975e..2be4487a 100644 --- a/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.component.ts +++ b/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; import { UntypedFormBuilder } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { map } from 'rxjs/operators'; import { RoutingRulesService } from '../services/routing-rules'; @@ -13,7 +13,7 @@ import { RoutingRulesService } from '../services/routing-rules'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class ChangeDelegateRulesetDialogComponent - extends BaseDialogSuperclass< + extends DialogSuperclass< ChangeDelegateRulesetDialogComponent, { mainRulesetRefID: number; delegateIdx: number } > diff --git a/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.module.ts b/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.module.ts index dc09cc70..2cfd2fef 100644 --- a/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.module.ts +++ b/src/app/sections/routing-rules/change-delegate-ruleset-dialog/change-delegate-ruleset-dialog.module.ts @@ -5,7 +5,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { ChangeDelegateRulesetDialogComponent } from './change-delegate-ruleset-dialog.component'; @@ -18,7 +18,7 @@ import { ChangeDelegateRulesetDialogComponent } from './change-delegate-ruleset- MatInputModule, MatButtonModule, MatSelectModule, - BaseDialogModule, + DialogModule, ], declarations: [ChangeDelegateRulesetDialogComponent], exports: [ChangeDelegateRulesetDialogComponent], diff --git a/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.html b/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.html index fcb4ff01..05efd0ff 100644 --- a/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.html +++ b/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.html @@ -1,4 +1,4 @@ - + - + - - + + diff --git a/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.ts b/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.ts index 7b6e18fd..c2a79586 100644 --- a/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.ts +++ b/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Injector } from '@angular/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { BehaviorSubject } from 'rxjs'; import { NotificationErrorService } from '@cc/app/shared/services/notification-error'; @@ -14,7 +14,7 @@ import { RoutingRulesType } from '../types/routing-rules-type'; templateUrl: 'change-target-dialog.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ChangeTargetDialogComponent extends BaseDialogSuperclass< +export class ChangeTargetDialogComponent extends DialogSuperclass< ChangeTargetDialogComponent, { mainRulesetRefID: number; delegateIdx: number; type: RoutingRulesType } > { diff --git a/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.module.ts b/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.module.ts index 79b7e5d9..379cd2f8 100644 --- a/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.module.ts +++ b/src/app/sections/routing-rules/change-target-dialog/change-target-dialog.module.ts @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core'; import { FlexLayoutModule } from '@angular/flex-layout'; import { MatButtonModule } from '@angular/material/button'; import { MatDialogModule } from '@angular/material/dialog'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { TargetRulesetFormModule } from '../target-ruleset-form'; import { ChangeTargetDialogComponent } from './change-target-dialog.component'; @@ -15,7 +15,7 @@ import { ChangeTargetDialogComponent } from './change-target-dialog.component'; FlexLayoutModule, MatDialogModule, MatButtonModule, - BaseDialogModule, + DialogModule, ], declarations: [ChangeTargetDialogComponent], exports: [ChangeTargetDialogComponent], diff --git a/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.html b/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.html index 2191d3c8..a65210bb 100644 --- a/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.html +++ b/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.html @@ -1,4 +1,4 @@ - +
- + - -
+ + diff --git a/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.ts b/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.ts index 40004aff..ed9187e0 100644 --- a/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.ts +++ b/src/app/sections/routing-rules/party-delegate-rulesets/attach-new-ruleset-dialog/attach-new-ruleset-dialog.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, Injector } from '@angular/core'; import { UntypedFormBuilder } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { BehaviorSubject } from 'rxjs'; import { RoutingRulesType } from '@cc/app/sections/routing-rules/types/routing-rules-type'; @@ -15,7 +15,7 @@ import { TargetRuleset } from '../../target-ruleset-form'; templateUrl: 'attach-new-ruleset-dialog.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class AttachNewRulesetDialogComponent extends BaseDialogSuperclass< +export class AttachNewRulesetDialogComponent extends DialogSuperclass< AttachNewRulesetDialogComponent, { partyID: string; type: RoutingRulesType } > { diff --git a/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.component.ts b/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.component.ts index 6ef92f91..f2831cf8 100644 --- a/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.component.ts +++ b/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogService } from '@vality/ng-core'; +import { DialogService } from '@vality/ng-core'; import { first, map } from 'rxjs/operators'; import { DomainStoreService } from '@cc/app/api/deprecated-damsel'; @@ -58,14 +58,14 @@ export class PartyDelegateRulesetsComponent { private partyDelegateRulesetsService: PartyDelegateRulesetsService, private routingRulesService: RoutingRulesService, private router: Router, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private domainStoreService: DomainStoreService, private notificationErrorService: NotificationErrorService, private route: ActivatedRoute ) {} attachNewRuleset() { - this.baseDialogService + this.dialogService .open(AttachNewRulesetDialogComponent, { partyID: this.partyID, type: this.route.snapshot.params.type, diff --git a/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.module.ts b/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.module.ts index 5c18aa50..63889cd5 100644 --- a/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.module.ts +++ b/src/app/sections/routing-rules/party-delegate-rulesets/party-delegate-rulesets.module.ts @@ -14,7 +14,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; import { RouterModule } from '@angular/router'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { DetailsItemModule } from '@cc/components/details-item'; @@ -51,7 +51,7 @@ const EXPORTED_DECLARATIONS = [PartyDelegateRulesetsComponent, AttachNewRulesetD ChangeTargetDialogModule, TargetRulesetFormModule, RoutingRulesListModule, - BaseDialogModule, + DialogModule, ], declarations: EXPORTED_DECLARATIONS, exports: EXPORTED_DECLARATIONS, diff --git a/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.html b/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.html index 86565fbc..86ab27d9 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.html +++ b/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.html @@ -1,4 +1,4 @@ - +
Shop @@ -32,7 +32,7 @@
- + - - + + diff --git a/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.ts b/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.ts index dc68dd1e..68c4689c 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.ts +++ b/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.component.ts @@ -3,7 +3,7 @@ import { FormBuilder } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { Shop } from '@vality/domain-proto/domain'; import { StatWallet } from '@vality/fistful-proto/fistful_stat'; -import { BaseDialogResponseStatus, BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass } from '@vality/ng-core'; import { NotificationErrorService } from '@cc/app/shared/services/notification-error'; @@ -14,7 +14,7 @@ import { RoutingRulesType } from '../../types/routing-rules-type'; @Component({ templateUrl: 'add-party-routing-rule-dialog.component.html', }) -export class AddPartyRoutingRuleDialogComponent extends BaseDialogSuperclass< +export class AddPartyRoutingRuleDialogComponent extends DialogSuperclass< AddPartyRoutingRuleDialogComponent, { refID: number; partyID: string; shops: Shop[]; wallets: StatWallet[]; type: RoutingRulesType } > { @@ -54,7 +54,7 @@ export class AddPartyRoutingRuleDialogComponent extends BaseDialogSuperclass< ) .pipe(untilDestroyed(this)) .subscribe({ - next: () => this.dialogRef.close({ status: BaseDialogResponseStatus.Success }), + next: () => this.dialogRef.close({ status: DialogResponseStatus.Success }), error: this.notificationErrorService.error, }); } diff --git a/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.module.ts b/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.module.ts index 5490d268..af0c388c 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.module.ts +++ b/src/app/sections/routing-rules/party-routing-ruleset/add-party-routing-rule-dialog/add-party-routing-rule-dialog.module.ts @@ -11,7 +11,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { AddPartyRoutingRuleDialogComponent } from './add-party-routing-rule-dialog.component'; @@ -29,7 +29,7 @@ import { AddPartyRoutingRuleDialogComponent } from './add-party-routing-rule-dia MatSelectModule, MatRadioModule, MatAutocompleteModule, - BaseDialogModule, + DialogModule, ], declarations: [AddPartyRoutingRuleDialogComponent], exports: [AddPartyRoutingRuleDialogComponent], diff --git a/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.html b/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.html index 01e3aa77..3af3c0e0 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.html +++ b/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.html @@ -1,4 +1,4 @@ - +
- + - -
+ + diff --git a/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.ts b/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.ts index ae24dd27..d289dd0f 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.ts +++ b/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.component.ts @@ -1,7 +1,7 @@ import { Component, Injector } from '@angular/core'; import { UntypedFormBuilder } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { NotificationErrorService } from '../../../../shared/services/notification-error'; import { RoutingRulesService } from '../../services/routing-rules'; @@ -11,7 +11,7 @@ import { RoutingRulesService } from '../../services/routing-rules'; selector: 'cc-initialize-routing-rules-dialog', templateUrl: 'initialize-routing-rules-dialog.component.html', }) -export class InitializeRoutingRulesDialogComponent extends BaseDialogSuperclass< +export class InitializeRoutingRulesDialogComponent extends DialogSuperclass< InitializeRoutingRulesDialogComponent, { partyID: string; refID: number } > { diff --git a/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.module.ts b/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.module.ts index 9615fdc1..010403aa 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.module.ts +++ b/src/app/sections/routing-rules/party-routing-ruleset/initialize-routing-rules-dialog/initialize-routing-rules-dialog.module.ts @@ -11,7 +11,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { InitializeRoutingRulesDialogComponent } from './initialize-routing-rules-dialog.component'; @@ -29,7 +29,7 @@ import { InitializeRoutingRulesDialogComponent } from './initialize-routing-rule MatSelectModule, MatRadioModule, MatAutocompleteModule, - BaseDialogModule, + DialogModule, ], declarations: [InitializeRoutingRulesDialogComponent], exports: [InitializeRoutingRulesDialogComponent], diff --git a/src/app/sections/routing-rules/party-routing-ruleset/party-routing-ruleset.component.ts b/src/app/sections/routing-rules/party-routing-ruleset/party-routing-ruleset.component.ts index 7f0186f7..8344f4b1 100644 --- a/src/app/sections/routing-rules/party-routing-ruleset/party-routing-ruleset.component.ts +++ b/src/app/sections/routing-rules/party-routing-ruleset/party-routing-ruleset.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogService, BaseDialogResponseStatus } from '@vality/ng-core'; +import { DialogService, DialogResponseStatus } from '@vality/ng-core'; import { combineLatest, Observable } from 'rxjs'; import { filter, map, pluck, shareReplay, startWith, switchMap, take } from 'rxjs/operators'; @@ -89,7 +89,7 @@ export class PartyRoutingRulesetComponent { ); constructor( - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private partyRoutingRulesetService: PartyRoutingRulesetService, private router: Router, private route: ActivatedRoute, @@ -104,7 +104,7 @@ export class PartyRoutingRulesetComponent { .pipe( take(1), switchMap(([partyID, refID]) => - this.baseDialogService + this.dialogService .open(InitializeRoutingRulesDialogComponent, { partyID, refID }) .afterClosed() ), @@ -128,7 +128,7 @@ export class PartyRoutingRulesetComponent { .pipe( take(1), switchMap(([refID, shops, wallets, type, partyID]) => - this.baseDialogService + this.dialogService .open(AddPartyRoutingRuleDialogComponent, { refID, shops, @@ -142,7 +142,7 @@ export class PartyRoutingRulesetComponent { ) .subscribe({ next: (res) => { - if (res.status === BaseDialogResponseStatus.Success) { + if (res.status === DialogResponseStatus.Success) { this.partyRoutingRulesetService.reload(); } }, diff --git a/src/app/sections/routing-rules/routing-rules-list/routing-rules-list.component.ts b/src/app/sections/routing-rules/routing-rules-list/routing-rules-list.component.ts index 9cb51bfa..8c990fa5 100644 --- a/src/app/sections/routing-rules/routing-rules-list/routing-rules-list.component.ts +++ b/src/app/sections/routing-rules/routing-rules-list/routing-rules-list.component.ts @@ -10,7 +10,7 @@ import { MatPaginator } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogResponseStatus, BaseDialogService } from '@vality/ng-core'; +import { DialogResponseStatus, DialogService } from '@vality/ng-core'; import { combineLatest, defer, ReplaySubject } from 'rxjs'; import { filter, map, shareReplay, startWith, switchMap } from 'rxjs/operators'; @@ -76,14 +76,14 @@ export class RoutingRulesListComponent(1); constructor( - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private notificationErrorService: NotificationErrorService, private routingRulesService: RoutingRulesService, private route: ActivatedRoute ) {} changeDelegateRuleset(delegateId: DelegateId) { - this.baseDialogService + this.dialogService .open(ChangeDelegateRulesetDialogComponent, { mainRulesetRefID: delegateId.parentRefId, delegateIdx: delegateId.delegateIdx, @@ -94,7 +94,7 @@ export class RoutingRulesListComponent status === BaseDialogResponseStatus.Success), + filter(({ status }) => status === DialogResponseStatus.Success), switchMap(() => this.routingRulesService.cloneDelegateRuleset({ mainRulesetRefID: delegateId.parentRefId, @@ -123,11 +123,11 @@ export class RoutingRulesListComponent status === BaseDialogResponseStatus.Success), + filter(({ status }) => status === DialogResponseStatus.Success), switchMap(() => this.routingRulesService.deleteDelegate({ mainRulesetRefID: delegateId.parentRefId, diff --git a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.html b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.html index 92f69df7..a8ab6f8e 100644 --- a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.html +++ b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.html @@ -1,4 +1,4 @@ - +
@@ -110,7 +110,7 @@
- + - -
+ + diff --git a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.ts b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.ts index 4ef38ae4..cab37b47 100644 --- a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.ts +++ b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.component.ts @@ -3,7 +3,7 @@ import { Validators, FormBuilder } from '@angular/forms'; import { UntilDestroy } from '@ngneat/until-destroy'; import { domain } from '@vality/domain-proto'; import { Predicate } from '@vality/domain-proto/domain'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { DomainStoreService } from '@cc/app/api/deprecated-damsel'; @@ -15,7 +15,7 @@ import { AddRoutingRuleDialogService, TerminalType } from './add-routing-rule-di styleUrls: ['add-routing-rule-dialog.component.scss'], providers: [AddRoutingRuleDialogService], }) -export class AddRoutingRuleDialogComponent extends BaseDialogSuperclass< +export class AddRoutingRuleDialogComponent extends DialogSuperclass< AddRoutingRuleDialogComponent, { refID: number } > { diff --git a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.module.ts b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.module.ts index 45bc40ba..6d1a2b66 100644 --- a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.module.ts +++ b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.module.ts @@ -11,7 +11,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { MetadataFormModule } from '@cc/app/shared/components/metadata-form'; @@ -34,7 +34,7 @@ import { PredicateComponent } from './predicate'; MatRadioModule, MatAutocompleteModule, MetadataFormModule, - BaseDialogModule, + DialogModule, ], declarations: [AddRoutingRuleDialogComponent, PredicateComponent, ExpanderComponent], exports: [AddRoutingRuleDialogComponent], diff --git a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.service.ts b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.service.ts index 8c644f15..58fc9563 100644 --- a/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.service.ts +++ b/src/app/sections/routing-rules/routing-ruleset/add-routing-rule-dialog/add-routing-rule-dialog.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { UntypedFormArray, UntypedFormBuilder, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; import { Predicate } from '@vality/domain-proto/domain'; -import { BaseDialogResponseStatus } from '@vality/ng-core'; +import { DialogResponseStatus } from '@vality/ng-core'; import { of } from 'rxjs'; import { startWith, switchMap, take } from 'rxjs/operators'; @@ -86,7 +86,7 @@ export class AddRoutingRuleDialogService { }) ) ) - .subscribe(() => this.dialogRef.close({ status: BaseDialogResponseStatus.Success })); + .subscribe(() => this.dialogRef.close({ status: DialogResponseStatus.Success })); } addOption() { diff --git a/src/app/sections/routing-rules/routing-ruleset/routing-ruleset.component.ts b/src/app/sections/routing-rules/routing-ruleset/routing-ruleset.component.ts index c0e2d9e1..95f88ef7 100644 --- a/src/app/sections/routing-rules/routing-ruleset/routing-ruleset.component.ts +++ b/src/app/sections/routing-rules/routing-ruleset/routing-ruleset.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { Predicate, TerminalObject } from '@vality/domain-proto/domain'; -import { BaseDialogResponseStatus, BaseDialogService } from '@vality/ng-core'; +import { DialogResponseStatus, DialogService } from '@vality/ng-core'; import { Observable } from 'rxjs'; import { first, map, pluck, shareReplay, switchMap } from 'rxjs/operators'; @@ -43,7 +43,7 @@ export class RoutingRulesetComponent { isLoading$ = this.domainStoreService.isLoading$; constructor( - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private routingRulesetService: RoutingRulesetService, private domainStoreService: DomainStoreService, private notificationErrorService: NotificationErrorService, @@ -56,15 +56,13 @@ export class RoutingRulesetComponent { .pipe( first(), switchMap((refID) => - this.baseDialogService - .open(AddRoutingRuleDialogComponent, { refID }) - .afterClosed() + this.dialogService.open(AddRoutingRuleDialogComponent, { refID }).afterClosed() ) ) .pipe(untilDestroyed(this)) .subscribe({ next: (res) => { - if (res.status === BaseDialogResponseStatus.Success) { + if (res.status === DialogResponseStatus.Success) { this.domainStoreService.forceReload(); this.notificationService.success('Routing rule successfully added'); } diff --git a/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.html b/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.html index fa23fbef..44d0650a 100644 --- a/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.html +++ b/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.html @@ -1,6 +1,6 @@ - + - + - - + + diff --git a/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.ts b/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.ts index 2c178659..51e71f76 100644 --- a/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.ts +++ b/src/app/sections/search-claims/components/create-claim-dialog/create-claim-dialog.component.ts @@ -2,7 +2,7 @@ import { Component, Injector } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { BehaviorSubject } from 'rxjs'; import { ClaimManagementService } from '@cc/app/api/claim-management'; @@ -15,7 +15,7 @@ import { progressTo } from '@cc/utils'; selector: 'cc-create-claim-dialog', templateUrl: './create-claim-dialog.component.html', }) -export class CreateClaimDialogComponent extends BaseDialogSuperclass< +export class CreateClaimDialogComponent extends DialogSuperclass< CreateClaimDialogComponent, { partyId: string } > { diff --git a/src/app/sections/search-claims/search-claims.component.html b/src/app/sections/search-claims/search-claims.component.html index 16a181b8..5ff5cfe7 100644 --- a/src/app/sections/search-claims/search-claims.component.html +++ b/src/app/sections/search-claims/search-claims.component.html @@ -1,9 +1,9 @@

Claims

- + - +
diff --git a/src/app/sections/search-claims/search-claims.component.ts b/src/app/sections/search-claims/search-claims.component.ts index 1f35ccb5..38a5d8d4 100644 --- a/src/app/sections/search-claims/search-claims.component.ts +++ b/src/app/sections/search-claims/search-claims.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { MatSnackBar } from '@angular/material/snack-bar'; import { PartyID } from '@vality/domain-proto/domain'; -import { BaseDialogService, cleanPrimitiveProps, clean } from '@vality/ng-core'; +import { DialogService, cleanPrimitiveProps, clean } from '@vality/ng-core'; import { ClaimSearchForm } from '@cc/app/shared/components'; @@ -21,7 +21,7 @@ export class SearchClaimsComponent implements OnInit { constructor( private searchClaimService: SearchClaimsService, private snackBar: MatSnackBar, - private baseDialogService: BaseDialogService + private dialogService: DialogService ) {} ngOnInit(): void { @@ -42,6 +42,6 @@ export class SearchClaimsComponent implements OnInit { } create() { - this.baseDialogService.open(CreateClaimDialogComponent, { partyId: this.selectedPartyId }); + this.dialogService.open(CreateClaimDialogComponent, { partyId: this.selectedPartyId }); } } diff --git a/src/app/sections/search-claims/search-claims.module.ts b/src/app/sections/search-claims/search-claims.module.ts index 788885df..eb41b9f0 100644 --- a/src/app/sections/search-claims/search-claims.module.ts +++ b/src/app/sections/search-claims/search-claims.module.ts @@ -14,7 +14,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; -import { ActionsModule, BaseDialogModule } from '@vality/ng-core'; +import { ActionsModule, DialogModule } from '@vality/ng-core'; import { ClaimSearchFormModule } from '@cc/app/shared/components'; import { MerchantFieldModule } from '@cc/app/shared/components/merchant-field'; @@ -53,7 +53,7 @@ import { SearchTableComponent } from './search-table/search-table.component'; ThriftPipesModule, TableModule, ActionsModule, - BaseDialogModule, + DialogModule, MerchantFieldModule, ], declarations: [ diff --git a/src/app/sections/shop-details/shop-details.component.html b/src/app/sections/shop-details/shop-details.component.html index 067d35be..6e0c0efc 100644 --- a/src/app/sections/shop-details/shop-details.component.html +++ b/src/app/sections/shop-details/shop-details.component.html @@ -31,12 +31,12 @@
- + - +
diff --git a/src/app/sections/shop-details/shop-details.component.ts b/src/app/sections/shop-details/shop-details.component.ts index e170bf0a..e7de1ec1 100644 --- a/src/app/sections/shop-details/shop-details.component.ts +++ b/src/app/sections/shop-details/shop-details.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { UntilDestroy } from '@ngneat/until-destroy'; -import { BaseDialogService, BaseDialogResponseStatus } from '@vality/ng-core'; +import { DialogService, DialogResponseStatus } from '@vality/ng-core'; import { combineLatest, switchMap, from } from 'rxjs'; import { pluck, filter, withLatestFrom, first, map } from 'rxjs/operators'; @@ -33,7 +33,7 @@ export class ShopDetailsComponent { private fetchShopService: FetchShopService, private route: ActivatedRoute, private partyManagementService: PartyManagementService, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private notificationErrorService: NotificationErrorService, private notificationService: NotificationService, private domainMetadataViewExtensionsService: DomainMetadataViewExtensionsService @@ -48,7 +48,7 @@ export class ShopDetailsComponent { .pipe( first(), switchMap((shop) => - this.baseDialogService + this.dialogService .open(ConfirmActionDialogComponent, { title: getUnionKey(shop.blocking) === 'unblocked' @@ -58,7 +58,7 @@ export class ShopDetailsComponent { }) .afterClosed() ), - filter((r) => r.status === BaseDialogResponseStatus.Success), + filter((r) => r.status === DialogResponseStatus.Success), withLatestFrom(this.shop$, this.partyID$), switchMap(([{ data }, shop, partyID]) => getUnionKey(shop.blocking) === 'unblocked' @@ -82,7 +82,7 @@ export class ShopDetailsComponent { .pipe( first(), switchMap((shop) => - this.baseDialogService + this.dialogService .open(ConfirmActionDialogComponent, { title: getUnionKey(shop.suspension) === 'active' @@ -91,7 +91,7 @@ export class ShopDetailsComponent { }) .afterClosed() ), - filter((r) => r.status === BaseDialogResponseStatus.Success), + filter((r) => r.status === DialogResponseStatus.Success), withLatestFrom(this.shop$, this.partyID$), switchMap(([, shop, partyID]) => getUnionKey(shop.suspension) === 'active' diff --git a/src/app/sections/sources/create-source/create-source.component.html b/src/app/sections/sources/create-source/create-source.component.html index eea12e34..bf56a60a 100644 --- a/src/app/sections/sources/create-source/create-source.component.html +++ b/src/app/sections/sources/create-source/create-source.component.html @@ -1,13 +1,13 @@ - + - + - - + + diff --git a/src/app/sections/sources/create-source/create-source.component.ts b/src/app/sections/sources/create-source/create-source.component.ts index 25df9861..f5819e61 100644 --- a/src/app/sections/sources/create-source/create-source.component.ts +++ b/src/app/sections/sources/create-source/create-source.component.ts @@ -1,7 +1,7 @@ import { Component, Injector } from '@angular/core'; import { FormControl } from '@angular/forms'; import { ThriftAstMetadata } from '@vality/fistful-proto'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { from } from 'rxjs'; import { FistfulAdminService } from '../../../api/fistful-admin'; @@ -12,7 +12,7 @@ import { NotificationErrorService } from '../../../shared/services/notification- selector: 'cc-create-source', templateUrl: './create-source.component.html', }) -export class CreateSourceComponent extends BaseDialogSuperclass { +export class CreateSourceComponent extends DialogSuperclass { control = new FormControl(); metadata$ = from( import('@vality/fistful-proto/metadata.json').then((m) => m.default as ThriftAstMetadata[]) diff --git a/src/app/sections/sources/sources.component.html b/src/app/sections/sources/sources.component.html index cd6b60da..e6ffef6a 100644 --- a/src/app/sections/sources/sources.component.html +++ b/src/app/sections/sources/sources.component.html @@ -1,9 +1,9 @@

Sources

- + - +
+
Use ID from withdrawal @@ -23,7 +23,7 @@ mode="determinate" >
- + - - + +
diff --git a/src/app/sections/withdrawals/components/create-adjustment-dialog/create-adjustment-dialog.component.ts b/src/app/sections/withdrawals/components/create-adjustment-dialog/create-adjustment-dialog.component.ts index 28c8b899..5b0bfdce 100644 --- a/src/app/sections/withdrawals/components/create-adjustment-dialog/create-adjustment-dialog.component.ts +++ b/src/app/sections/withdrawals/components/create-adjustment-dialog/create-adjustment-dialog.component.ts @@ -4,7 +4,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { ChangeRequest } from '@vality/fistful-proto/deposit_adjustment'; import { StatWithdrawal } from '@vality/fistful-proto/fistful_stat'; import { ExternalID } from '@vality/fistful-proto/withdrawal_adjustment'; -import { BaseDialogResponseStatus, BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass } from '@vality/ng-core'; import { combineLatest, from, of } from 'rxjs'; import { catchError, finalize } from 'rxjs/operators'; import * as short from 'short-uuid'; @@ -17,7 +17,7 @@ import { NotificationErrorService } from '@cc/app/shared/services/notification-e @Component({ templateUrl: './create-adjustment-dialog.component.html', }) -export class CreateAdjustmentDialogComponent extends BaseDialogSuperclass< +export class CreateAdjustmentDialogComponent extends DialogSuperclass< CreateAdjustmentDialogComponent, { withdrawals: StatWithdrawal[] } > { @@ -76,7 +76,7 @@ export class CreateAdjustmentDialogComponent extends BaseDialogSuperclass< .subscribe({ next: (res) => { if (!res.includes(null)) { - this.dialogRef.close({ status: BaseDialogResponseStatus.Success }); + this.dialogRef.close({ status: DialogResponseStatus.Success }); } }, error: this.notificationErrorService.error, diff --git a/src/app/sections/withdrawals/withdrawals.component.ts b/src/app/sections/withdrawals/withdrawals.component.ts index 62b190d7..47056e7d 100644 --- a/src/app/sections/withdrawals/withdrawals.component.ts +++ b/src/app/sections/withdrawals/withdrawals.component.ts @@ -6,7 +6,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { omitBy } from '@s-libs/micro-dash'; import { PartyID } from '@vality/domain-proto/domain'; import { StatWithdrawal } from '@vality/fistful-proto/fistful_stat'; -import { BaseDialogResponseStatus, BaseDialogService } from '@vality/ng-core'; +import { DialogResponseStatus, DialogService } from '@vality/ng-core'; import { Moment } from 'moment'; import { map } from 'rxjs/operators'; @@ -78,7 +78,7 @@ export class WithdrawalsComponent implements OnInit { private fetchWithdrawalsService: FetchWithdrawalsService, private fb: FormBuilder, private qp: QueryParamsService>, - private baseDialogService: BaseDialogService, + private dialogService: DialogService, private notificationService: NotificationService, private notificationErrorService: NotificationErrorService ) {} @@ -112,13 +112,13 @@ export class WithdrawalsComponent implements OnInit { } adjustment() { - this.baseDialogService + this.dialogService .open(CreateAdjustmentDialogComponent, { withdrawals: this.selection.selected }) .afterClosed() .pipe(untilDestroyed(this)) .subscribe({ next: ({ status }) => { - if (status === BaseDialogResponseStatus.Success) { + if (status === DialogResponseStatus.Success) { this.notificationService.success(); } }, diff --git a/src/app/sections/withdrawals/withdrawals.module.ts b/src/app/sections/withdrawals/withdrawals.module.ts index 2396ec4a..a05d2627 100644 --- a/src/app/sections/withdrawals/withdrawals.module.ts +++ b/src/app/sections/withdrawals/withdrawals.module.ts @@ -12,7 +12,7 @@ import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; import { MatSortModule } from '@angular/material/sort'; import { MatTableModule } from '@angular/material/table'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { EmptySearchResultModule } from '../../../components/empty-search-result'; import { TableModule } from '../../../components/table'; @@ -43,7 +43,7 @@ import { WithdrawalsComponent } from './withdrawals.component'; TableModule, MatSortModule, MetadataFormModule, - BaseDialogModule, + DialogModule, MatFormFieldModule, MatSelectModule, MatInputModule, diff --git a/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.html b/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.html index 6f0e63d5..d9c63d76 100644 --- a/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.html +++ b/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.html @@ -1,4 +1,4 @@ - +
Action @@ -18,7 +18,7 @@ >
- + - -
+ + diff --git a/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.ts b/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.ts index 7f60b0b1..d03c0e8e 100644 --- a/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.ts +++ b/src/app/shared/components/change-chargeback-status-dialog/change-chargeback-status-dialog.component.ts @@ -6,7 +6,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatSelectModule } from '@angular/material/select'; import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy'; -import { BaseDialogSuperclass, BaseDialogModule } from '@vality/ng-core'; +import { DialogSuperclass, DialogModule } from '@vality/ng-core'; import { from, BehaviorSubject, Observable } from 'rxjs'; import { InvoicingService } from '@cc/app/api/payment-processing'; @@ -32,7 +32,7 @@ enum Action { templateUrl: './change-chargeback-status-dialog.component.html', imports: [ CommonModule, - BaseDialogModule, + DialogModule, MatButtonModule, MetadataFormModule, ReactiveFormsModule, @@ -44,7 +44,7 @@ enum Action { ], }) export class ChangeChargebackStatusDialogComponent - extends BaseDialogSuperclass< + extends DialogSuperclass< ChangeChargebackStatusDialogComponent, { id: string; paymentId: string; invoiceId: string } > diff --git a/src/app/shared/components/chargebacks/chargebacks.component.ts b/src/app/shared/components/chargebacks/chargebacks.component.ts index 4cf6e834..4f904970 100644 --- a/src/app/shared/components/chargebacks/chargebacks.component.ts +++ b/src/app/shared/components/chargebacks/chargebacks.component.ts @@ -4,7 +4,7 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatTableModule } from '@angular/material/table'; import { UntilDestroy } from '@ngneat/until-destroy'; import { InvoicePaymentChargeback } from '@vality/domain-proto/domain'; -import { BaseDialogService } from '@vality/ng-core'; +import { DialogService } from '@vality/ng-core'; import { AmountCurrencyPipe, ThriftPipesModule } from '@cc/app/shared'; import { DetailsDialogComponent } from '@cc/app/shared/components/details-dialog/details-dialog.component'; @@ -33,10 +33,10 @@ export class ChargebacksComponent { cols = new Columns('id', 'status', 'created_at', 'body', 'levy', 'stage', 'actions'); - constructor(private baseDialogService: BaseDialogService) {} + constructor(private dialogService: DialogService) {} changeStatus(id: string) { - this.baseDialogService.open(ChangeChargebackStatusDialogComponent, { + this.dialogService.open(ChangeChargebackStatusDialogComponent, { paymentId: this.paymentId, invoiceId: this.invoiceId, id, @@ -44,7 +44,7 @@ export class ChargebacksComponent { } showDetails(chargeback: InvoicePaymentChargeback) { - this.baseDialogService.open(DetailsDialogComponent, { + this.dialogService.open(DetailsDialogComponent, { title: 'Chargeback details', json: chargeback, }); diff --git a/src/app/shared/components/details-dialog/details-dialog.component.html b/src/app/shared/components/details-dialog/details-dialog.component.html index 18b59019..8c8a53e8 100644 --- a/src/app/shared/components/details-dialog/details-dialog.component.html +++ b/src/app/shared/components/details-dialog/details-dialog.component.html @@ -1,3 +1,3 @@ - + - + diff --git a/src/app/shared/components/details-dialog/details-dialog.component.ts b/src/app/shared/components/details-dialog/details-dialog.component.ts index c63a4667..53c0a61d 100644 --- a/src/app/shared/components/details-dialog/details-dialog.component.ts +++ b/src/app/shared/components/details-dialog/details-dialog.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { BaseDialogSuperclass, BaseDialogModule, DEFAULT_DIALOG_CONFIG } from '@vality/ng-core'; +import { DialogSuperclass, DialogModule, DEFAULT_DIALOG_CONFIG } from '@vality/ng-core'; import { JsonViewerModule } from '@cc/app/shared/components/json-viewer'; @@ -7,9 +7,9 @@ import { JsonViewerModule } from '@cc/app/shared/components/json-viewer'; standalone: true, selector: 'cc-details-dialog', templateUrl: './details-dialog.component.html', - imports: [BaseDialogModule, JsonViewerModule], + imports: [DialogModule, JsonViewerModule], }) -export class DetailsDialogComponent extends BaseDialogSuperclass< +export class DetailsDialogComponent extends DialogSuperclass< DetailsDialogComponent, { title?: string; json: unknown } > { diff --git a/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.html b/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.html index 641dbfed..f0b0aebb 100644 --- a/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.html +++ b/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.html @@ -1,4 +1,4 @@ - +
@@ -72,7 +72,7 @@
- + - -
+ + diff --git a/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.ts b/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.ts index 42f50864..4ef901d7 100644 --- a/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.ts +++ b/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, OnInit, Injector } from '@angular/core'; import { magista } from '@vality/magista-proto'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import { DomainStoreService } from '@cc/app/api/deprecated-damsel'; @@ -14,11 +14,7 @@ import { OtherFiltersDialogService } from './other-filters-dialog.service'; providers: [OtherFiltersDialogService], }) export class OtherFiltersDialogComponent - extends BaseDialogSuperclass< - OtherFiltersDialogComponent, - SearchFiltersParams, - SearchFiltersParams - > + extends DialogSuperclass implements OnInit { paymentStatuses = getEnumKeyValues(magista.InvoicePaymentStatus); diff --git a/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.module.ts b/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.module.ts index 5ba92d96..61ad9cba 100644 --- a/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.module.ts +++ b/src/app/shared/components/payments-search-filters/payments-other-search-filters/other-filters-dialog/other-filters-dialog.module.ts @@ -11,7 +11,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { OtherFiltersDialogComponent } from './other-filters-dialog.component'; @@ -29,7 +29,7 @@ import { OtherFiltersDialogComponent } from './other-filters-dialog.component'; MatDividerModule, FlexLayoutModule, MatSelectModule, - BaseDialogModule, + DialogModule, ], declarations: [OtherFiltersDialogComponent], exports: [OtherFiltersDialogComponent], diff --git a/src/app/shared/components/payments-search-filters/payments-other-search-filters/payments-other-search-filters.service.ts b/src/app/shared/components/payments-search-filters/payments-other-search-filters/payments-other-search-filters.service.ts index a22afcdb..79f7b573 100644 --- a/src/app/shared/components/payments-search-filters/payments-other-search-filters/payments-other-search-filters.service.ts +++ b/src/app/shared/components/payments-search-filters/payments-other-search-filters/payments-other-search-filters.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { BaseDialogService, BaseDialogResponseStatus } from '@vality/ng-core'; +import { DialogService, DialogResponseStatus } from '@vality/ng-core'; import { ReplaySubject } from 'rxjs'; import { filter, map, shareReplay, switchMap, first } from 'rxjs/operators'; @@ -41,7 +41,7 @@ export class PaymentsOtherSearchFiltersService { shareReplay(1) ); - constructor(private baseDialogService: BaseDialogService) {} + constructor(private dialogService: DialogService) {} init(params: SearchFiltersParams) { this.formParams.next(searchParamsToFormParams(params)); @@ -52,9 +52,9 @@ export class PaymentsOtherSearchFiltersService { .pipe( first(), switchMap((data) => - this.baseDialogService.open(OtherFiltersDialogComponent, data).afterClosed() + this.dialogService.open(OtherFiltersDialogComponent, data).afterClosed() ), - filter(({ status }) => status === BaseDialogResponseStatus.Success), + filter(({ status }) => status === DialogResponseStatus.Success), untilDestroyed(this) ) .subscribe(({ data }) => this.formParams.next(data)); diff --git a/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.html b/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.html index 372c3ef7..50abccac 100644 --- a/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.html +++ b/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.html @@ -1,4 +1,4 @@ - @@ -9,7 +9,7 @@ namespace="payment_processing" type="InvoicePaymentAdjustmentParams" > - + - - + + diff --git a/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.ts b/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.ts index 7084a303..d53e73fb 100644 --- a/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.ts +++ b/src/app/shared/components/payments-searcher/create-payment-adjustment/create-payment-adjustment.component.ts @@ -3,7 +3,7 @@ import { FormControl } from '@angular/forms'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { InvoicePaymentAdjustmentParams } from '@vality/domain-proto/payment_processing'; import { StatPayment } from '@vality/magista-proto/magista'; -import { BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogSuperclass } from '@vality/ng-core'; import chunk from 'lodash-es/chunk'; import { BehaviorSubject, from, concatMap, of, forkJoin } from 'rxjs'; import { catchError, finalize } from 'rxjs/operators'; @@ -19,7 +19,7 @@ import { NotificationErrorService } from '../../../services/notification-error'; selector: 'cc-create-payment-adjustment', templateUrl: './create-payment-adjustment.component.html', }) -export class CreatePaymentAdjustmentComponent extends BaseDialogSuperclass< +export class CreatePaymentAdjustmentComponent extends DialogSuperclass< CreatePaymentAdjustmentComponent, { payments: StatPayment[] }, { withError?: { payment: StatPayment; error: any }[] } diff --git a/src/app/shared/components/payments-searcher/payments-searcher.component.html b/src/app/shared/components/payments-searcher/payments-searcher.component.html index e513e1ac..24ddc41b 100644 --- a/src/app/shared/components/payments-searcher/payments-searcher.component.html +++ b/src/app/shared/components/payments-searcher/payments-searcher.component.html @@ -10,7 +10,7 @@ - + - + { - if (res.status === BaseDialogResponseStatus.Success) { + if (res.status === DialogResponseStatus.Success) { this.searchParamsChanges(); this.selectedPayments = []; } else if (res.data?.withError?.length) { diff --git a/src/app/shared/components/payments-searcher/payments-searcher.module.ts b/src/app/shared/components/payments-searcher/payments-searcher.module.ts index 2451ee9e..6a081b3f 100644 --- a/src/app/shared/components/payments-searcher/payments-searcher.module.ts +++ b/src/app/shared/components/payments-searcher/payments-searcher.module.ts @@ -11,7 +11,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatMenuModule } from '@angular/material/menu'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatTableModule } from '@angular/material/table'; -import { ActionsModule, BaseDialogModule } from '@vality/ng-core'; +import { ActionsModule, DialogModule } from '@vality/ng-core'; import { EmptySearchResultModule } from '@cc/components/empty-search-result'; @@ -45,7 +45,7 @@ import { PaymentsSearcherComponent } from './payments-searcher.component'; PaymentsOtherSearchFiltersModule, EmptySearchResultModule, ActionsModule, - BaseDialogModule, + DialogModule, MetadataFormModule, ], declarations: [PaymentsSearcherComponent, CreatePaymentAdjustmentComponent], diff --git a/src/app/shared/components/thrift-editor/thrift-editor.component.ts b/src/app/shared/components/thrift-editor/thrift-editor.component.ts index b78786cb..5f1795de 100644 --- a/src/app/shared/components/thrift-editor/thrift-editor.component.ts +++ b/src/app/shared/components/thrift-editor/thrift-editor.component.ts @@ -1,7 +1,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; import { ValidationErrors } from '@angular/forms'; import { ThriftAstMetadata } from '@vality/domain-proto'; -import { BaseDialogService, BaseDialogResponseStatus } from '@vality/ng-core'; +import { DialogService, DialogResponseStatus } from '@vality/ng-core'; import { merge, defer, of, Subject } from 'rxjs'; import { map, filter, shareReplay } from 'rxjs/operators'; @@ -51,7 +51,7 @@ export class ThriftEditorComponent extends ValidatedFormControlSuperclass private updateFile$ = new Subject(); private editorError: unknown = null; - constructor(private baseDialogService: BaseDialogService) { + constructor(private dialogService: DialogService) { super(); } @@ -89,10 +89,10 @@ export class ThriftEditorComponent extends ValidatedFormControlSuperclass } reset() { - this.baseDialogService + this.dialogService .open(ConfirmActionDialogComponent, { title: 'Reset changes' }) .afterClosed() - .pipe(filter(({ status }) => status === BaseDialogResponseStatus.Success)) + .pipe(filter(({ status }) => status === DialogResponseStatus.Success)) .subscribe(() => { this.control.reset(this.defaultValue); this.editorError = null; diff --git a/src/components/confirm-action-dialog/confirm-action-dialog.component.html b/src/components/confirm-action-dialog/confirm-action-dialog.component.html index f42d360f..3107288f 100644 --- a/src/components/confirm-action-dialog/confirm-action-dialog.component.html +++ b/src/components/confirm-action-dialog/confirm-action-dialog.component.html @@ -1,4 +1,4 @@ - @@ -6,10 +6,10 @@ Reason - + - - + + diff --git a/src/components/confirm-action-dialog/confirm-action-dialog.component.ts b/src/components/confirm-action-dialog/confirm-action-dialog.component.ts index c3f2d166..a2f37016 100644 --- a/src/components/confirm-action-dialog/confirm-action-dialog.component.ts +++ b/src/components/confirm-action-dialog/confirm-action-dialog.component.ts @@ -1,13 +1,13 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { BaseDialogResponseStatus, BaseDialogSuperclass } from '@vality/ng-core'; +import { DialogResponseStatus, DialogSuperclass } from '@vality/ng-core'; @Component({ selector: 'cc-confirm-action-dialog', templateUrl: 'confirm-action-dialog.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ConfirmActionDialogComponent extends BaseDialogSuperclass< +export class ConfirmActionDialogComponent extends DialogSuperclass< ConfirmActionDialogComponent, { title?: string; confirmLabel?: string; hasReason?: boolean } | void, { reason?: string } @@ -15,12 +15,12 @@ export class ConfirmActionDialogComponent extends BaseDialogSuperclass< control = new FormControl(''); cancel() { - this.dialogRef.close({ status: BaseDialogResponseStatus.Cancelled }); + this.dialogRef.close({ status: DialogResponseStatus.Cancelled }); } confirm() { this.dialogRef.close({ - status: BaseDialogResponseStatus.Success, + status: DialogResponseStatus.Success, data: this.dialogData && this.dialogData.hasReason ? { reason: this.control.value } diff --git a/src/components/confirm-action-dialog/confirm-action-dialog.module.ts b/src/components/confirm-action-dialog/confirm-action-dialog.module.ts index ba02d46f..79765758 100644 --- a/src/components/confirm-action-dialog/confirm-action-dialog.module.ts +++ b/src/components/confirm-action-dialog/confirm-action-dialog.module.ts @@ -6,7 +6,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatDialogModule } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; -import { BaseDialogModule } from '@vality/ng-core'; +import { DialogModule } from '@vality/ng-core'; import { ConfirmActionDialogComponent } from './confirm-action-dialog.component'; @@ -15,7 +15,7 @@ import { ConfirmActionDialogComponent } from './confirm-action-dialog.component' MatDialogModule, MatButtonModule, FlexLayoutModule, - BaseDialogModule, + DialogModule, MatFormFieldModule, CommonModule, MatInputModule, diff --git a/tsconfig.json b/tsconfig.json index dedc8ba4..132e6ee8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ "skipLibCheck": false, "paths": { "@cc/*": ["src/*"], - "@vality/ng-core": ["dist/ng-core"] + // necessary for local work with the library (ng-core), so that the node does not use the second angular from the local library node_modules + "@angular/*": ["./node_modules/@angular/*"] }, "useDefineForClassFields": false },