@techextensor/tab-core-utility 2.1.5 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +92 -0
- package/README.md +7 -0
- package/jest.config.ts +22 -0
- package/ng-package.json +7 -0
- package/package.json +18 -31
- package/project.json +42 -0
- package/{index.d.ts → src/index.ts} +77 -53
- package/src/lib/tab-core-utility/app/constants/api-constants.ts +33 -0
- package/src/lib/tab-core-utility/app/constants/common.ts +34 -0
- package/src/lib/tab-core-utility/app/constants/error-messages.ts +21 -0
- package/src/lib/tab-core-utility/app/constants/storage-constants.ts +17 -0
- package/src/lib/tab-core-utility/app/crud/tab-delete.service.ts +144 -0
- package/src/lib/tab-core-utility/app/crud/tab-get.service.ts +160 -0
- package/src/lib/tab-core-utility/app/crud/tab-insert.service.ts +75 -0
- package/src/lib/tab-core-utility/app/crud/tab-update.service.ts +105 -0
- package/src/lib/tab-core-utility/app/crud/tab-workflow.service.ts +39 -0
- package/src/lib/tab-core-utility/app/enums/controllers.enum.ts +24 -0
- package/src/lib/tab-core-utility/app/enums/dsq.enum.ts +46 -0
- package/src/lib/tab-core-utility/app/enums/permission.enum.ts +18 -0
- package/src/lib/tab-core-utility/app/enums/query.enum.ts +12 -0
- package/src/lib/tab-core-utility/app/enums/workflow.enum.ts +35 -0
- package/src/lib/tab-core-utility/app/helpers/common/app.helpers.ts +65 -0
- package/src/lib/tab-core-utility/app/helpers/common/dsq.helpers.ts +80 -0
- package/src/lib/tab-core-utility/app/helpers/common/req-res.helpers.ts +75 -0
- package/src/lib/tab-core-utility/app/helpers/common/where-clause.helpers.ts +262 -0
- package/src/lib/tab-core-utility/app/helpers/screen/forms.helpers.ts +33 -0
- package/src/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.ts +88 -0
- package/src/lib/tab-core-utility/app/helpers/screen/grid.helpers.ts +113 -0
- package/src/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.ts +74 -0
- package/src/lib/tab-core-utility/app/helpers/screen/plugin.helpers.ts +52 -0
- package/src/lib/tab-core-utility/app/helpers/screen/screen.helpers.ts +20 -0
- package/{lib/tab-core-utility/app/interfaces/auth.interface.d.ts → src/lib/tab-core-utility/app/interfaces/auth.interface.ts} +18 -15
- package/src/lib/tab-core-utility/app/interfaces/common-api.interface.ts +27 -0
- package/src/lib/tab-core-utility/app/interfaces/grid.interface.ts +118 -0
- package/src/lib/tab-core-utility/app/interfaces/orgInfo.interface.ts +34 -0
- package/src/lib/tab-core-utility/app/interfaces/schema.interface.ts +11 -0
- package/src/lib/tab-core-utility/app/interfaces/user.interface.ts +91 -0
- package/src/lib/tab-core-utility/app/models/api-query.class.ts +92 -0
- package/src/lib/tab-core-utility/app/models/app-object.class.ts +87 -0
- package/src/lib/tab-core-utility/app/models/common.class.ts +30 -0
- package/src/lib/tab-core-utility/app/models/data-source-queries.class.ts +114 -0
- package/src/lib/tab-core-utility/app/utils/filter.util.ts +78 -0
- package/src/lib/tab-core-utility/app/utils/form-builder.util.ts +31 -0
- package/src/lib/tab-core-utility/app/utils/json.util.ts +137 -0
- package/src/lib/tab-core-utility/app/utils/operators.util.ts +129 -0
- package/src/lib/tab-core-utility/app/utils/req-res.util.ts +189 -0
- package/src/lib/tab-core-utility/app/utils/tab-app.util.ts +131 -0
- package/src/lib/tab-core-utility/auth/auth.service.spec.ts +167 -0
- package/src/lib/tab-core-utility/auth/auth.service.ts +91 -0
- package/src/lib/tab-core-utility/auth/idb-storage.service.ts +77 -0
- package/src/lib/tab-core-utility/auth/local-storage.service.spec.ts +47 -0
- package/src/lib/tab-core-utility/auth/local-storage.service.ts +46 -0
- package/src/lib/tab-core-utility/auth/session-storage.service.spec.ts +47 -0
- package/src/lib/tab-core-utility/auth/session-storage.service.ts +46 -0
- package/src/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.ts +32 -0
- package/src/lib/tab-core-utility/core/error-handler/error-handler.store.spec.ts +16 -0
- package/src/lib/tab-core-utility/core/error-handler/error-handler.store.ts +26 -0
- package/src/lib/tab-core-utility/core/error-handler/models/error-handler.state.ts +9 -0
- package/src/lib/tab-core-utility/core/http-client/api-url.token.ts +4 -0
- package/src/lib/tab-core-utility/core/http-client/api.service.spec.ts +18 -0
- package/src/lib/tab-core-utility/core/http-client/api.service.ts +105 -0
- package/src/lib/tab-core-utility/core/util/auth.utils.ts +22 -0
- package/src/lib/tab-core-utility/store/auth.store.ts +54 -0
- package/src/lib/tab-core-utility/store/orginfo.store.ts +57 -0
- package/src/lib/tab-core-utility/store/schema.store.ts +85 -0
- package/src/test-setup.ts +8 -0
- package/tsconfig.json +29 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +7 -0
- package/tsconfig.spec.json +16 -0
- package/esm2022/index.mjs +0 -64
- package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +0 -33
- package/esm2022/lib/tab-core-utility/app/constants/common.mjs +0 -23
- package/esm2022/lib/tab-core-utility/app/constants/error-messages.mjs +0 -13
- package/esm2022/lib/tab-core-utility/app/constants/storage-constants.mjs +0 -15
- package/esm2022/lib/tab-core-utility/app/crud/tab-delete.service.mjs +0 -145
- package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +0 -131
- package/esm2022/lib/tab-core-utility/app/crud/tab-insert.service.mjs +0 -77
- package/esm2022/lib/tab-core-utility/app/crud/tab-update.service.mjs +0 -105
- package/esm2022/lib/tab-core-utility/app/crud/tab-workflow.service.mjs +0 -43
- package/esm2022/lib/tab-core-utility/app/enums/controllers.enum.mjs +0 -26
- package/esm2022/lib/tab-core-utility/app/enums/dsq.enum.mjs +0 -48
- package/esm2022/lib/tab-core-utility/app/enums/permission.enum.mjs +0 -20
- package/esm2022/lib/tab-core-utility/app/enums/query.enum.mjs +0 -14
- package/esm2022/lib/tab-core-utility/app/enums/workflow.enum.mjs +0 -37
- package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +0 -68
- package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +0 -70
- package/esm2022/lib/tab-core-utility/app/helpers/common/req-res.helpers.mjs +0 -64
- package/esm2022/lib/tab-core-utility/app/helpers/common/where-clause.helpers.mjs +0 -208
- package/esm2022/lib/tab-core-utility/app/helpers/screen/forms.helpers.mjs +0 -38
- package/esm2022/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.mjs +0 -78
- package/esm2022/lib/tab-core-utility/app/helpers/screen/grid.helpers.mjs +0 -112
- package/esm2022/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.mjs +0 -77
- package/esm2022/lib/tab-core-utility/app/helpers/screen/plugin.helpers.mjs +0 -55
- package/esm2022/lib/tab-core-utility/app/helpers/screen/screen.helpers.mjs +0 -26
- package/esm2022/lib/tab-core-utility/app/interfaces/auth.interface.mjs +0 -2
- package/esm2022/lib/tab-core-utility/app/interfaces/common-api.interface.mjs +0 -2
- package/esm2022/lib/tab-core-utility/app/interfaces/grid.interface.mjs +0 -3
- package/esm2022/lib/tab-core-utility/app/interfaces/orgInfo.interface.mjs +0 -2
- package/esm2022/lib/tab-core-utility/app/interfaces/schema.interface.mjs +0 -2
- package/esm2022/lib/tab-core-utility/app/interfaces/user.interface.mjs +0 -2
- package/esm2022/lib/tab-core-utility/app/models/api-query.class.mjs +0 -47
- package/esm2022/lib/tab-core-utility/app/models/app-object.class.mjs +0 -30
- package/esm2022/lib/tab-core-utility/app/models/common.class.mjs +0 -12
- package/esm2022/lib/tab-core-utility/app/models/data-source-queries.class.mjs +0 -31
- package/esm2022/lib/tab-core-utility/app/utils/filter.util.mjs +0 -75
- package/esm2022/lib/tab-core-utility/app/utils/form-builder.util.mjs +0 -39
- package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +0 -138
- package/esm2022/lib/tab-core-utility/app/utils/operators.util.mjs +0 -129
- package/esm2022/lib/tab-core-utility/app/utils/req-res.util.mjs +0 -147
- package/esm2022/lib/tab-core-utility/app/utils/tab-app.util.mjs +0 -99
- package/esm2022/lib/tab-core-utility/auth/auth.service.mjs +0 -74
- package/esm2022/lib/tab-core-utility/auth/idb-storage.service.mjs +0 -69
- package/esm2022/lib/tab-core-utility/auth/local-storage.service.mjs +0 -52
- package/esm2022/lib/tab-core-utility/auth/session-storage.service.mjs +0 -52
- package/esm2022/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.mjs +0 -26
- package/esm2022/lib/tab-core-utility/core/error-handler/error-handler.store.mjs +0 -21
- package/esm2022/lib/tab-core-utility/core/error-handler/models/error-handler.state.mjs +0 -5
- package/esm2022/lib/tab-core-utility/core/http-client/api-url.token.mjs +0 -4
- package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +0 -99
- package/esm2022/lib/tab-core-utility/core/util/auth.utils.mjs +0 -21
- package/esm2022/lib/tab-core-utility/store/auth.store.mjs +0 -43
- package/esm2022/lib/tab-core-utility/store/orginfo.store.mjs +0 -42
- package/esm2022/lib/tab-core-utility/store/schema.store.mjs +0 -68
- package/esm2022/techextensor-tab-core-utility.mjs +0 -5
- package/lib/tab-core-utility/app/constants/api-constants.d.ts +0 -30
- package/lib/tab-core-utility/app/constants/common.d.ts +0 -8
- package/lib/tab-core-utility/app/constants/error-messages.d.ts +0 -6
- package/lib/tab-core-utility/app/constants/storage-constants.d.ts +0 -14
- package/lib/tab-core-utility/app/crud/tab-delete.service.d.ts +0 -51
- package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +0 -58
- package/lib/tab-core-utility/app/crud/tab-insert.service.d.ts +0 -37
- package/lib/tab-core-utility/app/crud/tab-update.service.d.ts +0 -14
- package/lib/tab-core-utility/app/crud/tab-workflow.service.d.ts +0 -20
- package/lib/tab-core-utility/app/enums/controllers.enum.d.ts +0 -24
- package/lib/tab-core-utility/app/enums/dsq.enum.d.ts +0 -42
- package/lib/tab-core-utility/app/enums/permission.enum.d.ts +0 -16
- package/lib/tab-core-utility/app/enums/query.enum.d.ts +0 -11
- package/lib/tab-core-utility/app/enums/workflow.enum.d.ts +0 -30
- package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +0 -31
- package/lib/tab-core-utility/app/helpers/common/dsq.helpers.d.ts +0 -32
- package/lib/tab-core-utility/app/helpers/common/req-res.helpers.d.ts +0 -62
- package/lib/tab-core-utility/app/helpers/common/where-clause.helpers.d.ts +0 -82
- package/lib/tab-core-utility/app/helpers/screen/forms.helpers.d.ts +0 -11
- package/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.d.ts +0 -33
- package/lib/tab-core-utility/app/helpers/screen/grid.helpers.d.ts +0 -63
- package/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.d.ts +0 -38
- package/lib/tab-core-utility/app/helpers/screen/plugin.helpers.d.ts +0 -25
- package/lib/tab-core-utility/app/helpers/screen/screen.helpers.d.ts +0 -11
- package/lib/tab-core-utility/app/interfaces/common-api.interface.d.ts +0 -24
- package/lib/tab-core-utility/app/interfaces/grid.interface.d.ts +0 -110
- package/lib/tab-core-utility/app/interfaces/orgInfo.interface.d.ts +0 -31
- package/lib/tab-core-utility/app/interfaces/schema.interface.d.ts +0 -11
- package/lib/tab-core-utility/app/interfaces/user.interface.d.ts +0 -84
- package/lib/tab-core-utility/app/models/api-query.class.d.ts +0 -69
- package/lib/tab-core-utility/app/models/app-object.class.d.ts +0 -74
- package/lib/tab-core-utility/app/models/common.class.d.ts +0 -24
- package/lib/tab-core-utility/app/models/data-source-queries.class.d.ts +0 -95
- package/lib/tab-core-utility/app/utils/filter.util.d.ts +0 -30
- package/lib/tab-core-utility/app/utils/form-builder.util.d.ts +0 -13
- package/lib/tab-core-utility/app/utils/json.util.d.ts +0 -25
- package/lib/tab-core-utility/app/utils/operators.util.d.ts +0 -21
- package/lib/tab-core-utility/app/utils/req-res.util.d.ts +0 -61
- package/lib/tab-core-utility/app/utils/tab-app.util.d.ts +0 -48
- package/lib/tab-core-utility/auth/auth.service.d.ts +0 -53
- package/lib/tab-core-utility/auth/idb-storage.service.d.ts +0 -14
- package/lib/tab-core-utility/auth/local-storage.service.d.ts +0 -22
- package/lib/tab-core-utility/auth/session-storage.service.d.ts +0 -22
- package/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.d.ts +0 -3
- package/lib/tab-core-utility/core/error-handler/error-handler.store.d.ts +0 -10
- package/lib/tab-core-utility/core/error-handler/models/error-handler.state.d.ts +0 -5
- package/lib/tab-core-utility/core/http-client/api-url.token.d.ts +0 -3
- package/lib/tab-core-utility/core/http-client/api.service.d.ts +0 -65
- package/lib/tab-core-utility/core/util/auth.utils.d.ts +0 -9
- package/lib/tab-core-utility/store/auth.store.d.ts +0 -19
- package/lib/tab-core-utility/store/orginfo.store.d.ts +0 -22
- package/lib/tab-core-utility/store/schema.store.d.ts +0 -32
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts"],
|
|
7
|
+
"extends": [
|
|
8
|
+
"plugin:@nx/angular",
|
|
9
|
+
"plugin:@angular-eslint/template/process-inline-templates"
|
|
10
|
+
],
|
|
11
|
+
"rules": {
|
|
12
|
+
"@angular-eslint/directive-selector": [
|
|
13
|
+
"error",
|
|
14
|
+
{
|
|
15
|
+
"type": "attribute",
|
|
16
|
+
"prefix": "ngl",
|
|
17
|
+
"style": "camelCase"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"@angular-eslint/component-selector": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
"type": "element",
|
|
24
|
+
"prefix": "ngl",
|
|
25
|
+
"style": "kebab-case"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"@nx/enforce-module-boundaries": [
|
|
29
|
+
"error",
|
|
30
|
+
{
|
|
31
|
+
"enforceBuildableLibDependency": true,
|
|
32
|
+
"allow": [],
|
|
33
|
+
"depConstraints": [
|
|
34
|
+
{
|
|
35
|
+
"sourceTag": "type:e2e",
|
|
36
|
+
"onlyDependOnLibsWithTags": ["type:app"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"sourceTag": "type:app",
|
|
40
|
+
"onlyDependOnLibsWithTags": ["type:feature", "type:util"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"sourceTag": "type:feature",
|
|
44
|
+
"onlyDependOnLibsWithTags": [
|
|
45
|
+
"type:data-access",
|
|
46
|
+
"type:ui",
|
|
47
|
+
"type:util"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"sourceTag": "type:ui",
|
|
52
|
+
"onlyDependOnLibsWithTags": ["type:ui", "type:util"]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"sourceTag": "type:data-access",
|
|
56
|
+
"onlyDependOnLibsWithTags": ["type:api", "type:util"]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"sourceTag": "scope:shared",
|
|
60
|
+
"onlyDependOnLibsWithTags": ["scope:shared"]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"sourceTag": "scope:tab-core-utility",
|
|
64
|
+
"onlyDependOnLibsWithTags": [
|
|
65
|
+
"scope:shared",
|
|
66
|
+
"scope:tab-core-utility"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"files": ["*.html"],
|
|
76
|
+
"extends": ["plugin:@nx/angular-template"],
|
|
77
|
+
"rules": {}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"files": ["*.json"],
|
|
81
|
+
"parser": "jsonc-eslint-parser",
|
|
82
|
+
"rules": {
|
|
83
|
+
"@nx/dependency-checks": [
|
|
84
|
+
"error",
|
|
85
|
+
{
|
|
86
|
+
"ignoredDependencies": ["tslib"]
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
package/README.md
ADDED
package/jest.config.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export default {
|
|
3
|
+
displayName: 'tab-core-utility',
|
|
4
|
+
preset: '../../jest.preset.js',
|
|
5
|
+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
|
6
|
+
coverageDirectory: '../../coverage/libs/data-access',
|
|
7
|
+
transform: {
|
|
8
|
+
'^.+\\.(ts|mjs|js|html)$': [
|
|
9
|
+
'jest-preset-angular',
|
|
10
|
+
{
|
|
11
|
+
tsconfig: '<rootDir>/tsconfig.spec.json',
|
|
12
|
+
stringifyContentPathRegex: '\\.(html|svg)$',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
|
17
|
+
snapshotSerializers: [
|
|
18
|
+
'jest-preset-angular/build/serializers/no-ng-attributes',
|
|
19
|
+
'jest-preset-angular/build/serializers/ng-snapshot',
|
|
20
|
+
'jest-preset-angular/build/serializers/html-comment',
|
|
21
|
+
],
|
|
22
|
+
};
|
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,31 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@techextensor/tab-core-utility",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^17.3.0",
|
|
6
|
-
"@angular/core": "^17.3.0",
|
|
7
|
-
"rxjs": "^7.8.1",
|
|
8
|
-
"@ngrx/signals": "^17.1.1",
|
|
9
|
-
"@angular/router": "^17.3.0"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"tslib": "^2.3.0"
|
|
13
|
-
},
|
|
14
|
-
"sideEffects": false,
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
"typings": "index.d.ts",
|
|
20
|
-
"exports": {
|
|
21
|
-
"./package.json": {
|
|
22
|
-
"default": "./package.json"
|
|
23
|
-
},
|
|
24
|
-
".": {
|
|
25
|
-
"types": "./index.d.ts",
|
|
26
|
-
"esm2022": "./esm2022/techextensor-tab-core-utility.mjs",
|
|
27
|
-
"esm": "./esm2022/techextensor-tab-core-utility.mjs",
|
|
28
|
-
"default": "./esm2022/techextensor-tab-core-utility.mjs"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@techextensor/tab-core-utility",
|
|
3
|
+
"version": "2.1.7",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^17.3.0",
|
|
6
|
+
"@angular/core": "^17.3.0",
|
|
7
|
+
"rxjs": "^7.8.1",
|
|
8
|
+
"@ngrx/signals": "^17.1.1",
|
|
9
|
+
"@angular/router": "^17.3.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"tslib": "^2.3.0"
|
|
13
|
+
},
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tab-core-utility",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "libs/data-access/src",
|
|
5
|
+
"prefix": "ngl",
|
|
6
|
+
"projectType": "library",
|
|
7
|
+
"tags": [],
|
|
8
|
+
"targets": {
|
|
9
|
+
"build": {
|
|
10
|
+
"executor": "@nx/angular:ng-packagr-lite",
|
|
11
|
+
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
|
12
|
+
"options": {
|
|
13
|
+
"project": "libs/data-access/ng-package.json"
|
|
14
|
+
},
|
|
15
|
+
"configurations": {
|
|
16
|
+
"production": {
|
|
17
|
+
"tsConfig": "libs/data-access/tsconfig.lib.prod.json"
|
|
18
|
+
},
|
|
19
|
+
"development": {
|
|
20
|
+
"tsConfig": "libs/data-access/tsconfig.lib.json"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"defaultConfiguration": "production"
|
|
24
|
+
},
|
|
25
|
+
"test": {
|
|
26
|
+
"executor": "@nx/jest:jest",
|
|
27
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
28
|
+
"options": {
|
|
29
|
+
"jestConfig": "libs/data-access/jest.config.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"lint": {
|
|
33
|
+
"executor": "@nx/eslint:lint"
|
|
34
|
+
},
|
|
35
|
+
"release": {
|
|
36
|
+
"executor": "nx-release:build-update-publish",
|
|
37
|
+
"options": {
|
|
38
|
+
"libName": "tab-core-utility"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,53 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './lib/tab-core-utility/app/constants/
|
|
3
|
-
export * from './lib/tab-core-utility/app/constants/
|
|
4
|
-
export * from './lib/tab-core-utility/app/constants/
|
|
5
|
-
export * from './lib/tab-core-utility/app/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export * from './lib/tab-core-utility/app/crud/tab-
|
|
9
|
-
export * from './lib/tab-core-utility/app/crud/tab-
|
|
10
|
-
export * from './lib/tab-core-utility/app/
|
|
11
|
-
export * from './lib/tab-core-utility/app/
|
|
12
|
-
export * from './lib/tab-core-utility/app/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export * from './lib/tab-core-utility/app/
|
|
16
|
-
export * from './lib/tab-core-utility/app/
|
|
17
|
-
export * from './lib/tab-core-utility/app/
|
|
18
|
-
export * from './lib/tab-core-utility/app/
|
|
19
|
-
export * from './lib/tab-core-utility/app/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export * from './lib/tab-core-utility/app/helpers/
|
|
23
|
-
export * from './lib/tab-core-utility/app/helpers/
|
|
24
|
-
export * from './lib/tab-core-utility/app/helpers/
|
|
25
|
-
export * from './lib/tab-core-utility/app/
|
|
26
|
-
|
|
27
|
-
export * from './lib/tab-core-utility/app/
|
|
28
|
-
export * from './lib/tab-core-utility/app/
|
|
29
|
-
export * from './lib/tab-core-utility/app/
|
|
30
|
-
export * from './lib/tab-core-utility/app/
|
|
31
|
-
export * from './lib/tab-core-utility/app/
|
|
32
|
-
export * from './lib/tab-core-utility/app/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export * from './lib/tab-core-utility/app/
|
|
36
|
-
export * from './lib/tab-core-utility/app/
|
|
37
|
-
export * from './lib/tab-core-utility/app/
|
|
38
|
-
export * from './lib/tab-core-utility/app/
|
|
39
|
-
export * from './lib/tab-core-utility/app/
|
|
40
|
-
export * from './lib/tab-core-utility/app/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export * from './lib/tab-core-utility/
|
|
44
|
-
export * from './lib/tab-core-utility/
|
|
45
|
-
export * from './lib/tab-core-utility/
|
|
46
|
-
export * from './lib/tab-core-utility/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export * from './lib/tab-core-utility/
|
|
50
|
-
export * from './lib/tab-core-utility/
|
|
51
|
-
export * from './lib/tab-core-utility/
|
|
52
|
-
export * from './lib/tab-core-utility/
|
|
53
|
-
export * from './lib/tab-core-utility/
|
|
1
|
+
// App / constants
|
|
2
|
+
export * from './lib/tab-core-utility/app/constants/api-constants';
|
|
3
|
+
export * from './lib/tab-core-utility/app/constants/common';
|
|
4
|
+
export * from './lib/tab-core-utility/app/constants/error-messages';
|
|
5
|
+
export * from './lib/tab-core-utility/app/constants/storage-constants';
|
|
6
|
+
|
|
7
|
+
// App / crud
|
|
8
|
+
export * from './lib/tab-core-utility/app/crud/tab-get.service';
|
|
9
|
+
export * from './lib/tab-core-utility/app/crud/tab-insert.service';
|
|
10
|
+
export * from './lib/tab-core-utility/app/crud/tab-delete.service';
|
|
11
|
+
export * from './lib/tab-core-utility/app/crud/tab-update.service';
|
|
12
|
+
export * from './lib/tab-core-utility/app/crud/tab-workflow.service';
|
|
13
|
+
|
|
14
|
+
// App / enum
|
|
15
|
+
export * from './lib/tab-core-utility/app/enums/controllers.enum';
|
|
16
|
+
export * from './lib/tab-core-utility/app/enums/dsq.enum';
|
|
17
|
+
export * from './lib/tab-core-utility/app/enums/permission.enum';
|
|
18
|
+
export * from './lib/tab-core-utility/app/enums/query.enum';
|
|
19
|
+
export * from './lib/tab-core-utility/app/enums/workflow.enum';
|
|
20
|
+
|
|
21
|
+
// App / helpers
|
|
22
|
+
export * from './lib/tab-core-utility/app/helpers/common/app.helpers';
|
|
23
|
+
export * from './lib/tab-core-utility/app/helpers/common/dsq.helpers';
|
|
24
|
+
export * from './lib/tab-core-utility/app/helpers/common/req-res.helpers';
|
|
25
|
+
export * from './lib/tab-core-utility/app/helpers/common/where-clause.helpers';
|
|
26
|
+
|
|
27
|
+
export * from './lib/tab-core-utility/app/helpers/screen/forms.helpers';
|
|
28
|
+
export * from './lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers';
|
|
29
|
+
export * from './lib/tab-core-utility/app/helpers/screen/grid.helpers';
|
|
30
|
+
export * from './lib/tab-core-utility/app/helpers/screen/media-upload.helpers';
|
|
31
|
+
export * from './lib/tab-core-utility/app/helpers/screen/plugin.helpers';
|
|
32
|
+
export * from './lib/tab-core-utility/app/helpers/screen/screen.helpers';
|
|
33
|
+
|
|
34
|
+
// App / interfaces
|
|
35
|
+
export * from './lib/tab-core-utility/app/interfaces/auth.interface';
|
|
36
|
+
export * from './lib/tab-core-utility/app/interfaces/common-api.interface';
|
|
37
|
+
export * from './lib/tab-core-utility/app/interfaces/user.interface';
|
|
38
|
+
export * from './lib/tab-core-utility/app/interfaces/orgInfo.interface';
|
|
39
|
+
export * from './lib/tab-core-utility/app/interfaces/schema.interface';
|
|
40
|
+
export * from './lib/tab-core-utility/app/interfaces/grid.interface';
|
|
41
|
+
|
|
42
|
+
// App / models
|
|
43
|
+
export * from './lib/tab-core-utility/app/models/api-query.class';
|
|
44
|
+
export * from './lib/tab-core-utility/app/models/app-object.class';
|
|
45
|
+
export * from './lib/tab-core-utility/app/models/common.class';
|
|
46
|
+
export * from './lib/tab-core-utility/app/models/data-source-queries.class';
|
|
47
|
+
|
|
48
|
+
// App / utils
|
|
49
|
+
export * from './lib/tab-core-utility/app/utils/filter.util';
|
|
50
|
+
export * from './lib/tab-core-utility/app/utils/form-builder.util';
|
|
51
|
+
export * from './lib/tab-core-utility/app/utils/json.util';
|
|
52
|
+
export * from './lib/tab-core-utility/app/utils/operators.util';
|
|
53
|
+
export * from './lib/tab-core-utility/app/utils/req-res.util';
|
|
54
|
+
export * from './lib/tab-core-utility/app/utils/tab-app.util';
|
|
55
|
+
|
|
56
|
+
// Auth
|
|
57
|
+
export * from './lib/tab-core-utility/auth/auth.service';
|
|
58
|
+
export * from './lib/tab-core-utility/auth/local-storage.service';
|
|
59
|
+
export * from './lib/tab-core-utility/auth/session-storage.service';
|
|
60
|
+
export * from './lib/tab-core-utility/auth/idb-storage.service';
|
|
61
|
+
|
|
62
|
+
// Core
|
|
63
|
+
export * from './lib/tab-core-utility/core/error-handler/error-handler-interceptor.service';
|
|
64
|
+
export * from './lib/tab-core-utility/core/error-handler/error-handler.store';
|
|
65
|
+
export * from './lib/tab-core-utility/core/error-handler/models/error-handler.state';
|
|
66
|
+
|
|
67
|
+
export * from './lib/tab-core-utility/core/http-client/api-url.token';
|
|
68
|
+
export * from './lib/tab-core-utility/core/http-client/api.service';
|
|
69
|
+
|
|
70
|
+
export * from './lib/tab-core-utility/core/util/auth.utils';
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// store
|
|
74
|
+
|
|
75
|
+
export * from './lib/tab-core-utility/store/orginfo.store'
|
|
76
|
+
export * from './lib/tab-core-utility/store/schema.store'
|
|
77
|
+
export * from './lib/tab-core-utility/store/auth.store'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const API = {
|
|
2
|
+
applicationIdentifier: '02dPlGXCKCPy', //phoenix
|
|
3
|
+
applicationIdentifierForPMS: 'qqmXweGB1DbG', // pms
|
|
4
|
+
// endpoint: 'http://192.168.10.181:8441/api/v1/',
|
|
5
|
+
// workflowEndPoint: 'http://192.168.10.181/',
|
|
6
|
+
novuBackendUrl: 'https://novuapi.techextensor.com',
|
|
7
|
+
novuSocketUrl: 'https://novuws.techextensor.com',
|
|
8
|
+
|
|
9
|
+
insert: 'CRUD/Insert',
|
|
10
|
+
update: 'CRUD/Update',
|
|
11
|
+
delete: 'CRUD/Delete',
|
|
12
|
+
select: 'CRUD/Select',
|
|
13
|
+
getDSQ: 'CRUD/DSQ',
|
|
14
|
+
getScreen: 'Layout/GetScreen',
|
|
15
|
+
getListFromDsq: 'List/Get?dataSourceQueryId=',
|
|
16
|
+
buildApp: 'Application/BuildApp',
|
|
17
|
+
getSchema: 'Application/GetSchemaFile',
|
|
18
|
+
login: 'identity/login',
|
|
19
|
+
pluginUpload: 'Plugins/Upload',
|
|
20
|
+
getFile: 'Plugins/GetFileById',
|
|
21
|
+
getAllPluginByType: 'Plugins/GetAll',
|
|
22
|
+
templateParse: 'Template/Parse',
|
|
23
|
+
publishApp: 'Application/PublishApp',
|
|
24
|
+
getrecord: 'GetRecord',
|
|
25
|
+
rawSQL: 'CRUD/RawSQL?query=',
|
|
26
|
+
fileUpload: 'File/Upload',
|
|
27
|
+
getMediaFile: 'File/GetFile',
|
|
28
|
+
getHistory: 'GetHistory',
|
|
29
|
+
changePassword: 'identity/ChangePassword',
|
|
30
|
+
restpassword: 'identity/ResetPassword',
|
|
31
|
+
getImage: 'File/GetImage',
|
|
32
|
+
pmjayImport: 'ImportData',
|
|
33
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// import { inject } from '@angular/core';
|
|
2
|
+
import { IdbService } from '../../auth/idb-storage.service';
|
|
3
|
+
import { SessionStorageService } from '../../auth/session-storage.service';
|
|
4
|
+
import { Application } from '../models/app-object.class';
|
|
5
|
+
import { StorageConstants } from './storage-constants';
|
|
6
|
+
|
|
7
|
+
// const sessionStorageService = inject(SessionStorageService);
|
|
8
|
+
const sessionStorageService = new SessionStorageService();
|
|
9
|
+
const idbService = new IdbService();
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export const Common = {
|
|
13
|
+
applicationCode: sessionStorageService.getSessionStorage(StorageConstants.applicationCode)
|
|
14
|
+
? String(
|
|
15
|
+
sessionStorageService.getSessionStorage(StorageConstants.applicationCode)
|
|
16
|
+
)
|
|
17
|
+
: StorageConstants.TAB,
|
|
18
|
+
staticApplicationCode:'Tab_Backup',
|
|
19
|
+
tabJson: null,
|
|
20
|
+
|
|
21
|
+
appInfo: null,
|
|
22
|
+
orgId: '1B602229-57F9-4DF8-860C-586A96E5BC68',
|
|
23
|
+
staticToken:
|
|
24
|
+
'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJoYXJkaWsudGhha2thckB0ZWNoZXh0ZW5zb3IuY29tIiwianRpIjoiMDBlMzA2ZTctMjE3ZS00MzI2LTg0ZDEtNmZjY2E1NmYwMWY0IiwiZW1haWwiOiJoYXJkaWsudGhha2thckB0ZWNoZXh0ZW5zb3IuY29tIiwiaWQiOiIwYjYwMDY5ZS02ZTM4LTQ0YTUtODMyYS1lMTBmYWQ3MTUyYjYiLCJsb2NhbGVTZXR0aW5nIjoie1wiVGltZVpvbmVJZFwiOlwiSW5kaWEgU3RhbmRhcmQgVGltZVwiLFwiTG9jYWxlXCI6MCxcIkxhbmd1YWdlXCI6MCxcIkRhdGVGb3JtYXRcIjpcImRkLU1NLXl5eXlcIixcIlRpbWVGb3JtYXRcIjpcImhoOm1tOnNzIHR0XCIsXCJOdW1iZXJGb3JtYXRcIjpudWxsLFwiQ3VycmVuY3lcIjpudWxsfSIsInJvbGUiOiJBZG1pbmlzdHJhdG9yIiwiUm9sZUlkcyI6IjJjYjQzMWE2LTUxZWUtNDYzZS04NDBjLTNhMThjNWZlOTE1MCIsIm5iZiI6MTcxNDAyNTkwNSwiZXhwIjoxNzQ1NTYxOTA1LCJpYXQiOjE3MTQwMjU5MDV9.FrguHY0px3wnitfgsodTJpexFr5Fzvbx5USDBF66mQA',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
async function getLocalStorageTabData() {
|
|
29
|
+
let data:any = await idbService.getItem(StorageConstants.tabData)
|
|
30
|
+
if(data){
|
|
31
|
+
Common.tabJson= JSON.parse(data);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
getLocalStorageTabData();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const ServerErrorMessages: {
|
|
2
|
+
[key: string]: string;
|
|
3
|
+
} = {
|
|
4
|
+
DELETE_CONFLICT:
|
|
5
|
+
'The DELETE statement conflicted with the REFERENCE constraint',
|
|
6
|
+
UNIQUE_KEY_CONSTRAINT_USER: "Violation of UNIQUE KEY constraint 'U_Name'.",
|
|
7
|
+
INSUFFICIENT_ACCESS: 'Insufficient Acces',
|
|
8
|
+
CONVERSATION_FAILED_STRING_TO_UNIQUEIDENTIFIER:
|
|
9
|
+
'Conversation failed when converting from a character string to uniqueidentifier',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const UserFriendlyMessages = {
|
|
13
|
+
[ServerErrorMessages['DELETE_CONFLICT']]:
|
|
14
|
+
'Unable to Delete Record. Please check associated records and try again.',
|
|
15
|
+
[ServerErrorMessages['UNIQUE_KEY_CONSTRAINT_USER']]:
|
|
16
|
+
'Username already exist.',
|
|
17
|
+
[ServerErrorMessages['INSUFFICIENT_ACCESS']]:
|
|
18
|
+
"You don't have enough permission to perform this action.",
|
|
19
|
+
[ServerErrorMessages['CONVERSATION_FAILED_STRING_TO_UNIQUEIDENTIFIER']]:
|
|
20
|
+
'Something went wrong!',
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const StorageConstants = {
|
|
2
|
+
tabData: 'tabData',
|
|
3
|
+
formJson: 'FormJson',
|
|
4
|
+
schemaJSON: 'schemaJSON',
|
|
5
|
+
orgInfo: 'orgInfo',
|
|
6
|
+
applicationCode: 'applicationCode',
|
|
7
|
+
TAB: 'TAB',
|
|
8
|
+
userInfo: 'userInfo',
|
|
9
|
+
token: 'token',
|
|
10
|
+
staticToken: 'staticToken',
|
|
11
|
+
screenId: 'screenId',
|
|
12
|
+
editScreenQueryParam: 'editScreenQueryParam',
|
|
13
|
+
layoutScreenId: 'layoutScreenId',
|
|
14
|
+
tabScreen: 'tabScreen',
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
import { Injectable, inject } from "@angular/core";
|
|
4
|
+
import { DSQHelper } from "../helpers/common/dsq.helpers";
|
|
5
|
+
import { ScreenHelper } from "../helpers/screen/screen.helpers";
|
|
6
|
+
import { WhereClauseHelper } from "../helpers/common/where-clause.helpers";
|
|
7
|
+
import { RequestResponseHelper } from "../helpers/common/req-res.helpers";
|
|
8
|
+
import { AppObject, AppScreen } from "../models/app-object.class";
|
|
9
|
+
import { getAppObject, getAppObjectFromSystemDBTableName, getDataFromDataSourceQueryID } from "../utils/tab-app.util";
|
|
10
|
+
import { getEditRecordId, getPrimaryKeyFields } from "../utils/req-res.util";
|
|
11
|
+
import { APIDeleteQuery, APIFilterCriteria } from "../models/api-query.class";
|
|
12
|
+
import { QueryType } from "../enums/query.enum";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@Injectable({ providedIn: 'root' })
|
|
18
|
+
export class TabDeleteService {
|
|
19
|
+
private readonly dsqHelper = inject(DSQHelper);
|
|
20
|
+
private readonly screenHelper = inject(ScreenHelper);
|
|
21
|
+
private readonly whereClauseHelper = inject(WhereClauseHelper);
|
|
22
|
+
private readonly requestResponseHelper = inject(RequestResponseHelper);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Deletes a record based on the given screen ID, data, and object ID.
|
|
26
|
+
* @param screenId The ID of the screen.
|
|
27
|
+
* @param data The data of the record to delete.
|
|
28
|
+
* @param objectIDToSave The object ID of the record to save.
|
|
29
|
+
* @returns An Observable emitting the response of the delete operation.
|
|
30
|
+
*/
|
|
31
|
+
deleteRecord(screenId: string, data: any, objectIDToSave: any) {
|
|
32
|
+
let fields;
|
|
33
|
+
let appObject: AppObject = new AppObject();
|
|
34
|
+
let crudTableName;
|
|
35
|
+
if (screenId) {
|
|
36
|
+
// Retrieve screen information and fields
|
|
37
|
+
const screen: AppScreen = this.screenHelper.getScreen(screenId);
|
|
38
|
+
const screenDataSource = getDataFromDataSourceQueryID(screen.DataSourceQuery);
|
|
39
|
+
fields = screenDataSource.Fields;
|
|
40
|
+
appObject = getAppObject(screenDataSource.ObjectID_Tosave);
|
|
41
|
+
crudTableName = appObject.SystemDBTableName;
|
|
42
|
+
}
|
|
43
|
+
if (objectIDToSave) {
|
|
44
|
+
// Retrieve fields based on object ID
|
|
45
|
+
fields = [];
|
|
46
|
+
appObject = getAppObject(objectIDToSave);
|
|
47
|
+
appObject.Fields.forEach(element => {
|
|
48
|
+
fields.push({ Field: element })
|
|
49
|
+
});
|
|
50
|
+
crudTableName = appObject.SystemDBTableName;
|
|
51
|
+
}
|
|
52
|
+
const primaryKeyFields: any = getPrimaryKeyFields(appObject);
|
|
53
|
+
if (appObject) {
|
|
54
|
+
let whereClause: any = APIFilterCriteria;
|
|
55
|
+
if (primaryKeyFields && primaryKeyFields.length > 1) {
|
|
56
|
+
// Bind where clause for delete operation with multiple primary keys
|
|
57
|
+
whereClause = this.whereClauseHelper.bindWhereClauseForDeleteWithMultiplePrimaryKeys(data.data, primaryKeyFields, crudTableName);
|
|
58
|
+
} else if (primaryKeyFields && primaryKeyFields.length === 1) {
|
|
59
|
+
// Bind where clause for delete operation with single primary key
|
|
60
|
+
const recordId = getEditRecordId(data.data, primaryKeyFields[0]?.FieldName);
|
|
61
|
+
whereClause = this.whereClauseHelper.bindWhereClauseForDelete(fields, recordId, primaryKeyFields[0]?.FieldName, crudTableName);
|
|
62
|
+
}
|
|
63
|
+
const dataObj = this.requestResponseHelper.deletePayload(crudTableName, whereClause);
|
|
64
|
+
return this.delete(dataObj);
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Deletes a record by the specified table name and primary key value.
|
|
71
|
+
* @param tableName The name of the table.
|
|
72
|
+
* @param primaryKey The primary key field.
|
|
73
|
+
* @param primaryKeyValue The value of the primary key.
|
|
74
|
+
* @returns An Observable emitting the response of the delete operation.
|
|
75
|
+
*/
|
|
76
|
+
deleteRecordByTable(tableName: string, primaryKey: string, primaryKeyValue: string) {
|
|
77
|
+
// Bind where clause for delete operation by table
|
|
78
|
+
const whereClause: APIFilterCriteria = this.whereClauseHelper.bindWhereClauseForDeleteByTable(tableName, primaryKey, primaryKeyValue);
|
|
79
|
+
const dataObj = this.requestResponseHelper.deletePayload(tableName, whereClause);
|
|
80
|
+
return this.delete(dataObj);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Executes the delete operation.
|
|
85
|
+
* @param data The delete query payload.
|
|
86
|
+
* @returns An Observable emitting the response of the delete operation.
|
|
87
|
+
*/
|
|
88
|
+
delete(data: APIDeleteQuery) {
|
|
89
|
+
// Display delete confirmation popup
|
|
90
|
+
const deleteConfirmation = this.deleteRecordPopup();
|
|
91
|
+
if (deleteConfirmation) {
|
|
92
|
+
return this.dsqHelper.executeQuery(data, QueryType.Delete);
|
|
93
|
+
} else {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Displays a delete confirmation popup.
|
|
100
|
+
* @returns True if the user confirms the delete operation, otherwise false.
|
|
101
|
+
*/
|
|
102
|
+
deleteRecordPopup() {
|
|
103
|
+
const text = "You are going to delete selected record. Are you sure want to delete the same?";
|
|
104
|
+
if (confirm(text) == true) {
|
|
105
|
+
return true;
|
|
106
|
+
} else {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Deletes multiple records by table name and values.
|
|
113
|
+
* @param tableName The name of the table.
|
|
114
|
+
* @param values The values of the records to delete.
|
|
115
|
+
* @returns An Observable emitting the response of the delete operation.
|
|
116
|
+
*/
|
|
117
|
+
deleteMultipleRecordByTable(tableName: string, values: any) {
|
|
118
|
+
// Retrieve app object and primary key fields
|
|
119
|
+
const appObject = getAppObjectFromSystemDBTableName(tableName);
|
|
120
|
+
const primaryKeyFields: any = getPrimaryKeyFields(appObject);
|
|
121
|
+
// Generate values array from data
|
|
122
|
+
const valueArray = this.generateValuesArrayFromData(values, primaryKeyFields[0]?.FieldName)
|
|
123
|
+
// Bind where clause for delete operation using IN operator by table
|
|
124
|
+
const whereClause: APIFilterCriteria = this.whereClauseHelper.bindWhereClauseForDeleteUsingInOperatorByTable(tableName, primaryKeyFields[0]?.FieldName, valueArray);
|
|
125
|
+
const dataObj = this.requestResponseHelper.deletePayload(tableName, whereClause);
|
|
126
|
+
return this.delete(dataObj);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Generates a values array from the data.
|
|
131
|
+
* @param dataArray The array of data.
|
|
132
|
+
* @param key The key to extract from each element.
|
|
133
|
+
* @returns The array of values.
|
|
134
|
+
*/
|
|
135
|
+
generateValuesArrayFromData(dataArray: any, key: any) {
|
|
136
|
+
const valueArray: any = []
|
|
137
|
+
if (dataArray && dataArray.length) {
|
|
138
|
+
dataArray.forEach((element: any) => {
|
|
139
|
+
valueArray.push(element[key])
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return valueArray
|
|
143
|
+
}
|
|
144
|
+
}
|