Compare commits

...

86 Commits

Author SHA1 Message Date
Mihajlo Medjedovic
b4e5dd74d9 chore: licence checker sync
All checks were successful
Test / Build-production-and-ng-test (push) Successful in 6m27s
Test / Build-and-test-development (push) Successful in 12m0s
Test / Build-and-test-development-latest-adapter (push) Successful in 11m55s
2023-10-12 14:55:22 +02:00
64746b0aae Merge pull request 'sheetjs' (#53) from sheetjs into development
Some checks failed
Test / Build-production-and-ng-test (push) Failing after 3m15s
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
Reviewed-on: #53
2023-10-12 12:52:31 +00:00
Mihajlo Medjedovic
16ae77c804 style: lint
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 1m23s
2023-10-12 14:50:55 +02:00
Mihajlo Medjedovic
481c14f066 fix: reverting SheetJS upgrade, it was breaking the excel upload 2023-10-12 14:50:34 +02:00
357b9849e7 Merge branch 'issue50' into development
Some checks reported warnings
Build / Build-and-ng-test (pull_request) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-production-and-ng-test (push) Has been cancelled
2023-10-12 09:38:19 +00:00
Mihajlo Medjedovic
0c8a9eef32 chore(ci): build and ng test fix
Some checks failed
Test / Build-production-and-ng-test (push) Successful in 7m30s
Test / Build-and-test-development (push) Failing after 14m29s
Test / Build-and-test-development-latest-adapter (push) Failing after 14m45s
Build / Build-and-ng-test (pull_request) Successful in 1m25s
2023-10-12 08:33:31 +02:00
Mihajlo Medjedovic
112b1d0da4 chore(ci): audit check fix
Some checks failed
Test / Build-production-and-ng-test (push) Failing after 2m22s
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
2023-10-12 08:26:35 +02:00
Mihajlo Medjedovic
a05007416a chore(ci): audit check fix
Some checks failed
Test / Build-production-and-ng-test (push) Failing after 2m25s
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
2023-10-12 08:21:58 +02:00
9f7dd55583 Merge pull request 'Release fix' (#49) from release-fix into development
Some checks failed
Test / Build-production-and-ng-test (push) Failing after 2m36s
Test / Build-and-test-development (push) Failing after 14m29s
Test / Build-and-test-development-latest-adapter (push) Failing after 14m30s
Reviewed-on: #49
2023-10-11 22:02:20 +00:00
11b06f6416 fix: bumping core library to avoid non-ascii char in mp_validatecols.sas. #50
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m30s
2023-10-11 22:57:07 +01:00
adb7eb7755 fix: removing copyright symbol from mpe_alerts macro. #50 2023-10-11 22:56:14 +01:00
Mihajlo Medjedovic
b776b80728 chore: making semantic-release fail if no release available
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m17s
2023-10-11 16:34:06 +02:00
Mihajlo Medjedovic
73a149ea7b chore: updated contributing.md with release instructions
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m18s
2023-10-09 13:02:13 +02:00
Mihajlo Medjedovic
ef8784093b chore: release is draft fix, release will update package.json version
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m18s
2023-10-09 12:46:17 +02:00
semantic-release-bot
b30c788e3d chore(release): 6.2.2 [skip ci]
## [6.2.2](https://git.datacontroller.io/dc/dc/compare/v6.2.1...v6.2.2) (2023-10-09)

### Bug Fixes

* updated SheetJS (crypto) to the latest ([8bd0dd2](8bd0dd22c2))
2023-10-09 09:52:20 +00:00
23899bdff3 Merge pull request 'fix: updated SheetJS (crypto) to the latest' (#48) from development into main
All checks were successful
Release / release (push) Successful in 11m13s
Reviewed-on: #48
2023-10-09 09:49:16 +00:00
Mihajlo Medjedovic
8bd0dd22c2 fix: updated SheetJS (crypto) to the latest
Some checks reported warnings
Test / Build-production-and-ng-test (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Build / Build-and-ng-test (pull_request) Successful in 1m19s
2023-10-09 11:47:27 +02:00
semantic-release-bot
c55b00c74f chore(release): 6.2.1 [skip ci]
Some checks failed
Test / Build-production-and-ng-test (push) Failing after 2m3s
Test / Build-and-test-development (push) Successful in 11m49s
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-10-09)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* closes [#39](#39) upcase issue in MPE_SECURITY ([a00d31c](a00d31caf3))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-10-09 09:03:58 +00:00
c895f509b0 Merge pull request 'chore: fixed CI, trigger pending release' (#47) from development into main
All checks were successful
Release / release (push) Successful in 11m20s
Reviewed-on: #47
2023-10-09 09:00:52 +00:00
Mihajlo Medjedovic
5968915331 chore: fixed CI, trigger pending release
Some checks reported warnings
Test / Build-and-test-development (push) Has been cancelled
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-production-and-ng-test (push) Has been cancelled
Build / Build-and-ng-test (pull_request) Successful in 1m20s
2023-10-09 11:00:09 +02:00
Mihajlo Medjedovic
44ffc082f6 chore: changelog revert to 6.2.0
Some checks reported warnings
Release / release (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-production-and-ng-test (push) Has been cancelled
2023-10-09 10:37:06 +02:00
semantic-release-bot
b716ae5675 chore(release): 6.2.1 [skip ci]
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-10-08)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* closes [#39](#39) upcase issue in MPE_SECURITY ([a00d31c](a00d31caf3))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-10-08 19:33:42 +00:00
01a0b59494 Merge pull request 'package-lock re-generated for CI release to pass, fixed development branch CI yaml' (#46) from development into main
Some checks failed
Release / release (push) Failing after 6m57s
Reviewed-on: #46
2023-10-08 19:30:05 +00:00
Mihajlo Medjedovic
8ebc3da0bb chore(git): Merge branch 'main' into development
Some checks reported warnings
Build / Build-and-ng-test (pull_request) Has been cancelled
Test / Build-production-and-ng-test (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
2023-10-08 21:29:12 +02:00
Mihajlo Medjedovic
133577a4fa ci: fixed development yaml
Some checks failed
Test / Build-production-and-ng-test (push) Failing after 2m3s
Test / Build-and-test-development-latest-adapter (push) Has been cancelled
Test / Build-and-test-development (push) Has been cancelled
Build / Build-and-ng-test (pull_request) Successful in 1m22s
2023-10-08 21:26:55 +02:00
Mihajlo Medjedovic
a19615db41 chore: reverting 6.2.1 release
Some checks reported warnings
Release / release (push) Has been cancelled
2023-10-08 21:22:29 +02:00
Mihajlo Medjedovic
32b212a6bf chore: package-lock fix 2023-10-08 21:21:35 +02:00
semantic-release-bot
00ec4529cd chore(release): 6.2.1 [skip ci]
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-10-08)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* closes [#39](#39) upcase issue in MPE_SECURITY ([a00d31c](a00d31caf3))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-10-08 19:08:09 +00:00
102d03888f Merge pull request 'Release fix' (#45) from development into main
Some checks failed
Release / release (push) Failing after 7m6s
Reviewed-on: #45
2023-10-08 19:06:03 +00:00
9f8247320e Merge pull request 'Master branch sync, release procedure fixing' (#44) from master-sync into development
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m20s
Reviewed-on: #44
2023-10-08 19:03:01 +00:00
Mihajlo Medjedovic
ef871de30e chore: fixing changelog
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m20s
2023-10-08 20:56:09 +02:00
semantic-release-bot
b3a15ce26b chore(release): 6.2.1 [skip ci]
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-10-08)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* closes [#39](#39) upcase issue in MPE_SECURITY ([a00d31c](a00d31caf3))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-10-08 16:56:17 +00:00
270695aec2 Merge pull request 'fix: triggering release' (#43) from development into main
Some checks failed
Release / release (push) Failing after 2m9s
Reviewed-on: #43
2023-10-08 16:53:54 +00:00
ad7392a326 Merge pull request 'chore: setting legacy-peer-deps in .npmrc' (#42) from npmrc into development
Some checks reported warnings
Build / Build-and-ng-test (pull_request) Has been cancelled
Reviewed-on: #42
2023-10-08 16:53:03 +00:00
92a50a42e2 chore: setting legacy-peer-deps in .npmrc
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m21s
2023-10-08 17:51:27 +01:00
semantic-release-bot
a3a8856d8c chore(release): 6.2.1 [skip ci]
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-10-08)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* closes [#39](#39) upcase issue in MPE_SECURITY ([a00d31c](a00d31caf3))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-10-08 16:49:20 +00:00
150c19b1b0 Merge pull request 'development' (#41) from development into main
Some checks failed
Release / release (push) Failing after 2m15s
Reviewed-on: #41
2023-10-08 16:46:19 +00:00
f04c51ee4e Merge pull request 'fix: closes #39 upcase issue in MPE_SECURITY' (#40) from issue39 into development
Some checks reported warnings
Build / Build-and-ng-test (pull_request) Has been cancelled
Reviewed-on: #40
2023-10-08 16:45:23 +00:00
c4338bf957 chore: updating tests, post edit hook, and access check macro. #39
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m22s
2023-10-08 17:42:26 +01:00
5b06f4ede8 chore: improving docs for mpe_accesscheck and adding a test for mpe_accesscheck
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m27s
2023-10-07 22:46:32 +01:00
e7ab2cc956 chore: adding mpe_security_postedit hook link in MPE_TABLES on deploy. #39
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m28s
2023-10-07 18:28:36 +01:00
5ebf8a66f7 chore: error message source file fix
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m19s
2023-10-07 00:16:05 +01:00
3d4e886b9b chore: adding missing dependency
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m22s
2023-10-07 00:13:48 +01:00
a00d31caf3 fix: closes #39 upcase issue in MPE_SECURITY
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m23s
adding frontend validation rule, backend upcase enforcement rule, and modification to service code to ensure values are upcased before comparison
2023-10-07 00:11:38 +01:00
40fe707287 Merge pull request 'maincopy' (#38) from maincopy into development
Reviewed-on: #38
2023-09-26 07:40:05 +00:00
8296be01ba chore: cleanup of items in changelog for v6.2.1
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m19s
2023-09-26 08:38:40 +01:00
semantic-release-bot
dbeb003292 chore(release): 6.2.1 [skip ci]
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m25s
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-09-25)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-09-25 14:59:38 +00:00
f048501c48 Merge pull request 'development' (#37) from development into main
All checks were successful
Release / release (push) Successful in 11m11s
Reviewed-on: #37
2023-09-25 14:57:44 +00:00
498350b3f3 Merge pull request 'master-sync' (#36) from master-sync into development
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m18s
Reviewed-on: #36
Reviewed-by: allan <allan@4gl.io>
2023-09-25 14:55:33 +00:00
Mihajlo Medjedovic
91e82c9c65 ci: npm ci in build.yaml
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 1m19s
2023-09-25 16:53:40 +02:00
Mihajlo Medjedovic
24067ea82b chore: calling licence checker script as a part of PR action
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 24s
2023-09-25 16:51:33 +02:00
semantic-release-bot
aa7deddba0 chore(release): 6.2.1 [skip ci]
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-09-25)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* handsontable v13 ([6f482ec](6f482ec6d9))
* latest adapter ([5e30dc0](5e30dc0f89))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](8571e01e44))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](#33) ([94ab949](94ab949df8))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-09-25 14:33:27 +00:00
b2d13203d1 Merge pull request 'development' (#34) from development into main
Some checks failed
Release / release (push) Failing after 2m25s
Reviewed-on: #34
2023-09-25 14:31:25 +00:00
19c1092b5b Merge pull request 'fix: latest adapter' (#32) from adapter-bump into development
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 25s
Reviewed-on: #32
2023-09-25 14:26:49 +00:00
Mihajlo Medjedovic
94ab949df8 fix: updating editors/stagedata to address issues in particular viya configurations as described in issue #33
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 25s
2023-09-25 16:24:50 +02:00
Mihajlo Medjedovic
9eb2451c2f chore(git): Merge branch 'adapter-bump' of ssh://git.datacontroller.io:29419/dc/dc into adapter-bump 2023-09-07 12:52:25 +02:00
zver
6e521bfa3e chore: renaming format names due to changes in how Viya treats the last letter
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 23s
2023-09-07 11:49:29 +01:00
Mihajlo Medjedovic
239720fe0c chore(git): Merge branch 'development' into adapter-bump 2023-09-07 12:13:17 +02:00
Mihajlo Medjedovic
8571e01e44 fix: sasjs/cli and sasjs/core updated to the latest 2023-09-07 12:12:09 +02:00
Mihajlo Medjedovic
6f482ec6d9 fix: handsontable v13
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 23s
2023-09-06 21:57:11 +02:00
Mihajlo Medjedovic
5e30dc0f89 fix: latest adapter
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 24s
2023-09-06 17:14:49 +02:00
semantic-release-bot
3d76d12c86 chore(release): 6.2.1 [skip ci]
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-08-25)

### Bug Fixes

* approve, history and submit pages grouped in review module ([e056ece](e056ece223))
* updating logic for REPLACE loadtype ([1f2ce55](1f2ce55f24))
2023-08-25 11:46:06 +00:00
93f1b81d70 Merge pull request 'Refactoring solo pages into a modules' (#19) from tsdoc into development
Some checks failed
Release / release (push) Failing after 2m2s
Build / Build-and-ng-test (pull_request) Successful in 24s
Reviewed-on: #19
Reviewed-by: allan <allan@4gl.io>
2023-08-25 11:24:10 +00:00
e2b65ddd82 Merge branch 'development' into tsdoc
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 22s
2023-08-25 11:19:38 +00:00
b64bbe91d4 Merge pull request 'fix: updating logic for REPLACE loadtype' (#25) from replace into development
Reviewed-on: #25
2023-08-25 11:19:16 +00:00
1f2ce55f24 fix: updating logic for REPLACE loadtype
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 24s
Staged rows are always considered as NEW, and previous rows are considered DELETED
This is consistent with the fact that REPLACE involves a delete *, followed by an append.
2023-08-25 12:17:43 +01:00
Mihajlo Medjedovic
921157da9e chore(git): Merge branch 'development' into tsdoc
Some checks reported warnings
Build / Build-and-ng-test (pull_request) Successful in 23s
Release / release (push) Has been cancelled
2023-08-24 12:17:01 +02:00
413acf7d05 Merge pull request 'main to dev' (#23) from main into development
Reviewed-on: #23
2023-08-24 10:12:26 +00:00
Mihajlo Medjedovic
725f75aa74 style: lint
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 23s
2023-08-24 11:52:02 +02:00
Mihajlo Medjedovic
c64ab8a577 chore(git): Merge branch 'tsdoc' of ssh://git.datacontroller.io:29419/dc/dc into tsdoc
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s
2023-08-24 11:50:53 +02:00
Mihajlo Medjedovic
1154c99e0a ci: surfer install 2023-08-24 11:44:54 +02:00
5bcdef77b8 Merge branch 'development' into tsdoc
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s
2023-08-24 09:43:45 +00:00
Mihajlo Medjedovic
7b54fff26e chore: typo fix
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s
2023-08-04 12:18:31 +02:00
Mihajlo Medjedovic
cd3e0f614b chore: adding comments part 3
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 23s
2023-08-04 12:05:00 +02:00
Mihajlo Medjedovic
81c0aec202 chore: removed column.ts leftover 2023-08-04 08:52:53 +02:00
Mihajlo Medjedovic
3193bdd720 chore: removing cellValidation leftover 2023-08-03 22:33:16 +02:00
Mihajlo Medjedovic
b9a12454e1 chore: removing table.ts leftover 2023-08-03 22:31:59 +02:00
Mihajlo Medjedovic
01a857f7c6 chore: adding comments part 2 2023-08-03 22:31:17 +02:00
Mihajlo Medjedovic
2bb2eee80e chore: removed commented code about old workaround for excel upload validation 2023-08-03 21:58:50 +02:00
Mihajlo Medjedovic
c054ea500d chore: adding comments part1 2023-08-03 17:56:34 +02:00
Mihajlo Medjedovic
d7f8201246 ci: tsdoc -> webdoc
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s
2023-08-02 09:24:16 +02:00
Mihajlo Medjedovic
622cfcc6fe chore: removed edit-route leftover
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 21s
2023-08-01 16:45:18 +02:00
Mihajlo Medjedovic
303240e4d2 style: lint
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 23s
2023-08-01 16:40:03 +02:00
Mihajlo Medjedovic
a8b849aede chore: modularization refactor finish 2023-08-01 16:39:45 +02:00
Mihajlo Medjedovic
ca281b70c9 chore(git): Merge branch 'development' into tsdoc
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s
2023-08-01 14:52:53 +02:00
Mihajlo Medjedovic
e056ece223 fix: approve, history and submit pages grouped in review module
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 1m5s
Using compodoc instead of typedoc because of better angular support.
2023-08-01 14:50:04 +02:00
94 changed files with 6032 additions and 19519 deletions

View File

@ -19,3 +19,7 @@ jobs:
NPMRC: ${{ secrets.NPMRC}} NPMRC: ${{ secrets.NPMRC}}
- run: npm run lint:check - run: npm run lint:check
- run: |
cd client
npm ci
npm run license-checker

View File

@ -21,10 +21,11 @@ jobs:
echo '${{ secrets.NPMRC}}' > client/.npmrc echo '${{ secrets.NPMRC}}' > client/.npmrc
- name: Install Chrome for Angular tests - name: Install Chrome for Angular tests
run: apt-get update run: |
run: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb apt-get update
run: apt install -y ./google-chrome*.deb; wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
run: export CHROME_BIN=/usr/bin/google-chrome apt install -y ./google-chrome*.deb;
export CHROME_BIN=/usr/bin/google-chrome
- name: Write cypress credentials - name: Write cypress credentials
run: echo "$CYPRESS_CREDS" > ./client/cypress.env.json run: echo "$CYPRESS_CREDS" > ./client/cypress.env.json
@ -38,18 +39,20 @@ jobs:
- name: Check audit - name: Check audit
# Audit should fail and stop the CI if critical vulnerability found # Audit should fail and stop the CI if critical vulnerability found
run: | run: |
npm audit --audit-level=critical npm audit --audit-level=critical --omit=dev
cd ./sas cd ./sas
npm audit --audit-level=critical npm audit --audit-level=critical --omit=dev
cd ./client cd ../client
npm audit --audit-level=critical npm audit --audit-level=critical --omit=dev
- name: Angular Tests - name: Angular Tests
run: | run: |
cd client
npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
- name: Angular Production Build - name: Angular Production Build
run: | run: |
cd client
npm run postinstall npm run postinstall
npm run build npm run build

View File

@ -35,6 +35,8 @@ jobs:
run: | run: |
npm i npm i
npm i -g semantic-release npm i -g semantic-release
# We do a semantic-release DRY RUN to make the job fail if there are no changes to release
GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.datacontroller.io semantic-release --dry-run | grep -q "There are no relevant changes, so no new version is released." && exit 1
GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.datacontroller.io semantic-release GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.datacontroller.io semantic-release
- name: Frontend Build - name: Frontend Build
@ -48,7 +50,7 @@ jobs:
description: Compile SAS 9 services, remove tests & create deployment program description: Compile SAS 9 services, remove tests & create deployment program
run: | run: |
cd sas cd sas
npm ci npm i
sasjs c -t sas9 sasjs c -t sas9
rm -rf sasjsbuild/tests rm -rf sasjsbuild/tests
sasjs b -t sas9 sasjs b -t sas9
@ -97,15 +99,15 @@ jobs:
run: | run: |
cd client cd client
npm -g install cloudron-surfer npm -g install cloudron-surfer
npm run typedoc npm run compodoc:build
surfer put --token ${{ secrets.TSDOC_TOKEN }} --server tsdoc.datacontroller.io ../tsdoc / surfer put --token ${{ secrets.TSDOC_TOKEN }} --server webdoc.datacontroller.io documentation/* /
- name: Upload assets to release - name: Upload assets to release
run: | run: |
RELEASE_ID=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.id'` RELEASE_ID=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.id'`
RELEASE_BODY=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.body'` RELEASE_BODY=`curl -k 'https://git.datacontroller.io/api/v1/repos/dc/dc/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.body'`
# Update body # Update body
curl --data '{"draft": true,"body":"'"$RELEASE_BODY\n\nFor installation instructions, please visit https://docs.datacontroller.io/"'"}' -X PATCH --header 'Content-Type: application/json' -k https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID?access_token=${{ secrets.RELEASE_TOKEN }} curl --data '{"draft": false,"body":"'"$RELEASE_BODY\n\nFor installation instructions, please visit https://docs.datacontroller.io/"'"}' -X PATCH --header 'Content-Type: application/json' -k https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID?access_token=${{ secrets.RELEASE_TOKEN }}
# Upload assets # Upload assets
URL="https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }}" URL="https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }}"
curl -k $URL -F attachment=@frontend.zip curl -k $URL -F attachment=@frontend.zip

1
.gitignore vendored
View File

@ -10,6 +10,7 @@ client/src/environments/version.ts
client/cypress/screenshots client/cypress/screenshots
client/cypress/results client/cypress/results
client/cypress/videos client/cypress/videos
client/documentation
cypress.env.json cypress.env.json
sasjsbuild sasjsbuild
sasjsresults sasjsresults

2
.npmrc
View File

@ -1 +1 @@
legacy-peer-deps=false legacy-peer-deps=true

View File

@ -6,11 +6,13 @@
"@semantic-release/commit-analyzer", "@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator", "@semantic-release/release-notes-generator",
"@semantic-release/changelog", "@semantic-release/changelog",
"@semantic-release/npm",
[ [
"@semantic-release/git", "@semantic-release/git",
{ {
"assets": [ "assets": [
"CHANGELOG.md" "CHANGELOG.md",
"package.json"
] ]
} }
], ],

View File

@ -1,14 +1,22 @@
# [6.2.0](https://git.datacontroller.io/dc/dc/compare/v6.1.0...v6.2.0) (2023-08-24) ## [6.2.2](https://git.datacontroller.io/dc/dc/compare/v6.2.1...v6.2.2) (2023-10-09)
### Bug Fixes ### Bug Fixes
* re-enabling full REPLACE uploads ([08e39c4](https://git.datacontroller.io/dc/dc/commit/08e39c4fca570406f9aad3d907cb04596421d074)) * updated SheetJS (crypto) to the latest ([8bd0dd2](https://git.datacontroller.io/dc/dc/commit/8bd0dd22c258911672303869e4df893a98e93575))
## [6.2.1](https://git.datacontroller.io/dc/dc/compare/v6.2.0...v6.2.1) (2023-10-09)
### Features ### Bug Fixes
* support for European numeric formats ([e48e47b](https://git.datacontroller.io/dc/dc/commit/e48e47bc635452b59e107b235e597c26e748875e)) * approve, history and submit pages grouped in review module ([e056ece](https://git.datacontroller.io/dc/dc/commit/e056ece2234ef6aab050f6a5b1f8de633b163d91))
* closes [#39](https://git.datacontroller.io/dc/dc/issues/39) upcase issue in MPE_SECURITY ([a00d31c](https://git.datacontroller.io/dc/dc/commit/a00d31caf3c5634cd61a4700fb175e76856edbb6))
* handsontable v13 ([6f482ec](https://git.datacontroller.io/dc/dc/commit/6f482ec6d909907a304ef9975262889e2370035f))
* latest adapter ([5e30dc0](https://git.datacontroller.io/dc/dc/commit/5e30dc0f892fab2af41f4ea56e30f27ec3b3912e))
* sasjs/cli and sasjs/core updated to the latest ([8571e01](https://git.datacontroller.io/dc/dc/commit/8571e01e44a8cb6df9d150d271c34bb75bffdf31))
* updating editors/stagedata to address issues in particular viya configurations as described in issue [#33](https://git.datacontroller.io/dc/dc/issues/33) ([94ab949](https://git.datacontroller.io/dc/dc/commit/94ab949df8c75072525751a2156b7a32c2e641dc))
* updating logic for REPLACE loadtype ([1f2ce55](https://git.datacontroller.io/dc/dc/commit/1f2ce55f249f4af56f0cacdec47e69246cd47431))
# [6.2.0](https://git.datacontroller.io/dc/dc/compare/v6.1.0...v6.2.0) (2023-08-24) # [6.2.0](https://git.datacontroller.io/dc/dc/compare/v6.1.0...v6.2.0) (2023-08-24)
@ -17,7 +25,6 @@
* re-enabling full REPLACE uploads ([08e39c4](https://git.datacontroller.io/dc/dc/commit/08e39c4fca570406f9aad3d907cb04596421d074)) * re-enabling full REPLACE uploads ([08e39c4](https://git.datacontroller.io/dc/dc/commit/08e39c4fca570406f9aad3d907cb04596421d074))
### Features ### Features
* support for European numeric formats ([e48e47b](https://git.datacontroller.io/dc/dc/commit/e48e47bc635452b59e107b235e597c26e748875e)) * support for European numeric formats ([e48e47b](https://git.datacontroller.io/dc/dc/commit/e48e47bc635452b59e107b235e597c26e748875e))

View File

@ -53,6 +53,17 @@ npm run lint:fix
Typedoc is used for generating typescript documentation based on the code. Typedoc is used for generating typescript documentation based on the code.
That part is automated and beign done as a part of CI job. That part is automated and beign done as a part of CI job.
# Release
Release is automated as a part of CI job. Workflow file: `.gitea/workflows/release.yaml`.
It will run automatically when branch merged to the `main` branch.
IMPORTANT!
If release job fails, after it has been created empty release and a tag, we must not re-run the relase job until we removed the newly create GIT TAG and RELEASE.
To remove the git tag run:
```
git push -d origin vX.X.X
```
To remove the release, you need to do it with repo administration over at [https://git.datacontroller.io/dc/dc](https://git.datacontroller.io/dc/dc)
# Troubleshooting # Troubleshooting
## Makedata service "could not create directory" error ## Makedata service "could not create directory" error

View File

@ -10,7 +10,7 @@ const check = (cwd) => {
onlyAllow: onlyAllow:
'AFLv2.1;Apache 2.0;Apache-2.0;Apache*;Artistic-2.0;0BSD;BSD*;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;MPL-2.0;ODC-By-1.0;Python-2.0;Unlicense;', 'AFLv2.1;Apache 2.0;Apache-2.0;Apache*;Artistic-2.0;0BSD;BSD*;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;MPL-2.0;ODC-By-1.0;Python-2.0;Unlicense;',
excludePackages: excludePackages:
'@cds/city@1.1.0;@handsontable/angular@13.0.0;handsontable@13.0.0;hyperformula@2.5.0;jackspeak@2.2.0;path-scurry@1.7.0' '@cds/city@1.1.0;@handsontable/angular@13.1.0;handsontable@13.1.0;hyperformula@2.6.0;jackspeak@2.2.0;path-scurry@1.7.0'
}, },
(error, json) => { (error, json) => {
if (error) { if (error) {

18255
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "dc-client", "name": "data_controller-client",
"description": "dc-client", "description": "DataController Client",
"angular-cli": {}, "angular-cli": {},
"scripts": { "scripts": {
"start": "node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng serve", "start": "node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng serve",
@ -29,7 +29,9 @@
"cy:run": "cypress run", "cy:run": "cypress run",
"audit:prod": "npm audit --omit=dev", "audit:prod": "npm audit --omit=dev",
"sasdocs": "sasjs doc && ./sasjs/utils/deploydocs.sh", "sasdocs": "sasjs doc && ./sasjs/utils/deploydocs.sh",
"typedoc": "typedoc --options typedoc.json && cd ../tsdoc" "compodoc:build": "compodoc -p tsconfig.doc.json --name 'Data Controller Client'",
"compodoc:build-and-serve": "compodoc -p tsconfig.doc.json -s --name 'Data Controller Client'",
"compodoc:serve": "compodoc -s --name 'Data Controller Client'"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
@ -46,9 +48,9 @@
"@clr/angular": "^13.17.0", "@clr/angular": "^13.17.0",
"@clr/icons": "^13.0.2", "@clr/icons": "^13.0.2",
"@clr/ui": "^13.17.0", "@clr/ui": "^13.17.0",
"@handsontable/angular": "^13.0.0", "@handsontable/angular": "^13.1.0",
"@sasjs/adapter": "4.3.6", "@sasjs/adapter": "4.10.1",
"@sasjs/utils": "^3.3.0", "@sasjs/utils": "^3.4.0",
"@sheet/crypto": "1.20211122.1", "@sheet/crypto": "1.20211122.1",
"@types/d3-graphviz": "^2.6.7", "@types/d3-graphviz": "^2.6.7",
"@types/text-encoding": "0.0.35", "@types/text-encoding": "0.0.35",
@ -58,7 +60,7 @@
"crypto-js": "^3.3.0", "crypto-js": "^3.3.0",
"d3-graphviz": "^5.0.2", "d3-graphviz": "^5.0.2",
"fs-extra": "^7.0.1", "fs-extra": "^7.0.1",
"handsontable": "^13.0.0", "handsontable": "^13.1.0",
"https-browserify": "1.0.0", "https-browserify": "1.0.0",
"hyperformula": "^2.5.0", "hyperformula": "^2.5.0",
"iconv-lite": "^0.5.0", "iconv-lite": "^0.5.0",
@ -87,6 +89,8 @@
"@angular-eslint/template-parser": "16.0.3", "@angular-eslint/template-parser": "16.0.3",
"@angular/cli": "^16.1.0", "@angular/cli": "^16.1.0",
"@angular/compiler-cli": "^16.1.2", "@angular/compiler-cli": "^16.1.2",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@compodoc/compodoc": "^1.1.21",
"@cypress/webpack-preprocessor": "^5.17.1", "@cypress/webpack-preprocessor": "^5.17.1",
"@types/core-js": "^2.5.5", "@types/core-js": "^2.5.5",
"@types/crypto-js": "^4.0.1", "@types/crypto-js": "^4.0.1",
@ -119,7 +123,8 @@
"rimraf": "3.0.2", "rimraf": "3.0.2",
"ts-loader": "^9.2.8", "ts-loader": "^9.2.8",
"ts-node": "^3.3.0", "ts-node": "^3.3.0",
"typedoc": "^0.23.24", "typedoc": "^0.24.8",
"typedoc-plugin-external-module-name": "^4.0.6",
"typescript": "~4.9.4", "typescript": "~4.9.4",
"wait-on": "^6.0.1", "wait-on": "^6.0.1",
"watch": "^1.0.2" "watch": "^1.0.2"

View File

@ -1,5 +1,8 @@
import { QueryClause } from './models/TableData' import { QueryClause } from './models/TableData'
/**
* Filtering cache info, to be reused when filtering modal is re-open
*/
interface FilterCache { interface FilterCache {
cols: any[] cols: any[]
vals: any[] vals: any[]
@ -10,12 +13,18 @@ interface FilterCache {
query: QueryClause[] query: QueryClause[]
} }
/**
* Filtering cache info in the open viewboxes, to be reused when filtering modal is re-open
*/
interface ViewboxCache { interface ViewboxCache {
[key: number]: { [key: number]: {
filter: FilterCache filter: FilterCache
} }
} }
/**
* Initial values when no cached values stored
*/
export const initFilter: { filter: FilterCache } = { export const initFilter: { filter: FilterCache } = {
filter: { filter: {
cols: <any[]>[], cols: <any[]>[],
@ -28,6 +37,13 @@ export const initFilter: { filter: FilterCache } = {
} }
} }
/**
* Cached filtering values across whole app (editor, viewer, viewboxes)
* Cached lineage libraries, tables
* Cached metadata tree
* Cached usernav tree
* Cached viyaApi collections, search and selected endpoint
*/
export const globals: { export const globals: {
rootParam: string rootParam: string
editor: any editor: any

View File

@ -1,40 +0,0 @@
<div class="content-area">
<div class="card">
<div class="card-header d-flex flex-column justify-content-center">
<h3 class="text-center">
You succesfully edited table
<span class="color-blue font-weight-700">{{ libds }}</span>
</h3>
<p class="text-center">
<b>Please choose from the following actions</b>
</p>
<div class="row d-flex justify-content-center mt-20">
<button
class="btn btn-sm btn-outline text-center"
(click)="submittedTableScreen()"
>
Go to submitted table screen
</button>
<button
class="btn btn-sm btn-outline text-center"
(click)="viewerTableScreen()"
>
Go to base table screen
</button>
<button
id="approvalBtn"
class="btn btn-sm btn-success-outline text-center"
(click)="approveTableScreen()"
>
Go to approvals screen
</button>
<button
class="btn btn-sm btn-info-outline text-center"
(click)="goBack()"
>
Go back to editor
</button>
</div>
</div>
</div>
</div>

View File

@ -1,50 +0,0 @@
import { AfterViewInit, Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
@Component({
selector: 'app-actions',
templateUrl: './actions.component.html',
styleUrls: ['./actions.component.scss'],
host: {
class: 'content-container'
}
})
export class ActionsComponent implements OnInit, AfterViewInit {
public dsid: any
public libds: string | undefined
constructor(
private route: ActivatedRoute,
private router: Router
) {}
public submittedTableScreen() {
this.router.navigateByUrl('/stage/' + this.dsid)
}
public approveTableScreen() {
this.router.navigateByUrl('/approve/approveDet/' + this.dsid)
}
public viewerTableScreen() {
this.router.navigateByUrl('/view/data/' + this.libds)
}
public goBack() {
this.router.navigateByUrl('/editor/' + this.libds)
}
async ngOnInit() {
this.dsid = this.route.snapshot.params['dsid']
this.libds = this.route.snapshot.params['libds']
}
ngAfterViewInit() {
setTimeout(() => {
let approvalBtn: any = window.document.getElementById('approvalBtn')
if (!!approvalBtn) {
approvalBtn.focus()
}
}, 700)
}
}

View File

@ -169,7 +169,7 @@
<clr-dropdown-menu *clrIfOpen clrPosition="bottom-left"> <clr-dropdown-menu *clrIfOpen clrPosition="bottom-left">
<a [routerLink]="['/view']" clrDropdownItem>VIEW</a> <a [routerLink]="['/view']" clrDropdownItem>VIEW</a>
<a [routerLink]="['/home']" clrDropdownItem>EDIT</a> <a [routerLink]="['/home']" clrDropdownItem>EDIT</a>
<a [routerLink]="['/submitted']" clrDropdownItem>REVIEW</a> <a [routerLink]="['/review/submitted']" clrDropdownItem>REVIEW</a>
</clr-dropdown-menu> </clr-dropdown-menu>
</clr-dropdown> </clr-dropdown>
</div> </div>
@ -192,7 +192,7 @@
>EDIT</a >EDIT</a
> >
<a <a
[routerLink]="['/submitted']" [routerLink]="['/review/submitted']"
[class.active]=" [class.active]="
router.url.includes('submitted') || router.url.includes('submitted') ||
router.url.includes('approve') || router.url.includes('approve') ||
@ -224,7 +224,7 @@
<ul class="nav"> <ul class="nav">
<li class="nav-item"> <li class="nav-item">
<a <a
[routerLink]="['/submitted']" [routerLink]="['/review/submitted']"
class="nav-link nav-text" class="nav-link nav-text"
routerLinkActive="active" routerLinkActive="active"
>SUBMIT</a >SUBMIT</a
@ -232,15 +232,16 @@
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a <a
[routerLink]="['/approve']" [routerLink]="['/review/approve']"
class="nav-link nav-text" class="nav-link nav-text"
[class.active]="router.url.includes('approve')"
routerLinkActive="active" routerLinkActive="active"
>APPROVE</a >APPROVE</a
> >
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a <a
[routerLink]="['/history']" [routerLink]="['/review/history']"
class="nav-link nav-text" class="nav-link nav-text"
routerLinkActive="active" routerLinkActive="active"
>HISTORY</a >HISTORY</a

View File

@ -57,24 +57,15 @@ export class AppComponent {
private elementRef: ElementRef private elementRef: ElementRef
) { ) {
this.parseDcAdapterSettings() this.parseDcAdapterSettings()
/**
* Prints app info in the console such as:
* - Adapter versions
* - App version
* - Build timestamp
*
*/
;(window as any).appinfo = () => { ;(window as any).appinfo = () => {
const licenseKeyData = this.licenceService.getLicenseKeyData()
if (licenseKeyData) {
const expiry_date = moment(
licenseKeyData.valid_until,
'YYYY-MM-DD'
).startOf('day')
const current_date = moment().startOf('day')
const daysToExpiry = expiry_date.diff(current_date, 'days')
licenseKeyData.valid_until += ` (${daysToExpiry} ${
daysToExpiry === 1 ? 'day' : 'days'
} remaining)`
if (isNaN(daysToExpiry)) licenseKeyData.valid_until = 'Unlimited'
}
console.table({ console.table({
'Adapter version': VERSION.adapterVersion || 'n/a', 'Adapter version': VERSION.adapterVersion || 'n/a',
'App version': (VERSION.tag || '').replace('v', ''), 'App version': (VERSION.tag || '').replace('v', ''),
@ -87,7 +78,12 @@ export class AppComponent {
this.subscribeToLicenseEvents() this.subscribeToLicenseEvents()
/**
* Fetches git tag ang git hash from `version.ts` file
* It's placed in the user drop down.
*/
this.commitVer = (VERSION.tag || '').replace('v', '') + '.' + VERSION.hash this.commitVer = (VERSION.tag || '').replace('v', '') + '.' + VERSION.hash
router.events.subscribe((val) => { router.events.subscribe((val) => {
this.routeUrl = this.router.url this.routeUrl = this.router.url
@ -127,8 +123,10 @@ export class AppComponent {
this.subscribeToAppActive() this.subscribeToAppActive()
this.subscribeToDemoLimitModal() this.subscribeToDemoLimitModal()
/* In Viya streaming apps, content is served within an iframe. This code /**
makes that iframe "full screen" so it looks like a regular window. */ * In Viya streaming apps, content is served within an iframe. This code
* makes that iframe "full screen" so it looks like a regular window.
*/
if (window.frameElement) { if (window.frameElement) {
window.frameElement.setAttribute( window.frameElement.setAttribute(
'style', 'style',
@ -143,6 +141,9 @@ export class AppComponent {
} }
} }
/**
* Parses adapter settings that are found in the <sasjs> tag inside index.html
*/
private parseDcAdapterSettings() { private parseDcAdapterSettings() {
const sasjsElement = document.querySelector('sasjs') const sasjsElement = document.querySelector('sasjs')
@ -180,9 +181,14 @@ export class AppComponent {
this.appService.sasServiceInit() this.appService.sasServiceInit()
} }
/**
* Opens licence page with the active licence problem
* Problem details are encoded in the url
*/
public licenceProblemDetails(url: string) { public licenceProblemDetails(url: string) {
this.router.navigateByUrl(url) this.router.navigateByUrl(url)
} }
/** /**
* Based on string provided we return true, false or null * Based on string provided we return true, false or null
* True -> Compute API * True -> Compute API
@ -199,6 +205,12 @@ export class AppComponent {
return value === 'true' || false return value === 'true' || false
} }
/**
* Listens for an `demo limit` event that will show the `Feature locked modal`
* For exmaple when in editor upload feature is not enabled
* When user tries to upload the excel, editor component will trgger this event
* And stop the execution of file upload code.
*/
public subscribeToDemoLimitModal() { public subscribeToDemoLimitModal() {
this.eventService.onDemoLimitModalShow.subscribe((featureName: string) => { this.eventService.onDemoLimitModalShow.subscribe((featureName: string) => {
this.demoLimitNotice = { this.demoLimitNotice = {
@ -208,6 +220,10 @@ export class AppComponent {
}) })
} }
/**
* Listens for licence events so banner can be displayed.
* App is free tier, licence will expire, is expired or is invalid
*/
public subscribeToLicenseEvents() { public subscribeToLicenseEvents() {
this.licenceService.isAppFreeTier.subscribe((isAppFreeTier: boolean) => { this.licenceService.isAppFreeTier.subscribe((isAppFreeTier: boolean) => {
this.freeTierBanner = isAppFreeTier this.freeTierBanner = isAppFreeTier
@ -227,6 +243,10 @@ export class AppComponent {
) )
} }
/**
* Listens for an event that will activate od deactivate full application.
* Based on licence key prcoessing result
*/
public subscribeToAppActive() { public subscribeToAppActive() {
this.licenceService.isAppActivated.subscribe((value: any) => { this.licenceService.isAppActivated.subscribe((value: any) => {
this.appActive = value this.appActive = value
@ -248,31 +268,51 @@ export class AppComponent {
}) })
} }
/**
* When startupservice request is finished with valid response, this event will
* make sure loading screen is gone.
*/
public subscribeToStartupData() { public subscribeToStartupData() {
this.eventService.onStartupDataLoaded.subscribe(() => { this.eventService.onStartupDataLoaded.subscribe(() => {
this.startupDataLoaded = true this.startupDataLoaded = true
}) })
} }
/**
* Opens requests modal when requested from event service
*/
public subscribeToRequestsModal() { public subscribeToRequestsModal() {
this.eventService.onRequestsModalOpen.subscribe((value: boolean) => { this.eventService.onRequestsModalOpen.subscribe((value: boolean) => {
this.requestsModal = true this.requestsModal = true
}) })
} }
/**
* Closes abort modal with matching ID (there could be multiple abort modals open)
*/
public closeAbortModal(abortId: number) { public closeAbortModal(abortId: number) {
let abortIndex = this.sasjsAborts.findIndex((abort) => abort.id === abortId) let abortIndex = this.sasjsAborts.findIndex((abort) => abort.id === abortId)
this.sasjsAborts.splice(abortIndex, 1) this.sasjsAborts.splice(abortIndex, 1)
} }
/**
* Toggles sidebar when requested from event service
*/
public toggleSidebar() { public toggleSidebar() {
this.eventService.toggleSidebar() this.eventService.toggleSidebar()
} }
/**
* Whether or not current route includes the route from param
* @param route route to check
*/
public isMainRoute(route: string): boolean { public isMainRoute(route: string): boolean {
return this.router.url.includes(route) return this.router.url.includes(route)
} }
/**
* Opens a page for updating the licence.
*/
public openLicencingPage() { public openLicencingPage() {
this.router.navigateByUrl('/licensing/update') this.router.navigateByUrl('/licensing/update')
} }

View File

@ -11,33 +11,16 @@ import { NotFoundComponent } from './not-found/not-found.component'
import { SasStoreService } from './services/sas-store.service' import { SasStoreService } from './services/sas-store.service'
import { SharedModule } from './shared/shared.module' import { SharedModule } from './shared/shared.module'
// import { EditorComponent } from './editor/editor.component'
import { ActionsComponent } from './actions/actions.component'
import { AppSharedModule } from './app-shared.module' import { AppSharedModule } from './app-shared.module'
import { ApproveDetailsComponent } from './approve-details/approve-details.component'
import { ApproveComponent } from './approve/approve.component'
import { DeployComponent } from './deploy/deploy.component'
import { AutomaticComponent } from './deploy/sections/automatic/automatic.component'
import { ManualComponent } from './deploy/sections/manual/manual.component'
import { SasjsConfiguratorComponent } from './deploy/sections/sasjs-configurator/sasjs-configurator.component'
import { GroupComponent } from './group/group.component'
import { HistoryComponent } from './history/history.component'
import { LicensingComponent } from './licensing/licensing.component'
import { LineageComponent } from './lineage/lineage.component'
import { MetadataComponent } from './metadata/metadata.component'
import { PipesModule } from './pipes/pipes.module' import { PipesModule } from './pipes/pipes.module'
import { RoleComponent } from './role/role.component' import { ReviewRouteComponent } from './routes/review-route/review-route.component'
import { ApproveRouteComponent } from './routes/approve-route/approve-route.component'
import { HistoryRouteComponent } from './routes/history-route/history-route.component'
import { LicensingGuard } from './routes/licensing.guard' import { LicensingGuard } from './routes/licensing.guard'
import { UsernavRouteComponent } from './routes/usernav-route/usernav-route.component' import { UsernavRouteComponent } from './routes/usernav-route/usernav-route.component'
import { AppService } from './services/app.service' import { AppService } from './services/app.service'
import { InfoModalComponent } from './shared/abort-modal/info-modal.component' import { InfoModalComponent } from './shared/abort-modal/info-modal.component'
import { RequestsModalComponent } from './shared/requests-modal/requests-modal.component' import { RequestsModalComponent } from './shared/requests-modal/requests-modal.component'
import { SubmitterComponent } from './submitter/submitter.component'
import { UserComponent } from './user/user.component'
import { HomeModule } from './home/home.module' import { HomeModule } from './home/home.module'
import { SystemComponent } from './system/system.component'
import { DirectivesModule } from './directives/directives.module' import { DirectivesModule } from './directives/directives.module'
import { ViyaApiExplorerComponent } from './viya-api-explorer/viya-api-explorer.component' import { ViyaApiExplorerComponent } from './viya-api-explorer/viya-api-explorer.component'
import { NgxJsonViewerModule } from 'ngx-json-viewer' import { NgxJsonViewerModule } from 'ngx-json-viewer'
@ -46,27 +29,11 @@ import { NgxJsonViewerModule } from 'ngx-json-viewer'
declarations: [ declarations: [
AppComponent, AppComponent,
NotFoundComponent, NotFoundComponent,
ApproveComponent, ReviewRouteComponent,
ApproveDetailsComponent, ReviewRouteComponent,
ActionsComponent,
HistoryComponent,
LineageComponent,
SubmitterComponent,
ApproveRouteComponent,
HistoryRouteComponent,
MetadataComponent,
UsernavRouteComponent, UsernavRouteComponent,
UserComponent,
GroupComponent,
RoleComponent,
RequestsModalComponent, RequestsModalComponent,
DeployComponent,
InfoModalComponent, InfoModalComponent,
LicensingComponent,
ManualComponent,
AutomaticComponent,
SasjsConfiguratorComponent,
SystemComponent,
ViyaApiExplorerComponent ViyaApiExplorerComponent
], ],
imports: [ imports: [
@ -84,7 +51,7 @@ import { NgxJsonViewerModule } from 'ngx-json-viewer'
DirectivesModule, DirectivesModule,
NgxJsonViewerModule NgxJsonViewerModule
], ],
providers: [AppService, SasStoreService, ApproveComponent, LicensingGuard], providers: [AppService, SasStoreService, LicensingGuard],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule {} export class AppModule {}

View File

@ -7,22 +7,20 @@ import { ModuleWithProviders } from '@angular/core'
import { Routes, RouterModule } from '@angular/router' import { Routes, RouterModule } from '@angular/router'
import { HomeComponent } from './home/home.component' import { HomeComponent } from './home/home.component'
import { ApproveComponent } from './approve/approve.component'
import { ApproveDetailsComponent } from './approve-details/approve-details.component'
import { ActionsComponent } from './actions/actions.component'
import { HistoryComponent } from './history/history.component'
import { NotFoundComponent } from './not-found/not-found.component' import { NotFoundComponent } from './not-found/not-found.component'
import { SubmitterComponent } from './submitter/submitter.component'
import { ApproveRouteComponent } from './routes/approve-route/approve-route.component' import { ReviewRouteComponent } from './routes/review-route/review-route.component'
import { DeployComponent } from './deploy/deploy.component'
import { LicensingComponent } from './licensing/licensing.component'
import { LicensingGuard } from './routes/licensing.guard'
import { StageModule } from './stage/stage.module' import { StageModule } from './stage/stage.module'
import { EditorModule } from './editor/editor.module' import { EditorModule } from './editor/editor.module'
import { ViewerModule } from './viewer/viewer.module' import { ViewerModule } from './viewer/viewer.module'
import { SystemComponent } from './system/system.component' import { ReviewModule } from './review/review.module'
import { DeployModule } from './deploy/deploy.module'
import { LicensingModule } from './licensing/licensing.module'
import { SystemModule } from './system/system.module'
/**
* Defining routes
*/
export const ROUTES: Routes = [ export const ROUTES: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' }, { path: '', redirectTo: 'home', pathMatch: 'full' },
{ {
@ -30,23 +28,28 @@ export const ROUTES: Routes = [
loadChildren: () => ViewerModule loadChildren: () => ViewerModule
}, },
{ {
path: 'approve', /**
component: ApproveRouteComponent, * Load review module (approve, history, submitted)
*/
path: 'review',
component: ReviewRouteComponent,
children: [ children: [
{ path: '', pathMatch: 'full', redirectTo: 'toapprove' }, { path: '', pathMatch: 'full', redirectTo: 'toapprove' },
{ path: 'toapprove', component: ApproveComponent }, {
{ path: 'approveDet/:tableId', component: ApproveDetailsComponent }, path: '',
{ path: 'submitted', component: SubmitterComponent } loadChildren: () => ReviewModule
}
] ]
}, },
{ {
path: 'licensing/:action', path: 'licensing',
component: LicensingComponent, loadChildren: () => LicensingModule
canActivate: [LicensingGuard],
canDeactivate: [LicensingGuard]
}, },
{ path: 'home', component: HomeComponent }, { path: 'home', component: HomeComponent },
{ {
/**
* Load editor module with subroutes
*/
path: 'editor', path: 'editor',
loadChildren: () => EditorModule loadChildren: () => EditorModule
}, },
@ -54,16 +57,20 @@ export const ROUTES: Routes = [
path: 'stage', path: 'stage',
loadChildren: () => StageModule loadChildren: () => StageModule
}, },
{ path: 'system', component: SystemComponent }, {
{ path: 'actions/:libds/:dsid', component: ActionsComponent }, path: 'system',
{ path: 'history', component: HistoryComponent }, loadChildren: () => SystemModule
{ path: 'submitted', component: SubmitterComponent }, },
{ path: 'submitted/:tableId', component: SubmitterComponent }, {
{ path: 'deploy', component: DeployComponent }, path: 'deploy',
{ path: 'deploy/manualdeploy', component: DeployComponent }, loadChildren: () => DeployModule
},
{ path: '**', component: NotFoundComponent } { path: '**', component: NotFoundComponent }
] ]
/**
* Exporting routes
*/
export const ROUTING: ModuleWithProviders<RouterModule> = RouterModule.forRoot( export const ROUTING: ModuleWithProviders<RouterModule> = RouterModule.forRoot(
ROUTES, ROUTES,
{ useHash: true } { useHash: true }

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { DeployComponent } from './deploy.component'
const routes: Routes = [
{ path: '', component: DeployComponent },
{ path: 'manualdeploy', component: DeployComponent }
]
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DeployRoutingModule {}

View File

@ -78,6 +78,9 @@ export class DeployComponent implements OnInit {
this.setDeployDefaults() this.setDeployDefaults()
} }
/**
* Setting default values used for deploy request
*/
public setDeployDefaults() { public setDeployDefaults() {
this.dcPath = this.dcAdapterSettings?.dcPath || '' this.dcPath = this.dcAdapterSettings?.dcPath || ''
this.selectedAdminGroup = this.dcAdapterSettings?.adminGroup || '' this.selectedAdminGroup = this.dcAdapterSettings?.adminGroup || ''
@ -86,6 +89,9 @@ export class DeployComponent implements OnInit {
} }
} }
/**
* Accepting terms of service shows next screen
*/
public termsAgreeChange() { public termsAgreeChange() {
if (!this.autodeploy) { if (!this.autodeploy) {
this.getAdminGroups() this.getAdminGroups()
@ -94,6 +100,9 @@ export class DeployComponent implements OnInit {
this.step++ this.step++
} }
/**
* Fetches admin groups from VIYA to be selected for a backend deploy
*/
public getAdminGroups() { public getAdminGroups() {
fetch( fetch(
this.sasJsConfig.serverUrl + '/identities/groups?sortBy=name&limit=5000', this.sasJsConfig.serverUrl + '/identities/groups?sortBy=name&limit=5000',

View File

@ -0,0 +1,20 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { DeployComponent } from './deploy.component'
import { AutomaticComponent } from './sections/automatic/automatic.component'
import { ManualComponent } from './sections/manual/manual.component'
import { SasjsConfiguratorComponent } from './sections/sasjs-configurator/sasjs-configurator.component'
import { ClarityModule } from '@clr/angular'
import { FormsModule } from '@angular/forms'
import { DeployRoutingModule } from './deploy-routing.module'
@NgModule({
declarations: [
DeployComponent,
AutomaticComponent,
ManualComponent,
SasjsConfiguratorComponent
],
imports: [CommonModule, FormsModule, ClarityModule, DeployRoutingModule]
})
export class DeployModule {}

View File

@ -55,6 +55,13 @@ export class AutomaticComponent implements OnInit {
ngOnInit(): void {} ngOnInit(): void {}
/**
* Executes sas.json file to deploy the backend
* Method will first try to run the `auto deploy`
* If that fails the rest of the code is ignored.
* If request is successfull, method will continue to try
* to create database if checkbox is toggled on
*/
public async executeJson() { public async executeJson() {
this.autodeploying = true this.autodeploying = true
this.isSubmittingJson = true this.isSubmittingJson = true
@ -99,6 +106,9 @@ export class AutomaticComponent implements OnInit {
} }
} }
/**
* Runs the `makedata` request sending the ADMIN and DCPATH values
*/
public createDatabase() { public createDatabase() {
let data = { let data = {
fromjs: [ fromjs: [

View File

@ -52,6 +52,9 @@ export class ManualComponent implements OnInit {
ngOnInit(): void {} ngOnInit(): void {}
/**
* FIXME: Remove
*/
public async executableContext() { public async executableContext() {
// getExecutableContexts now need AuthConfig parameter which we don't have on web // getExecutableContexts now need AuthConfig parameter which we don't have on web
// this.contextsLoading = true // this.contextsLoading = true
@ -65,10 +68,16 @@ export class ManualComponent implements OnInit {
// this.contextsLoading = false // this.contextsLoading = false
} }
/**
* Removes sas.json file attached to the input
*/
public clearUploadInput(event: Event) { public clearUploadInput(event: Event) {
this.deployService.clearUploadInput(event) this.deployService.clearUploadInput(event)
} }
/**
* Reads attached SAS file to be sent to sas for execution (backend deploy)
*/
public onSasFileChange(event: any) { public onSasFileChange(event: any) {
this.preloadedFile = false this.preloadedFile = false
@ -93,12 +102,18 @@ export class ManualComponent implements OnInit {
fileReader.readAsText(file) fileReader.readAsText(file)
} }
/**
* Reads attached JSON file to be sent to sas for execution (backend deploy)
*/
public async onJsonFileChange(event: any) { public async onJsonFileChange(event: any) {
let file = event.target.files[0] let file = event.target.files[0]
this.jsonFile = await this.deployService.readFile(file) this.jsonFile = await this.deployService.readFile(file)
} }
/**
* Appending precode lines to the attached sas or json file for backend deploy
*/
public addPrecodeLines() { public addPrecodeLines() {
let headerLines = [ let headerLines = [
`%let context=${this.selectedContext};`, `%let context=${this.selectedContext};`,
@ -110,6 +125,9 @@ export class ManualComponent implements OnInit {
this.linesOfCode.unshift(...headerLines) this.linesOfCode.unshift(...headerLines)
} }
/**
* Downloadng file with precode included
*/
public downloadSasPrecodeFile() { public downloadSasPrecodeFile() {
let linesAsText = this.linesOfCode.join('\n') let linesAsText = this.linesOfCode.join('\n')
let filename = this.fileName.split('.')[0] let filename = this.fileName.split('.')[0]
@ -117,6 +135,9 @@ export class ManualComponent implements OnInit {
this.downloadFile(linesAsText, filename, 'sas') this.downloadFile(linesAsText, filename, 'sas')
} }
/**
* Used for downloading log and repsonse as a file
*/
public downloadFile( public downloadFile(
content: any, content: any,
filename: string, filename: string,
@ -125,10 +146,17 @@ export class ManualComponent implements OnInit {
this.deployService.downloadFile(content, filename, extension) this.deployService.downloadFile(content, filename, extension)
} }
/**
* Saving dcpath to localstorage
* FIXME: maybe it'snot necessary
*/
public saveDcPath() { public saveDcPath() {
localStorage.setItem('deploy_dc_loc', this.dcPath) localStorage.setItem('deploy_dc_loc', this.dcPath)
} }
/**
* Send sas.json to be executed (deploying backend)
*/
public async executeJson() { public async executeJson() {
this.isSubmittingJson = true this.isSubmittingJson = true
@ -162,6 +190,9 @@ export class ManualComponent implements OnInit {
this.isSubmittingJson = false this.isSubmittingJson = false
} }
/**
* Send sas file to be executed (deploying backend)
*/
public async executeSAS() { public async executeSAS() {
this.executingScript = true this.executingScript = true
this.jobLog = '' this.jobLog = ''
@ -194,6 +225,10 @@ export class ManualComponent implements OnInit {
} }
} }
/**
* Running makedata service
* @param newTab open and run in new tab
*/
public createDatabase(newTab: boolean = true) { public createDatabase(newTab: boolean = true) {
if (newTab) { if (newTab) {
let url = let url =

View File

@ -5,7 +5,6 @@ import { ServerType } from '@sasjs/utils/types/serverType'
import { DcAdapterSettings } from 'src/app/models/DcAdapterSettings' import { DcAdapterSettings } from 'src/app/models/DcAdapterSettings'
import { SASGroup } from 'src/app/models/sas/public-getgroups.model' import { SASGroup } from 'src/app/models/sas/public-getgroups.model'
import { SASjsApiServerInfo } from 'src/app/models/sasjs-api/SASjsApiServerInfo.model' import { SASjsApiServerInfo } from 'src/app/models/sasjs-api/SASjsApiServerInfo.model'
import { HelperService } from 'src/app/services/helper.service'
import { SasService } from 'src/app/services/sas.service' import { SasService } from 'src/app/services/sas.service'
import { SasjsService } from 'src/app/services/sasjs.service' import { SasjsService } from 'src/app/services/sasjs.service'
@ -51,6 +50,9 @@ export class SasjsConfiguratorComponent implements OnInit {
this.getServerInfo() this.getServerInfo()
} }
/**
* Fethes the sasjs server instance info
*/
getServerInfo() { getServerInfo() {
this.sasjsService this.sasjsService
.getServerInfo() .getServerInfo()
@ -59,6 +61,9 @@ export class SasjsConfiguratorComponent implements OnInit {
}) })
} }
/**
* Fetches user groups from the `usernav/usergroupsbymember` service
*/
getUserGroups() { getUserGroups() {
this.loading = true this.loading = true
@ -99,6 +104,9 @@ export class SasjsConfiguratorComponent implements OnInit {
) )
} }
/**
* Creating database
*/
makeData() { makeData() {
// const _debug = "&_debug=131"; //debug on // const _debug = "&_debug=131"; //debug on
const _debug = ' ' //debug off const _debug = ' ' //debug off

View File

@ -14,7 +14,9 @@ export class DragNdropDirective {
@Output() fileDropped = new EventEmitter<any>() @Output() fileDropped = new EventEmitter<any>()
@Output() fileDraggedOver = new EventEmitter<any>() @Output() fileDraggedOver = new EventEmitter<any>()
// Dragover listener /**
* Dragover listener
*/
@HostListener('dragover', ['$event']) @HostListener('dragover', ['$event'])
onDragOver(event: any) { onDragOver(event: any) {
event.preventDefault() event.preventDefault()
@ -26,7 +28,9 @@ export class DragNdropDirective {
} }
} }
// Dragleave listener /**
* Dragleave listener
*/
@HostListener('dragleave', ['$event']) @HostListener('dragleave', ['$event'])
public onDragLeave(event: any) { public onDragLeave(event: any) {
event.preventDefault() event.preventDefault()
@ -34,7 +38,9 @@ export class DragNdropDirective {
this.fileOver = false this.fileOver = false
} }
// Drop listener /**
* Drop listener
*/
@HostListener('drop', ['$event']) @HostListener('drop', ['$event'])
public ondrop(event: any) { public ondrop(event: any) {
event.preventDefault() event.preventDefault()
@ -48,6 +54,9 @@ export class DragNdropDirective {
} }
} }
/**
* Checks wether dragging element contain files
*/
private containsFiles(event: any) { private containsFiles(event: any) {
if (event && event.dataTransfer && event.dataTransfer.types) { if (event && event.dataTransfer && event.dataTransfer.types) {
for (let i = 0; i < event.dataTransfer.types.length; i++) { for (let i = 0; i < event.dataTransfer.types.length; i++) {

View File

@ -22,6 +22,9 @@ export class FileDropDirective {
this.element = element this.element = element
} }
/**
* Dragging element drop event
*/
@HostListener('drop', ['$event']) @HostListener('drop', ['$event'])
onDrop(event: DragEvent): void { onDrop(event: DragEvent): void {
this._preventAndStop(event) this._preventAndStop(event)
@ -39,6 +42,9 @@ export class FileDropDirective {
this.fileDrop.emit(fileList) this.fileDrop.emit(fileList)
} }
/**
* Dragging element drag over event
*/
@HostListener('dragover', ['$event']) @HostListener('dragover', ['$event'])
onDragOver(event: DragEvent): void { onDragOver(event: DragEvent): void {
this._preventAndStop(event) this._preventAndStop(event)
@ -59,6 +65,10 @@ export class FileDropDirective {
this.fileOver.emit(false) this.fileOver.emit(false)
} }
/**
* Prevent propagation trough elements and stop default behavior
* For particular event
*/
protected _preventAndStop(event: MouseEvent): void { protected _preventAndStop(event: MouseEvent): void {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()

View File

@ -21,6 +21,9 @@ export class FileSelectDirective {
this.element = element this.element = element
} }
/**
* Checks if files exist in the input after input change
*/
isEmptyAfterSelection(): boolean { isEmptyAfterSelection(): boolean {
return !!this.element.nativeElement.attributes.multiple return !!this.element.nativeElement.attributes.multiple
} }

View File

@ -1,7 +0,0 @@
export interface RowValidation {
valid: boolean
invalidError: string
rowNumber?: number
colName?: string
value?: string
}

View File

@ -59,6 +59,12 @@ export class EditRecordComponent implements OnInit {
ngOnInit(): void {} ngOnInit(): void {}
/**
* Runs native HOT validator against cell value
* @param cellValidation column rules
* @param cellValue value in the cell that is beign validated
* @returns Promise boolean - wether valid or invalid
*/
async validateRecordCol( async validateRecordCol(
cellValidation: any, cellValidation: any,
cellValue: any cellValue: any
@ -74,6 +80,12 @@ export class EditRecordComponent implements OnInit {
}) })
} }
/**
* Fired when date field in the record change
* Function will parse date and format to string
* @param date picker value
* @param colKey column name (key)
*/
recordDateChange(date: Date, colKey: string) { recordDateChange(date: Date, colKey: string) {
let cellValidation = this.currentRecordValidator?.getRule(colKey) let cellValidation = this.currentRecordValidator?.getRule(colKey)
let format = cellValidation ? cellValidation.dateFormat : '' let format = cellValidation ? cellValidation.dateFormat : ''
@ -82,24 +94,38 @@ export class EditRecordComponent implements OnInit {
this.currentRecord[colKey] = moment(date).format(format) this.currentRecord[colKey] = moment(date).format(format)
} }
isRecordModalInvalid(): boolean { /**
return this.currentRecordInvalidCols.length > 0 * Close edit record modal and apply changes by emitting output event
} */
confirmRecordEdit() { confirmRecordEdit() {
if (this.currentRecordInvalidCols.length < 1) { if (this.currentRecordInvalidCols.length < 1) {
this.onRecordChange.emit(this.currentRecord) this.onRecordChange.emit(this.currentRecord)
} }
} }
/**
* Close edit record modal without applying the changes
*/
closeRecordEdit() { closeRecordEdit() {
this.onRecordEditClose.emit() this.onRecordEditClose.emit()
} }
/**
* Emitting output event when dropdown (autocomplete) input in any col change
* @param colName column name (key)
* @param col column index
*/
onRecordDropdownChange(colName: string, col: number) { onRecordDropdownChange(colName: string, col: number) {
this.onRecordDropdownChanged.emit({ colName, col }) this.onRecordDropdownChanged.emit({ colName, col })
} }
/**
* Emitting output event when input is focused (clicked on) so we can run a `dynamic cell validation`
* Since that bit must be run from the parent component (editor.component)
* Result is then applied in the `cellValidation` variable and automatically updated in this component.
* @param event input event
* @param colName column name (key)
*/
onRecordInputFocus(event: any, colName: number) { onRecordInputFocus(event: any, colName: number) {
this.onRecordInputFocused.emit({ event, colName }) this.onRecordInputFocused.emit({ event, colName })
} }

View File

@ -15,7 +15,15 @@ import { Subject, Subscription } from 'rxjs'
import { SasStoreService } from '../services/sas-store.service' import { SasStoreService } from '../services/sas-store.service'
import * as XLSX from '@sheet/crypto' import * as XLSX from '@sheet/crypto'
/**
* Used in combination with buffer
*/
const iconv = require('iconv-lite') const iconv = require('iconv-lite')
/**
* In combination with `iconv` is used for encoding json data captured with sheet js from excel file into a file again
* Which will be send to backend
*/
const Buffer = require('buffer/').Buffer const Buffer = require('buffer/').Buffer
type AOA = any[][] type AOA = any[][]
@ -374,6 +382,9 @@ export class EditorComponent implements OnInit, AfterViewInit {
this.setRestrictions() this.setRestrictions()
} }
/**
* Prepare feature restrictions based on licence key
*/
private parseRestrictions() { private parseRestrictions() {
this.restrictions.restrictAddRecord = this.restrictions.restrictAddRecord =
this.licenceState.value.addRecord === false this.licenceState.value.addRecord === false
@ -383,6 +394,10 @@ export class EditorComponent implements OnInit, AfterViewInit {
this.licenceState.value.fileUpload === false this.licenceState.value.fileUpload === false
} }
/**
* Applying prepared restrictions
* @param overrideRestrictions can be used to apply and override specific restrictions
*/
private setRestrictions(overrideRestrictions?: EditorRestrictions) { private setRestrictions(overrideRestrictions?: EditorRestrictions) {
if (overrideRestrictions) { if (overrideRestrictions) {
this.restrictions = { this.restrictions = {
@ -402,6 +417,9 @@ export class EditorComponent implements OnInit, AfterViewInit {
} }
} }
/**
* Disabling add row button based on wether rows limit is present
*/
private checkRowLimit() { private checkRowLimit() {
if (this.columnLevelSecurityFlag) return if (this.columnLevelSecurityFlag) return
@ -416,12 +434,19 @@ export class EditorComponent implements OnInit, AfterViewInit {
} }
} }
/**
* Resetting filter variables
*/
public resetFilter() { public resetFilter() {
if (this.queryFilterCompList.first) { if (this.queryFilterCompList.first) {
this.queryFilterCompList.first.resetFilter() this.queryFilterCompList.first.resetFilter()
} }
} }
/**
* Openning file upload modal
* If feature is locked, `feature locked` modal will be shown
*/
public onShowUploadModal() { public onShowUploadModal() {
if (this.restrictions.restrictFileUpload) { if (this.restrictions.restrictFileUpload) {
this.eventService.showDemoLimitModal('File Upload') this.eventService.showDemoLimitModal('File Upload')
@ -439,6 +464,10 @@ export class EditorComponent implements OnInit, AfterViewInit {
if (!this.uploadPreview) this.showUploadModal = true if (!this.uploadPreview) this.showUploadModal = true
} }
/**
* Called by FileDropDirective
* @param e true if file is dragged over the drop zone
*/
public fileOverBase(e: boolean): void { public fileOverBase(e: boolean): void {
this.hasBaseDropZoneOver = e this.hasBaseDropZoneOver = e
} }
@ -620,6 +649,10 @@ export class EditorComponent implements OnInit, AfterViewInit {
return returnObj return returnObj
} }
/**
* When excel is password protected we will display the password promppt for user to type password in.
* @returns Password user input or undefined if discarded by user
*/
public promptExcelPassword(): Promise<string | undefined> { public promptExcelPassword(): Promise<string | undefined> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.filePasswordModal = true this.filePasswordModal = true
@ -645,6 +678,13 @@ export class EditorComponent implements OnInit, AfterViewInit {
}) })
} }
/**
* Parses attached file, to be uploaded
* If attached file is CSV it will be send to backend straight away
* If attached file is EXCEL it will be displayed in the table, in preview mode
* @param event file drop event
* @param dropped whether it's dropped or added by browse button
*/
public getFileDesc(event: any, dropped: boolean = false) { public getFileDesc(event: any, dropped: boolean = false) {
this.excelUploadState = 'Loading' this.excelUploadState = 'Loading'
this.excelFileParsing = true this.excelFileParsing = true
@ -1010,6 +1050,9 @@ export class EditorComponent implements OnInit, AfterViewInit {
} }
} }
/**
* Submits attached excel file that is in preview mode
*/
public submitExcel() { public submitExcel() {
if (this.licenceState.value.submit_rows_limit !== Infinity) { if (this.licenceState.value.submit_rows_limit !== Infinity) {
this.submitLimitNotice = true this.submitLimitNotice = true
@ -1019,6 +1062,9 @@ export class EditorComponent implements OnInit, AfterViewInit {
this.getFile() this.getFile()
} }
/**
* This method will run validations and upload all of the pending files that are in the uploader queue
*/
public getFile() { public getFile() {
if (this.checkInvalid()) { if (this.checkInvalid()) {
this.eventService.showAbortModal(null, 'Invalid values are present.') this.eventService.showAbortModal(null, 'Invalid values are present.')
@ -1091,6 +1137,9 @@ export class EditorComponent implements OnInit, AfterViewInit {
) )
} }
/**
* After excel file is attached and parsed, this function will display it's content in the HOT table in read only mode
*/
public getPendingExcelPreview() { public getPendingExcelPreview() {
this.queryTextSaved = this.queryText this.queryTextSaved = this.queryText
this.queryText = '' this.queryText = ''
@ -1142,46 +1191,12 @@ export class EditorComponent implements OnInit, AfterViewInit {
this.excelFileParsing = false this.excelFileParsing = false
this.excelUploadState = null this.excelUploadState = null
}) })
/**
* This is half validation feature to speed up file upload
* Currently disabled but will leave it here in case it needs to be re-enabled
*/
// this.excelUploadState = 'Validating-DQ'
// this.validateRowsOnPendingExcel(
// async (rowValidation: RowValidation | undefined) => {
// if (rowValidation) {
// this.eventService.showAbortModal(
// 'Excel validation',
// `Please fix the data and re-submit the file. Invalid data details: <br><br> Row: ${rowValidation.rowNumber} <br> Column: ${rowValidation.colName} <br> Reason: <strong>${rowValidation.invalidError}</strong> <br> Invalid value: ${rowValidation.value}`
// )
// this.excelFileParsing = false
// this.excelUploadState = null
// } else {
// this.excelUploadState = 'Validating-HOT'
// hot.updateSettings(
// {
// data: this.dataSource
// },
// false
// )
// hot.render()
// hot.validateCells(() => {
// this.showUploadModal = false
// this.uploadPreview = true
// this.excelFileParsing = false
// this.excelUploadState = null
// })
// }
// }
// )
} }
/**
* Drops the attached excel file
* @param discardData wheter to discard data parsed from the file or to keep it in the table after dropping a attached excel file
*/
public discardPendingExcel(discardData?: boolean) { public discardPendingExcel(discardData?: boolean) {
this.hotInstance.updateSettings({ this.hotInstance.updateSettings({
maxRows: this.licenceState.value.editor_rows_allowed maxRows: this.licenceState.value.editor_rows_allowed
@ -1205,6 +1220,10 @@ export class EditorComponent implements OnInit, AfterViewInit {
} }
} }
/**
* Drops attached excel file, keeps it's data in the DC table
* User can now edit the table and submit. Witout the file present.
*/
public previewTableEditConfirm() { public previewTableEditConfirm() {
this.discardPendingExcel() this.discardPendingExcel()
this.convertToCorrectTypes(this.dataSource) this.convertToCorrectTypes(this.dataSource)

View File

@ -1,5 +1,10 @@
import { DcValidation } from 'src/app/shared/dc-validator/models/dc-validation.model' import { DcValidation } from 'src/app/shared/dc-validator/models/dc-validation.model'
/**
* Wrapper for DC Validation because we need `noLinkOption` property
* to be used as a flag to show/hide button that generates link for the
* edit record modal
*/
export interface EditRecordModal extends DcValidation { export interface EditRecordModal extends DcValidation {
noLinkOption: boolean noLinkOption: boolean
[key: string]: any [key: string]: any

View File

@ -1,19 +0,0 @@
export interface CellValidation {
data: string
length: number
type?: string
source: string[]
format?: number
validator?: any
valid?: boolean
renderer?: any
dateFormat?: string
readOnly?: boolean
desc?: string
correctFormat?: boolean
/**
* Key for accessing object fields, any type because it can be
* any of the types interface have
*/
[key: string]: any
}

View File

@ -1,36 +0,0 @@
export enum ColumnType {
string = 'string',
number = 'number'
}
export interface ColumnInterface {
id: number | undefined
name: string | undefined
type: ColumnType | undefined
length: number | undefined
}
export class Column implements ColumnInterface {
public id: number | undefined
public name: string | undefined
public type: ColumnType | undefined
public length: number | undefined
public static fromPlainObject(obj: object) {
return Object.assign(new Column(), obj)
}
constructor(id?: number, name?: string, type?: ColumnType, length?: number) {
this.id = id
this.name = name
this.type = type
this.length = length
}
get hsType() {
return (
(this.type === ColumnType.string && 'text') ||
(this.type === ColumnType.number && 'numeric') ||
null
)
}
}

View File

@ -1,3 +1,7 @@
/**
* Model for the dynamic cell validation in the editor
* (sending whole row to the backend service and recieving data for the cell dropdown)
*/
export interface DynamicExtendedCellValidation { export interface DynamicExtendedCellValidation {
DISPLAY_INDEX: number DISPLAY_INDEX: number
DISPLAY_TYPE: string DISPLAY_TYPE: string

View File

@ -1,8 +1,14 @@
/**
* Edit record modal - input has been focused event
*/
export interface EditRecordInputFocusedEvent { export interface EditRecordInputFocusedEvent {
event: any event: any
colName: number colName: number
} }
/**
* Edit record modal - dropdown has been changed event
*/
export interface EditRecordDropdownChangeEvent { export interface EditRecordDropdownChangeEvent {
colName: string colName: string
col: number col: number

View File

@ -1,3 +1,6 @@
/**
* Editor restrictions model (based on the licencing)
*/
export interface EditorRestrictions { export interface EditorRestrictions {
restrictEditRecord?: boolean // Feature is locked but edit/add record buttons are visible so when user clicks he gets the `locked feature modal` restrictEditRecord?: boolean // Feature is locked but edit/add record buttons are visible so when user clicks he gets the `locked feature modal`
restrictAddRecord?: boolean // Same as editRecord, but for addRecord restrictAddRecord?: boolean // Same as editRecord, but for addRecord

View File

@ -1,71 +0,0 @@
import { Column, ColumnType } from './models/column'
export enum TableType {
INPUT = 'In',
OUTPUT = 'Out'
}
export interface TableInterface {
id: number | undefined
name: string | undefined
data: Array<Object>
columns: Array<Column>
type: TableType | undefined
}
export class Table implements TableInterface {
public id: number | undefined
public name: string | undefined
public data: Array<any>
public columns: Array<Column> = []
public type: TableType | undefined
public static fromPlainObject(obj: any) {
obj.columns = obj.columns.map((column: object) => {
return Column.fromPlainObject(column)
})
return Object.assign(new Table(), obj)
}
constructor(
id?: number,
name?: string,
type?: TableType,
data?: Array<Object>,
columns?: Array<Column>
) {
this.id = id
this.name = name
this.type = type
this.data = data || [{}]
this.columns = columns || []
}
public getNextColumnId(): number {
let highestIdColumn: any = this.columns.sort(
(cA: any, cB: any) => cA.id - cB.id
)[this.columns.length - 1]
return (highestIdColumn && highestIdColumn.id + 1) || 0
}
public addColumn(column: Column) {
this.columns.push(column)
this.data.forEach((row: any) => {
if (column.name) {
row[column.name] = column.type === ColumnType.string ? '' : null
}
})
return column
}
public removeColumn(colInd: any) {
this.data.forEach((row) => {
delete row[this.columns[colInd].name!]
})
this.columns.splice(colInd, 1)
}
}

View File

@ -1,3 +1,6 @@
/**
* Converting date object to the UTC time string
*/
export const dateToUtcTime = (date: Date) => { export const dateToUtcTime = (date: Date) => {
let timeStr = ('0' + date.getUTCHours()).slice(-2) + ':' let timeStr = ('0' + date.getUTCHours()).slice(-2) + ':'
timeStr = timeStr + ('0' + date.getUTCMinutes()).slice(-2) + ':' timeStr = timeStr + ('0' + date.getUTCMinutes()).slice(-2) + ':'
@ -5,6 +8,9 @@ export const dateToUtcTime = (date: Date) => {
return timeStr return timeStr
} }
/**
* Converts date object to the time string
*/
export const dateToTime = (date: Date) => { export const dateToTime = (date: Date) => {
let timeStr = ('0' + date.getHours()).slice(-2) + ':' let timeStr = ('0' + date.getHours()).slice(-2) + ':'
timeStr = timeStr + ('0' + date.getMinutes()).slice(-2) + ':' timeStr = timeStr + ('0' + date.getMinutes()).slice(-2) + ':'
@ -12,6 +18,9 @@ export const dateToTime = (date: Date) => {
return timeStr return timeStr
} }
/**
* Converts date object to the YYYY-MM-DD
*/
export const dateFormat = (date: Date) => { export const dateFormat = (date: Date) => {
return ( return (
date.getFullYear() + date.getFullYear() +

View File

@ -1,9 +1,17 @@
import { Col } from 'src/app/shared/dc-validator/models/col.model' import { Col } from 'src/app/shared/dc-validator/models/col.model'
/**
* Converts excel date serial number to JS date
*/
export const excelDateToJSDate = (serial: number) => { export const excelDateToJSDate = (serial: number) => {
return new Date(Math.round((serial - 25569) * 86400 * 1000)) return new Date(Math.round((serial - 25569) * 86400 * 1000))
} }
/**
* Parsing table columns for the HOT in editor
* Converts array of objects into array of strings, every string is column name (key)
* @param data array of objects (columns data)
*/
export const parseTableColumns = (data: Col[]): string[] => { export const parseTableColumns = (data: Col[]): string[] => {
const columns: string[] = [] const columns: string[] = []
@ -16,6 +24,12 @@ export const parseTableColumns = (data: Col[]): string[] => {
return columns return columns
} }
/**
* Captures headers that are not found in the current table but is found in the uploaded file data
* @param data
* @param headers
* @returns string array of missing headers
*/
export const getMissingHeaders = (data: any, headers: any) => { export const getMissingHeaders = (data: any, headers: any) => {
const missingHeaders: string[] = [] const missingHeaders: string[] = []
const remainingHeaders: string[] = [] const remainingHeaders: string[] = []

View File

@ -1,3 +1,7 @@
/**
* Custom renderer for HOT cell
* Used to show error icon
*/
export const errorRenderer = ( export const errorRenderer = (
instance: any, instance: any,
td: any, td: any,
@ -14,6 +18,10 @@ export const errorRenderer = (
return td return td
} }
/**
* Custom renderer for HOT cell
* Used to revert cell back to original state (no spinner, no error)
*/
export const noSpinnerRenderer = ( export const noSpinnerRenderer = (
instance: any, instance: any,
td: any, td: any,
@ -28,7 +36,11 @@ export const noSpinnerRenderer = (
return td return td
} }
// Spinner shown whilst waiting for SAS to respond /**
* Custom renderer for HOT cell
* Used to show loading spinner in the cell
* (Spinner shown whilst waiting for SAS to respond)
*/
export const spinnerRenderer = ( export const spinnerRenderer = (
instance: any, instance: any,
td: any, td: any,

View File

@ -0,0 +1,19 @@
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { LicensingGuard } from '../routes/licensing.guard'
import { LicensingComponent } from './licensing.component'
const routes: Routes = [
{
path: ':action',
component: LicensingComponent,
canActivate: [LicensingGuard],
canDeactivate: [LicensingGuard]
}
]
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LicensingRoutingModule {}

View File

@ -0,0 +1,20 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { LicensingRoutingModule } from './licensing-routing.module'
import { ClarityModule } from '@clr/angular'
import { SharedModule } from '../shared/shared.module'
import { LicensingComponent } from './licensing.component'
import { FormsModule } from '@angular/forms'
@NgModule({
declarations: [LicensingComponent],
imports: [
CommonModule,
FormsModule,
ClarityModule,
LicensingRoutingModule,
SharedModule
]
})
export class LicensingModule {}

View File

@ -0,0 +1,5 @@
export interface ErrorBody {
message: string
details: any
raw: any
}

View File

@ -137,6 +137,11 @@ export class QueryComponent
public whereClause: string | undefined public whereClause: string | undefined
public logicOperators: Array<string> = ['AND', 'OR'] public logicOperators: Array<string> = ['AND', 'OR']
/**
* Temporary values array used in pickers
* because they need particular format to work
* before sending values to backend, values are parsed
*/
public queryDateTime: QueryDateTime[] = [] public queryDateTime: QueryDateTime[] = []
public currentClauseIndex: number = -1 public currentClauseIndex: number = -1
@ -158,6 +163,11 @@ export class QueryComponent
} }
} }
/**
* Gets and sets temporary values selected with DATETIME or TIME picker
* Those values are used for picker to work with format it lieks
* Later before sending values to backend, values are parsed
*/
getQueryDateTime(clauseIndex: number, queryIndex: number): QueryDateTime { getQueryDateTime(clauseIndex: number, queryIndex: number): QueryDateTime {
let existingQueryDateTime = this.queryDateTime.find( let existingQueryDateTime = this.queryDateTime.find(
(x) => x.clauseIndex === clauseIndex && x.queryIndex === queryIndex (x) => x.clauseIndex === clauseIndex && x.queryIndex === queryIndex
@ -178,10 +188,16 @@ export class QueryComponent
return existingQueryDateTime return existingQueryDateTime
} }
/**
* When toggling pickers feature we reset the temp picker values array
*/
usePickersChange() { usePickersChange() {
this.queryDateTime = [] this.queryDateTime = []
} }
/**
* Resets all variables used for filtering
*/
public resetFilter() { public resetFilter() {
this.whereString = undefined this.whereString = undefined
this.whereClause = undefined this.whereClause = undefined
@ -210,6 +226,10 @@ export class QueryComponent
this.whereClauseFn(true) this.whereClauseFn(true)
} }
/**
* `Globals` are used to store filtering state (variables) as a caching feature
* until browser reloads
*/
public setToGlobals() { public setToGlobals() {
if (!this.caching) return if (!this.caching) return
@ -237,6 +257,10 @@ export class QueryComponent
console.log('globals', globals) console.log('globals', globals)
} }
/**
* `Globals` are used to store filtering state (variables) as a caching feature
* until browser reloads
*/
public getFromGlobals() { public getFromGlobals() {
if (!this.caching) return if (!this.caching) return
@ -269,6 +293,11 @@ export class QueryComponent
} }
} }
/**
* Sets filtering multiple caluses group logic (and / or)
*
* @param groupLogic to set
*/
public setGroupLogic(groupLogic: any) { public setGroupLogic(groupLogic: any) {
this.groupLogic = groupLogic this.groupLogic = groupLogic
this.clauses.groupLogic = groupLogic this.clauses.groupLogic = groupLogic

View File

@ -1,13 +1,13 @@
import { ActivatedRoute } from '@angular/router' import { ActivatedRoute } from '@angular/router'
import { SasStoreService } from '../services/sas-store.service' import { SasStoreService } from '../../services/sas-store.service'
import { Component, AfterViewInit, OnDestroy } from '@angular/core' import { Component, AfterViewInit, OnDestroy } from '@angular/core'
import { Subscription } from 'rxjs' import { Subscription } from 'rxjs'
import { Router } from '@angular/router' import { Router } from '@angular/router'
import { EventService } from '../services/event.service' import { EventService } from '../../services/event.service'
import { import {
AuditorsPostdataSASResponse, AuditorsPostdataSASResponse,
Param Param
} from '../models/sas/auditors-postdata.model' } from '../../models/sas/auditors-postdata.model'
interface ChangesObj { interface ChangesObj {
ind: any ind: any
@ -89,7 +89,7 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
} }
public goToApprovalsList() { public goToApprovalsList() {
this.route.navigateByUrl('/approve') this.route.navigateByUrl('/review/approve')
} }
public getTable(tableId: any) { public getTable(tableId: any) {
@ -136,7 +136,7 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
await this.sasStoreService await this.sasStoreService
.rejecting(rejParams, 'BrowserParams', 'approvers/rejection') .rejecting(rejParams, 'BrowserParams', 'approvers/rejection')
.then((res: any) => { .then((res: any) => {
this.route.navigateByUrl('/history') this.route.navigateByUrl('/review/history')
}) })
.catch((err: any) => { .catch((err: any) => {
this.acceptLoading = false this.acceptLoading = false
@ -156,7 +156,7 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
await this.sasStoreService await this.sasStoreService
.approveTable(approveParams, 'SASControlTable', 'auditors/postdata') .approveTable(approveParams, 'SASControlTable', 'auditors/postdata')
.then((res: any) => { .then((res: any) => {
this.route.navigateByUrl('/history') this.route.navigateByUrl('/review/history')
}) })
.catch((err: any) => { .catch((err: any) => {
this.acceptLoading = false this.acceptLoading = false
@ -164,7 +164,7 @@ export class ApproveDetailsComponent implements AfterViewInit, OnDestroy {
} }
public goToSubmitList() { public goToSubmitList() {
this.route.navigateByUrl('/submitted') this.route.navigateByUrl('/review/submitted')
} }
public async callChangesInfo(tableId: any) { public async callChangesInfo(tableId: any) {

View File

@ -1,8 +1,8 @@
import { Component, OnInit, ChangeDetectorRef } from '@angular/core' import { Component, OnInit, ChangeDetectorRef } from '@angular/core'
import { SasStoreService } from '../services/sas-store.service' import { SasStoreService } from '../../services/sas-store.service'
import { Router } from '@angular/router' import { Router } from '@angular/router'
import { SasService } from '../services/sas.service' import { SasService } from '../../services/sas.service'
import { EventService } from '../services/event.service' import { EventService } from '../../services/event.service'
interface ApproveData { interface ApproveData {
tableId: string tableId: string
@ -45,7 +45,7 @@ export class ApproveComponent implements OnInit {
if (this.approveList !== undefined) { if (this.approveList !== undefined) {
this.tableId = this.approveList[ind].tableId this.tableId = this.approveList[ind].tableId
this.route.navigateByUrl( this.route.navigateByUrl(
'approve/approveDet/' + this.approveList[ind].tableId 'review/approveDet/' + this.approveList[ind].tableId
) )
} }
} }

View File

@ -1,11 +1,13 @@
import { Component, OnInit } from '@angular/core' import { Component, OnInit } from '@angular/core'
import { SasStoreService } from '../services/sas-store.service'
import { Router } from '@angular/router' import { Router } from '@angular/router'
import { SasService } from '../services/sas.service'
import { EventService } from '../services/event.service'
import { SASjsConfig } from '@sasjs/adapter' import { SASjsConfig } from '@sasjs/adapter'
import { LicenceService } from '../services/licence.service' import {
LicenceService,
SasStoreService,
EventService,
SasService
} from 'src/app/services'
@Component({ @Component({
selector: 'app-history', selector: 'app-history',

View File

@ -0,0 +1,22 @@
import { CommonModule } from '@angular/common'
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { ApproveDetailsComponent } from './approve-details/approve-details.component'
import { ApproveComponent } from './approve/approve.component'
import { SubmitterComponent } from './submitter/submitter.component'
import { HistoryComponent } from './history/history.component'
const ROUTES: Routes = [
{ path: 'approve', component: ApproveComponent },
{ path: 'approveDet/:tableId', component: ApproveDetailsComponent },
{ path: 'submitted', component: SubmitterComponent },
{ path: 'submitted/:tableId', component: SubmitterComponent },
{ path: 'history', component: HistoryComponent }
]
@NgModule({
declarations: [],
imports: [CommonModule, RouterModule.forChild(ROUTES)],
exports: [RouterModule]
})
export class ReviewRoutingModule {}

View File

@ -0,0 +1,31 @@
import { CommonModule } from '@angular/common'
import { NgModule } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { ClarityModule } from '@clr/angular'
import { HotTableModule } from '@handsontable/angular'
import { DirectivesModule } from '../directives/directives.module'
import { SharedModule } from '../shared/shared.module'
import { ApproveDetailsComponent } from './approve-details/approve-details.component'
import { ApproveComponent } from './approve/approve.component'
import { ReviewRoutingModule } from './review-routing.module'
import { SubmitterComponent } from './submitter/submitter.component'
import { HistoryComponent } from './history/history.component'
@NgModule({
declarations: [
ApproveComponent,
ApproveDetailsComponent,
SubmitterComponent,
HistoryComponent
],
imports: [
CommonModule,
FormsModule,
ReviewRoutingModule,
ClarityModule,
HotTableModule.forRoot(),
DirectivesModule,
SharedModule
]
})
export class ReviewModule {}

View File

@ -1,9 +1,7 @@
import { Component, AfterViewInit, OnInit } from '@angular/core' import { Component, AfterViewInit, OnInit } from '@angular/core'
import { Subscription } from 'rxjs' import { Subscription } from 'rxjs'
import { SasStoreService } from '../services/sas-store.service'
import { ActivatedRoute, Router } from '@angular/router' import { ActivatedRoute, Router } from '@angular/router'
import { SasService } from '../services/sas.service' import { SasStoreService, EventService, SasService } from '../../services'
import { EventService } from '../services/event.service'
interface SubmitterData { interface SubmitterData {
tableId: string tableId: string
@ -46,7 +44,7 @@ export class SubmitterComponent implements OnInit, AfterViewInit {
} }
public goToDetails(table_id: any) { public goToDetails(table_id: any) {
this.router.navigateByUrl('/submitted/' + table_id) this.router.navigateByUrl('/review/submitted/' + table_id)
} }
public getDetails(sub: any, index: any) { public getDetails(sub: any, index: any) {

View File

@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core'
@Component({
selector: 'app-approve-route',
templateUrl: './approve-route.component.html',
styleUrls: ['./approve-route.component.scss'],
host: {
class: 'content-container'
}
})
export class ApproveRouteComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@ -1 +0,0 @@
<router-outlet></router-outlet>

View File

@ -1,12 +0,0 @@
import { Component, OnInit } from '@angular/core'
@Component({
selector: 'app-edit-route',
templateUrl: './edit-route.component.html',
styleUrls: ['./edit-route.component.scss']
})
export class EditRouteComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@ -1 +0,0 @@
<router-outlet></router-outlet>

View File

@ -1,12 +0,0 @@
import { Component, OnInit } from '@angular/core'
@Component({
selector: 'app-history-route',
templateUrl: './history-route.component.html',
styleUrls: ['./history-route.component.scss']
})
export class HistoryRouteComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core'
@Component({
selector: 'app-review-route',
templateUrl: './review-route.component.html',
styleUrls: ['./review-route.component.scss'],
host: {
class: 'content-container'
}
})
export class ReviewRouteComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@ -17,6 +17,17 @@ export class HelperService {
console.log('Is IE or Edge?', this.isMicrosoft) console.log('Is IE or Edge?', this.isMicrosoft)
} }
/**
* Converts a JavaScript date object to a SAS Date or Datetime, given the logic below:
*
* A JS Date contains the number of _milliseconds_ since 01/01/1970
* A SAS Date contains the number of _days_ since 01/01/1960
* A SAS Datetime contains the number of _seconds_ since 01/01/1960
*
* @param jsDate JS Date to be converted. The type is instance of `Date`
* @param unit Unit in which to return the SAS Date / datetime, eg `sasdate | sasdatetime`
* @returns SAS Date value based on `unit` param
*/
public convertJsDateToSasDate( public convertJsDateToSasDate(
jsDate: string | Date, jsDate: string | Date,
unit: string = 'days' unit: string = 'days'
@ -63,6 +74,17 @@ export class HelperService {
return 0 return 0
} }
/**
* Converts a SAS Date or Datetime to a JavaScript date object, given the logic below:
*
* A JS Date contains the number of _milliseconds_ since 01/01/1970
* A SAS Date contains the number of _days_ since 01/01/1960
* A SAS Datetime contains the number of _seconds_ since 01/01/1960
*
* @param sasValue SAS Date or Datetime to be converted. The type could be `number` or `string.
* @param unit Unit from which to convert the SAS Date / Datetime, eg `sasdate | sasdatetime`
* @returns JavaScript Date object
*/
public convertSasDaysToJsDate( public convertSasDaysToJsDate(
sasValue: number | string, sasValue: number | string,
unit: string = 'days' unit: string = 'days'
@ -87,6 +109,11 @@ export class HelperService {
return new Date(msNegativeTenYears + sasValue * msInDay) return new Date(msNegativeTenYears + sasValue * msInDay)
} }
/**
*
* @param array all elements in the clarity tree
* @param arrToFilter sub array in the tree to be filtered for example `tables`
*/
public treeOnFilter(array: any, arrToFilter: string) { public treeOnFilter(array: any, arrToFilter: string) {
let search = array['searchString'] ? array['searchString'] : '' let search = array['searchString'] ? array['searchString'] : ''
let arrToFilterArray = arrToFilter.split('.')[0] let arrToFilterArray = arrToFilter.split('.')[0]

View File

@ -40,6 +40,16 @@ export class SasStoreService {
private loggerService: LoggerService private loggerService: LoggerService
) {} ) {}
/**
* Wrapper for making request to service
* Should be removed, as it's redundant now
* TODO: Refactor to call editors/getdata directly
* @param tableData
* @param tableName
* @param program
* @param libds
* @returns
*/
public async callService( public async callService(
tableData: Array<any>, tableData: Array<any>,
tableName: string, tableName: string,
@ -60,6 +70,15 @@ export class SasStoreService {
return response return response
} }
/**
* Calling editors/stagedata - saving table data, sending request to backend
* @param tableParams params to send to backend
* @param tableData data to be updated
* @param tableName name of the table to be updated
* @param program service against which we send request
* @param $dataFormats column data formats recieved from backend, sending it back
* @returns adapter.request() response
*/
public async updateTable( public async updateTable(
tableParams: any, tableParams: any,
tableData: any, tableData: any,
@ -86,6 +105,13 @@ export class SasStoreService {
return res return res
} }
/**
* Sending request to 'approvers/getapprovals' to fetch approvals list
* @param tableData sending to backend table data
* @param tableName sending to backend table name
* @param program service to run request on
* @returns HTTP Response
*/
public async getApprovals( public async getApprovals(
tableData: any, tableData: any,
tableName: string, tableName: string,
@ -96,6 +122,13 @@ export class SasStoreService {
let res: any = await this.sasService.request(program, tables) let res: any = await this.sasService.request(program, tables)
return res return res
} }
/**
* Interceptor for loading of the submitted details
* @param detail submitter
* @param index submitter index
* @param data submit data
*/
public async sendDetails(detail: any, index: any, data: any) { public async sendDetails(detail: any, index: any, data: any) {
let details = Object.assign({ sub: true }, detail) let details = Object.assign({ sub: true }, detail)
let subData = data[index] let subData = data[index]
@ -105,11 +138,20 @@ export class SasStoreService {
} }
this.submittDetail.next(allData) this.submittDetail.next(allData)
} }
/**
*
* @returns All submits
*/
public async getSubmitts() { public async getSubmitts() {
let res: any = await this.sasService.request('editors/getsubmits', null) let res: any = await this.sasService.request('editors/getsubmits', null)
return res return res
} }
/**
*
* @returns All libraries
*/
public async viewLibs() { public async viewLibs() {
return this.sasService.request('public/viewlibs', null) return this.sasService.request('public/viewlibs', null)
} }

View File

@ -13,6 +13,7 @@ import { DcAdapterSettings } from '../models/DcAdapterSettings'
import { AppStoreService } from './app-store.service' import { AppStoreService } from './app-store.service'
import { LoggerService } from './logger.service' import { LoggerService } from './logger.service'
import { RequestWrapperOptions } from '../models/RequestWrapperOptions' import { RequestWrapperOptions } from '../models/RequestWrapperOptions'
import { ErrorBody } from '../models/ErrorBody'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -39,6 +40,11 @@ export class SasService {
private router: Router private router: Router
) {} ) {}
/**
* Same as `setup` function in the sasjs.service, this is the constructor replacement.
* This function is being called by `app.service`.
* Because of timing and dependency issues
*/
public sasServiceInit() { public sasServiceInit() {
this.dcAdapterSettings = this.appStoreService.getDcAdapterSettings() this.dcAdapterSettings = this.appStoreService.getDcAdapterSettings()
@ -80,6 +86,16 @@ export class SasService {
} }
} }
/**
* Runing a backend request against a service.
* Function also handles the displaying of success or error modals.
*
* @param url service to run reuqest against
* @param data to be sent to backend service
* @param config additional parameters to force eg. { debug: false }
* @param wrapperOptions used to suppress error or success abort modals after request is finished
* @returns
*/
public request( public request(
url: string, url: string,
data: any, data: any,
@ -197,6 +213,14 @@ export class SasService {
}) })
} }
/**
* Uploads a file to the backend, using the adapter upload function.
*
* @param sasService Service to which the file will be sent
* @param files Files to be sent
* @param params Aditional parameters eg. { debug: false }
* @returns HTTP Response
*/
public uploadFile(sasService: string, files: UploadFile[], params: any) { public uploadFile(sasService: string, files: UploadFile[], params: any) {
return this.sasjsAdapter.uploadFile(sasService, files, params) return this.sasjsAdapter.uploadFile(sasService, files, params)
} }
@ -487,9 +511,3 @@ export class SasService {
} }
} }
} }
interface ErrorBody {
message: string
details: any
raw: any
}

View File

@ -25,6 +25,12 @@ export class SasjsService {
private appStoreService: AppStoreService private appStoreService: AppStoreService
) {} ) {}
/**
* This function is replacing the constructor.
* The reason for this is timing issues, other services eg. sas.service, app-store.service
* must be initialized before this bit of code is executed.
* This function is being called by `sas.service`
*/
setup() { setup() {
const adapterConfig = this.appStoreService.getDcAdapterSettings() const adapterConfig = this.appStoreService.getDcAdapterSettings()
@ -32,10 +38,18 @@ export class SasjsService {
this.driveUrl = `${this.url}/drive` this.driveUrl = `${this.url}/drive`
} }
/**
*
* @returns Sasjs/server information
*/
getServerInfo(): Observable<SASjsApiServerInfo> { getServerInfo(): Observable<SASjsApiServerInfo> {
return this.http.get<SASjsApiServerInfo>(`${this.url}/info`) return this.http.get<SASjsApiServerInfo>(`${this.url}/info`)
} }
/**
* Gets file contents on a given path
* @param filePath path to the file
*/
getFileFromDrive(filePath: string) { getFileFromDrive(filePath: string) {
return this.http.get( return this.http.get(
`${this.driveUrl}/file/?_filePath=${filePath}`, `${this.driveUrl}/file/?_filePath=${filePath}`,
@ -43,6 +57,11 @@ export class SasjsService {
) )
} }
/**
* Gets folder contents on a given path
* @param folderPath path to the folder
* @returns
*/
getFolderContentsFromDrive( getFolderContentsFromDrive(
folderPath: string folderPath: string
): Observable<SASjsApiDriveFolderContents> { ): Observable<SASjsApiDriveFolderContents> {

View File

@ -41,6 +41,14 @@ export class InfoModalComponent implements OnInit {
this.data = newData this.data = newData
} }
/**
* Wheter or not to show the `Open configurator button`
* Button used for navigating to the `configuration` page
* Only for SAS9
* @param sasService backend service that caused this info modal to be shown
* Decision is made based on that service path
* @returns
*/
showConfiguratorButton(sasService: string | null) { showConfiguratorButton(sasService: string | null) {
const sasjsConfig = this.sasService.getSasjsConfig() const sasjsConfig = this.sasService.getSasjsConfig()
@ -54,6 +62,9 @@ export class InfoModalComponent implements OnInit {
this.onConfirmModalClick.emit() this.onConfirmModalClick.emit()
} }
/**
* Only on SAS9, opening a backend configurator/deploy page
*/
openConfigurator() { openConfigurator() {
this.eventService.startupDataLoaded() this.eventService.startupDataLoaded()
this.router.navigateByUrl('/deploy') this.router.navigateByUrl('/deploy')

View File

@ -55,14 +55,14 @@
<a <a
*ngIf="isMainRoute('approve')" *ngIf="isMainRoute('approve')"
clrVerticalNavLink clrVerticalNavLink
routerLink="/approve/submitted" routerLink="/review/approve/submitted"
routerLinkActive="active" routerLinkActive="active"
>Submitted</a >Submitted</a
> >
<a <a
*ngIf="isMainRoute('approve')" *ngIf="isMainRoute('approve')"
clrVerticalNavLink clrVerticalNavLink
routerLink="/approve/toapprove" routerLink="/review/approve/toapprove"
routerLinkActive="active" routerLinkActive="active"
>To Approve</a >To Approve</a
> >

View File

@ -47,7 +47,7 @@ export class StageComponent implements OnInit {
} }
public approveTableScreen() { public approveTableScreen() {
this.route.navigateByUrl('/approve/approveDet/' + this.table_id) this.route.navigateByUrl('/review/approveDet/' + this.table_id)
} }
public viewerTableScreen() { public viewerTableScreen() {

View File

@ -0,0 +1,11 @@
import { NgModule } from '@angular/core'
import { RouterModule, Routes } from '@angular/router'
import { SystemComponent } from './system.component'
const routes: Routes = [{ path: '', component: SystemComponent }]
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class SystemRoutingModule {}

View File

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { SystemRoutingModule } from './system-routing.module'
import { SystemComponent } from './system.component'
import { ClarityModule } from '@clr/angular'
@NgModule({
declarations: [SystemComponent],
imports: [CommonModule, SystemRoutingModule, ClarityModule]
})
export class SystemModule {}

View File

@ -201,16 +201,28 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
) )
} }
/**
* Open viewboxes modal
*/
public newViewbox() { public newViewbox() {
this.viewboxOpen = true this.viewboxOpen = true
} }
/**
* Resetting filter variables
*/
public resetFilter() { public resetFilter() {
if (this.queryFilterCompList.first) { if (this.queryFilterCompList.first) {
this.queryFilterCompList.first.resetFilter() this.queryFilterCompList.first.resetFilter()
} }
} }
/**
* Searching table against particular string, data is comming from backend.
* There is also a toggle that will search for a numeric values
*
* @param inputElement input from which search string is captured
*/
public async searchTable(inputElement: any) { public async searchTable(inputElement: any) {
this.searchLoading = true this.searchLoading = true
@ -249,6 +261,9 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
this.searchLoading = false this.searchLoading = false
} }
/**
* Re sending request to backend and re-setting data in the HOT
*/
public reloadTableData() { public reloadTableData() {
this.viewData(this.urlFilterPk || 0) this.viewData(this.urlFilterPk || 0)
} }
@ -278,6 +293,9 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
) )
} }
/**
* FIXME: Should be removed, not used
*/
public filterFn(input: string) { public filterFn(input: string) {
let libraries = this.libraries let libraries = this.libraries
this.libraries = libraries.filter( this.libraries = libraries.filter(
@ -286,6 +304,9 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
) )
} }
/**
* Downloads file from backend, against `getrawdata` service, link is created and open in new tab
*/
public downloadData() { public downloadData() {
let storage = this.sasjsConfig.serverUrl let storage = this.sasjsConfig.serverUrl
let metaData = this.sasjsConfig.appLoc let metaData = this.sasjsConfig.appLoc
@ -320,6 +341,9 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
this.openDownload = false this.openDownload = false
} }
/**
* Downloads file from backend, against `getddl` service, link is created and open in new tab
*/
public downloadDDL() { public downloadDDL() {
let libref = this.lib let libref = this.lib
let ds = this.table let ds = this.table
@ -346,15 +370,27 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
this.openDownload = false this.openDownload = false
} }
/**
* When clicked on textarea in the Web Query Modal, this function will
* select all text inside.
* @param evt textarea which contains the web query text
*/
public onCliCommandFocus(evt: any): void { public onCliCommandFocus(evt: any): void {
evt.preventDefault() evt.preventDefault()
evt.target.select() evt.target.select()
} }
/**
* Navigate to the edit page of a viewing table
*/
public editTable() { public editTable() {
this.router.navigateByUrl('/editor/' + this.libTab) this.router.navigateByUrl('/editor/' + this.libTab)
} }
/**
* Used to show/hide the edit table button
* @returns Wheter currently viewed table is edtiable
*/
public tableEditExists() { public tableEditExists() {
let editTables: any = {} let editTables: any = {}
editTables = globals.editor.libsAndTables editTables = globals.editor.libsAndTables
@ -367,12 +403,18 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
return editTables[currentLibrary].includes(currentTable) return editTables[currentLibrary].includes(currentTable)
} }
/**
* Navigate to the lineage of a viewing table
*/
public goToLineage() { public goToLineage() {
let routeUri = this.tableuri!.split('\\')[1] let routeUri = this.tableuri!.split('\\')[1]
let lineageUrl = `/view/lineage/${routeUri}/REVERSE` let lineageUrl = `/view/lineage/${routeUri}/REVERSE`
this.router.navigateByUrl(lineageUrl) this.router.navigateByUrl(lineageUrl)
} }
/**
* Displays web query modal
*/
public showWebQuery() { public showWebQuery() {
this.webQuery = true this.webQuery = true
let filter_pk: number let filter_pk: number

View File

@ -13,9 +13,22 @@ import { SharedModule } from '../shared/shared.module'
import { ViewboxesModule } from '../shared/viewboxes/viewboxes.module' import { ViewboxesModule } from '../shared/viewboxes/viewboxes.module'
import { QueryModule } from '../query/query.module' import { QueryModule } from '../query/query.module'
import { DirectivesModule } from '../directives/directives.module' import { DirectivesModule } from '../directives/directives.module'
import { UserComponent } from '../user/user.component'
import { RoleComponent } from '../role/role.component'
import { GroupComponent } from '../group/group.component'
import { LineageComponent } from '../lineage/lineage.component'
import { MetadataComponent } from '../metadata/metadata.component'
@NgModule({ @NgModule({
declarations: [ViewerComponent, ViewRouteComponent], declarations: [
ViewerComponent,
ViewRouteComponent,
UserComponent,
RoleComponent,
GroupComponent,
LineageComponent,
MetadataComponent
],
imports: [ imports: [
ViewboxesModule, ViewboxesModule,
CommonModule, CommonModule,

1
client/tsconfig.doc.json Normal file
View File

@ -0,0 +1 @@
{"include":["src/**/*.ts"],"exclude":["src/**/*.spec.ts"]}

View File

@ -1,12 +0,0 @@
{
"out": "../tsdoc",
"tsconfig": "./tsconfig.app.json",
"entryPointStrategy": "expand",
"entryPoints": [
"./src"
],
"exclude": "**/*+(index|.spec|.e2e).ts",
"externalPattern": "**/node_modules/**",
"excludeExternals": true,
"excludePrivate": true
}

6023
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
{ {
"name": "dcfrontend", "name": "dcfrontend",
"version": "6.0.0", "version": "6.2.2",
"description": "Data Controller", "description": "Data Controller",
"devDependencies": { "devDependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0", "@saithodev/semantic-release-gitea": "^2.1.0",
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.1", "@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/npm": "11.0.0",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^11.0.4", "@semantic-release/release-notes-generator": "^11.0.4",
"commit-and-tag-version": "^11.2.2", "commit-and-tag-version": "^11.2.2",
@ -23,5 +24,10 @@
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.datacontroller.io/dc/dc.git" "url": "https://git.datacontroller.io/dc/dc.git"
} },
"private": true,
"//": [
"Readme",
"We must set private: true so that semantic-release/npm plugin will update the package.json version but not try to release it as NPM package"
]
} }

119
sas/package-lock.json generated
View File

@ -6,8 +6,8 @@
"": { "": {
"name": "dc-sas", "name": "dc-sas",
"dependencies": { "dependencies": {
"@sasjs/cli": "^4.4.2", "@sasjs/cli": "^4.11.1",
"@sasjs/core": "^4.46.4" "@sasjs/core": "^4.48.0"
} }
}, },
"node_modules/@coolaj86/urequest": { "node_modules/@coolaj86/urequest": {
@ -29,9 +29,9 @@
} }
}, },
"node_modules/@sasjs/adapter": { "node_modules/@sasjs/adapter": {
"version": "4.5.1", "version": "4.10.1",
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.5.1.tgz", "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.10.1.tgz",
"integrity": "sha512-WeKDMfCivBywxDZ6t0jng78ZBPoMk8RIHKFTNDDmvuvmXq5Mr5oqZ0r5lRPB863XkGOeVi6UIEI1+JawZ2TlWQ==", "integrity": "sha512-/z6eR+3nNaLPyycK8YmpF+GAWNy0zgdl8n4cv4r45hjVBulPHVop7oj57JM/0uIPVOTT2V9IwrMCT/sFPq++vw==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@sasjs/utils": "2.52.0", "@sasjs/utils": "2.52.0",
@ -78,21 +78,21 @@
} }
}, },
"node_modules/@sasjs/cli": { "node_modules/@sasjs/cli": {
"version": "4.4.2", "version": "4.11.1",
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.4.2.tgz", "resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.11.1.tgz",
"integrity": "sha512-o1Qp+L7vJOH9dbsEPJK6GaQR7yWW+W0BAI1rrD55+Ij3USMCcdWcRJAOvFxwS8Gflq5BuNrVqa39rg4RK0ZVEQ==", "integrity": "sha512-aI8V3YJGFXcY9OlNas0h8ZrajLIRPn4KmGkaOLHTDa8rZ2SOtj6W5by1RwyPB9iPIHcqW3JV3OgmtEB048zuYQ==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@sasjs/adapter": "4.5.1", "@sasjs/adapter": "4.10.1",
"@sasjs/core": "4.46.3", "@sasjs/core": "4.46.3",
"@sasjs/lint": "2.3.1", "@sasjs/lint": "2.3.1",
"@sasjs/utils": "3.3.0", "@sasjs/utils": "3.4.0",
"adm-zip": "0.5.9", "adm-zip": "0.5.10",
"chalk": "4.1.2", "chalk": "4.1.2",
"dotenv": "16.0.3", "dotenv": "16.0.3",
"esm": "3.2.25", "esm": "3.2.25",
"find": "0.3.0", "find": "0.3.0",
"js-base64": "3.7.2", "js-base64": "3.7.5",
"jsdom": "22.1.0", "jsdom": "22.1.0",
"jwt-decode": "3.1.2", "jwt-decode": "3.1.2",
"lodash.groupby": "4.6.0", "lodash.groupby": "4.6.0",
@ -116,9 +116,9 @@
"integrity": "sha512-Grwydm5GxBsYk238PZw41XPjXVVQ9vWcvfZ06L2P0bQbvK0sGn7l69JA7H5MGr3QcaLpiD4Kg70cAh7PgE+JOw==" "integrity": "sha512-Grwydm5GxBsYk238PZw41XPjXVVQ9vWcvfZ06L2P0bQbvK0sGn7l69JA7H5MGr3QcaLpiD4Kg70cAh7PgE+JOw=="
}, },
"node_modules/@sasjs/core": { "node_modules/@sasjs/core": {
"version": "4.46.4", "version": "4.48.0",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.46.4.tgz", "resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.48.0.tgz",
"integrity": "sha512-Q4UiOEYEHWCYn4ak+2BaKnrusLauyvKK/Hq4Y4RwJOfwA2MSjOzJSV8fDpbhnY1Dyubbk4SChA6yAL8lc0hn1Q==" "integrity": "sha512-KaAvfTPv1UrP0I1fREDYjkfa7FRM9+yCseGXGLYylD30oH7BBOwLc7o/BkhRjjDvrBFoiJMjAOVKULhmkHz9zQ=="
}, },
"node_modules/@sasjs/lint": { "node_modules/@sasjs/lint": {
"version": "2.3.1", "version": "2.3.1",
@ -166,9 +166,9 @@
} }
}, },
"node_modules/@sasjs/utils": { "node_modules/@sasjs/utils": {
"version": "3.3.0", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-3.4.0.tgz",
"integrity": "sha512-ZJ+c2d/rEoF340Ay3TZrXO4c2ain7AvSzkRuKG2H2qxwIlQQTk/9Rbknmy0mo3Y/QRScBYl0Fw5xSZ8SMHjljg==", "integrity": "sha512-KHkuOcbwKdD9HrgwKYrMPPuKoFzOAEyNpUjHHhyefxRlrpLwTaf08nYQXFBUhqbWuS+hPRqFLozx45x+xExgyQ==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fast-csv/format": "4.3.5", "@fast-csv/format": "4.3.5",
@ -229,12 +229,6 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/tough-cookie": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz",
"integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==",
"peer": true
},
"node_modules/abab": { "node_modules/abab": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
@ -255,9 +249,9 @@
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
}, },
"node_modules/adm-zip": { "node_modules/adm-zip": {
"version": "0.5.9", "version": "0.5.10",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz",
"integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==", "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==",
"engines": { "engines": {
"node": ">=6.0" "node": ">=6.0"
} }
@ -662,9 +656,9 @@
} }
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.15.2", "version": "1.15.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@ -945,9 +939,9 @@
} }
}, },
"node_modules/js-base64": { "node_modules/js-base64": {
"version": "3.7.2", "version": "3.7.5",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz",
"integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==" "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
}, },
"node_modules/jsdom": { "node_modules/jsdom": {
"version": "22.1.0", "version": "22.1.0",
@ -1755,9 +1749,9 @@
} }
}, },
"@sasjs/adapter": { "@sasjs/adapter": {
"version": "4.5.1", "version": "4.10.1",
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.5.1.tgz", "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.10.1.tgz",
"integrity": "sha512-WeKDMfCivBywxDZ6t0jng78ZBPoMk8RIHKFTNDDmvuvmXq5Mr5oqZ0r5lRPB863XkGOeVi6UIEI1+JawZ2TlWQ==", "integrity": "sha512-/z6eR+3nNaLPyycK8YmpF+GAWNy0zgdl8n4cv4r45hjVBulPHVop7oj57JM/0uIPVOTT2V9IwrMCT/sFPq++vw==",
"requires": { "requires": {
"@sasjs/utils": "2.52.0", "@sasjs/utils": "2.52.0",
"axios": "0.27.2", "axios": "0.27.2",
@ -1798,20 +1792,20 @@
} }
}, },
"@sasjs/cli": { "@sasjs/cli": {
"version": "4.4.2", "version": "4.11.1",
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.4.2.tgz", "resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.11.1.tgz",
"integrity": "sha512-o1Qp+L7vJOH9dbsEPJK6GaQR7yWW+W0BAI1rrD55+Ij3USMCcdWcRJAOvFxwS8Gflq5BuNrVqa39rg4RK0ZVEQ==", "integrity": "sha512-aI8V3YJGFXcY9OlNas0h8ZrajLIRPn4KmGkaOLHTDa8rZ2SOtj6W5by1RwyPB9iPIHcqW3JV3OgmtEB048zuYQ==",
"requires": { "requires": {
"@sasjs/adapter": "4.5.1", "@sasjs/adapter": "4.10.1",
"@sasjs/core": "4.46.3", "@sasjs/core": "4.46.3",
"@sasjs/lint": "2.3.1", "@sasjs/lint": "2.3.1",
"@sasjs/utils": "3.3.0", "@sasjs/utils": "3.4.0",
"adm-zip": "0.5.9", "adm-zip": "0.5.10",
"chalk": "4.1.2", "chalk": "4.1.2",
"dotenv": "16.0.3", "dotenv": "16.0.3",
"esm": "3.2.25", "esm": "3.2.25",
"find": "0.3.0", "find": "0.3.0",
"js-base64": "3.7.2", "js-base64": "3.7.5",
"jsdom": "22.1.0", "jsdom": "22.1.0",
"jwt-decode": "3.1.2", "jwt-decode": "3.1.2",
"lodash.groupby": "4.6.0", "lodash.groupby": "4.6.0",
@ -1834,9 +1828,9 @@
} }
}, },
"@sasjs/core": { "@sasjs/core": {
"version": "4.46.4", "version": "4.48.0",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.46.4.tgz", "resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.48.0.tgz",
"integrity": "sha512-Q4UiOEYEHWCYn4ak+2BaKnrusLauyvKK/Hq4Y4RwJOfwA2MSjOzJSV8fDpbhnY1Dyubbk4SChA6yAL8lc0hn1Q==" "integrity": "sha512-KaAvfTPv1UrP0I1fREDYjkfa7FRM9+yCseGXGLYylD30oH7BBOwLc7o/BkhRjjDvrBFoiJMjAOVKULhmkHz9zQ=="
}, },
"@sasjs/lint": { "@sasjs/lint": {
"version": "2.3.1", "version": "2.3.1",
@ -1878,9 +1872,9 @@
} }
}, },
"@sasjs/utils": { "@sasjs/utils": {
"version": "3.3.0", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-3.4.0.tgz",
"integrity": "sha512-ZJ+c2d/rEoF340Ay3TZrXO4c2ain7AvSzkRuKG2H2qxwIlQQTk/9Rbknmy0mo3Y/QRScBYl0Fw5xSZ8SMHjljg==", "integrity": "sha512-KHkuOcbwKdD9HrgwKYrMPPuKoFzOAEyNpUjHHhyefxRlrpLwTaf08nYQXFBUhqbWuS+hPRqFLozx45x+xExgyQ==",
"requires": { "requires": {
"@fast-csv/format": "4.3.5", "@fast-csv/format": "4.3.5",
"@types/fs-extra": "9.0.13", "@types/fs-extra": "9.0.13",
@ -1933,12 +1927,6 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/tough-cookie": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz",
"integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==",
"peer": true
},
"abab": { "abab": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
@ -1961,9 +1949,9 @@
} }
}, },
"adm-zip": { "adm-zip": {
"version": "0.5.9", "version": "0.5.10",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz",
"integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==" "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ=="
}, },
"agent-base": { "agent-base": {
"version": "6.0.2", "version": "6.0.2",
@ -2243,9 +2231,9 @@
} }
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.15.2", "version": "1.15.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q=="
}, },
"form-data": { "form-data": {
"version": "4.0.0", "version": "4.0.0",
@ -2429,9 +2417,9 @@
} }
}, },
"js-base64": { "js-base64": {
"version": "3.7.2", "version": "3.7.5",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz",
"integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==" "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
}, },
"jsdom": { "jsdom": {
"version": "22.1.0", "version": "22.1.0",
@ -2965,8 +2953,7 @@
"ws": { "ws": {
"version": "8.13.0", "version": "8.13.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
"integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA=="
"requires": {}
}, },
"xml": { "xml": {
"version": "1.0.1", "version": "1.0.1",

View File

@ -27,7 +27,7 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@sasjs/cli": "^4.4.2", "@sasjs/cli": "^4.11.1",
"@sasjs/core": "^4.46.4" "@sasjs/core": "^4.48.0"
} }
} }

View File

@ -1,21 +1,33 @@
/** /**
@file @file
@brief Checks the level of access a user has to the MP Editor @brief Checks group access level for a table or library
@details In order for a user to be able to EDIT or APPROVE a table they must @details In order for a user to be able to EDIT or APPROVE a table they must
be in a metadata group that has been granted access to that table in the be in a group that has been granted access to that table in the
&mpelib..mpe_security table. Alternatively, they may be in the MPE_SECURITY table. Alternatively, they may be in the &mpeadmins
&mpeadmins group (has overall access). group (which has full access to everything).
@param [in] base_table The base table to check for
@param [in] user= The user for which the access level should be returned. If
not provided, the mf_user() result is used instead.
@param [in] access_level= (APPROVE) access_level (per MPE_SECURITY) reqd.
Valid values:
@li EDIT
@li APPROVE
@li VIEW
@param [in] cntl_lib_var= (MPELIB) The name of a global macro variable that
contains the libref in which the MPE_SECURITY table is stored
@param [out] outds= (MED_ACCESSCHECK) Output WORK table containing all the
groups for which the user is granted the particular ACCESS_LEVEL.
<h4> SAS Macros </h4> <h4> SAS Macros </h4>
@li mp_abort.sas @li mp_abort.sas
@li mf_getuniquename.sas
@li mf_getuser.sas
@li mf_verifymacvars.sas @li mf_verifymacvars.sas
@li mpe_getgroups.sas @li mpe_getgroups.sas
@li mp_dropmembers.sas
@param [in] access_level= access_level (per &mpelib..mp_editor_security) reqd <h4> Related Macros </h4>
@li mpe_accesscheck.test.sas
@returns outds A table containing all the groups that user is a member of,
which are granted the access_level requested.
@version 9.2 @version 9.2
@author 4GL Apps Ltd @author 4GL Apps Ltd
@ -25,65 +37,64 @@
**/ **/
%macro mpe_accesscheck( %macro mpe_accesscheck(
base_table /* base table to check for */ base_table
,outds=med_accesscheck /* WORK table to contain access details */ ,outds=med_accesscheck /* WORK table to contain access details */
,user= /* metadata user to check for */ ,user= /* metadata user to check for */
,access_level=APPROVE ,access_level=APPROVE
,cntl_lib_var=MPELIB
); );
%if &user= %then %let user=%mf_getuser(); %if &user= %then %let user=%mf_getuser();
%if %index(&outds,.) %then %do; %mp_abort(
%local lib ds; iftrue=(%index(&outds,.)>0 and %upcase(%scan(&outds,1,.)) ne WORK)
%let lib=%scan(&outds,1,.); ,mac=mpe_accesscheck
%let ds=%scan(&outds,2,.); ,msg=%str(outds should be a WORK table)
%if %upcase(&lib) ne WORK %then %do; )
%mp_abort(msg=outds should be a WORK table
,mac=mpe_accesscheck);
%end;
%end;
%else %let ds=&outds;
%mp_abort( %mp_abort(
iftrue=(%mf_verifymacvars(base_table user access_level)=0) iftrue=(%mf_verifymacvars(base_table user access_level)=0)
,mac=bitemporal_dataloader ,mac=mpe_accesscheck
,msg=%str(Missing base_table/user access_level) ,msg=%str(Missing base_table/user access_level variables)
) )
/* ensure any existing table is dropped */ /* make unique temp table vars */
%mp_dropmembers(&ds) %local tempds1 tempds2;
%let tempds1=%mf_getuniquename(prefix=usergroups);
%let tempds2=%mf_getuniquename(prefix=tablegroups);
/* create a new table for temp use */ /* get list of user groups */
data; run; %mpe_getgroups(user=&user,outds=&tempds1)
%local tempds; %let tempds=&syslast;
/* overwrite with the list of groups */
%mpe_getgroups(user=&user,outds=&tempds);
/* get list of groups with access for that table */
proc sql;
create table &tempds2 as
select distinct sas_group
from &&&cntl_lib_var...mpe_security
where &dc_dttmtfmt. lt tx_to
and access_level="&access_level"
and (
(libref="%scan(&base_table,1,.)" and upcase(dsn)="%scan(&base_table,2,.)")
or (libref="%scan(&base_table,1,.)" and dsn="*ALL*")
or (libref="*ALL*")
);
%if &_debug ge 131 %then %do; %if &_debug ge 131 %then %do;
data _null_; data _null_;
set &tempds; set &tempds1;
putlog (_all_)(=);
run;
data _null_;
set &tempds2;
putlog (_all_)(=); putlog (_all_)(=);
run; run;
%end; %end;
proc sql; proc sql;
create table &outds as create table &outds as
select * from &tempds select * from &tempds1
where groupname="&mpeadmins" where groupname="&mpeadmins"
or groupname in or groupname in (select * from &tempds2);
(select sas_group from &mpelib..mpe_security
where &dc_dttmtfmt. lt tx_to
and access_level="&access_level"
& (
(libref="%scan(&base_table,1,.)" and dsn="%scan(&base_table,2,.)")
or (libref="%scan(&base_table,1,.)" and dsn="*ALL*")
or (libref="*ALL*")
)
);
%put base_table=&base_table; %put &sysmacroname: base_table=&base_table;
%put libref=%scan(&base_table,1,.); %put &sysmacroname: access_level=&access_level;
%put dsn=%scan(&base_table,2,.);
%put access_level=&access_level;
%mend mpe_accesscheck; %mend mpe_accesscheck;

View File

@ -0,0 +1,68 @@
/**
@file
@brief Testing mpe_accesscheck macro
@details Checking functionality of mpe_accesscheck.sas macro
<h4> SAS Macros </h4>
@li mf_getuniquename.sas
@li mf_getuser.sas
@li mp_assertdsobs.sas
@li mpe_getgroups.sas
@li mpe_accesscheck.sas
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
/* get the groups this user is actually a member of */
%mpe_getgroups(user=%mf_getuser(),outds=work.groups)
data _null_;
set work.groups;
call symputx('groupname',groupname);
run;
/* create demo MPE_SECURITY table */
data work.mpe_security;
if 0 then set &dc_libref..mpe_security;
do access_level='EDIT','APPROVE','VIEW','SIGNOFF','AUDIT';
LIBREF='SOMELIB';
DSN='SOMEDS';
sas_group="&groupname";
tx_from=0;
tx_to='31dec4999:23:59:59'dt;
output;
end;
run;
%let WRK=WORK;
%mpe_accesscheck(
SOMELIB.SOMEDS
,outds=work.test1
,access_level=APPROVE
,cntl_lib_var=WRK
)
%mp_assertdsobs(work.test1,
desc=Test 1 - One record returned,
test=EQUALS 1,
outds=work.test_results
)
%mpe_accesscheck(
SOMELIB.INVALID
,outds=work.test2
,access_level=APPROVE
,cntl_lib_var=WRK
)
%mp_assertdsobs(work.test2,
desc=Test 12 - 0 records returned,
test=EQUALS 0,
outds=work.test_results
)

View File

@ -131,7 +131,7 @@ filename __out email ("&emails")
txt=symget('SUBMITTED_TXT'); txt=symget('SUBMITTED_TXT');
put "Reason provided: " txt; put "Reason provided: " txt;
put " "; put " ";
put "This is an automated email by Data Controller for SAS®. For " put "This is an automated email by Data Controller for SAS. For "
"documentation, please visit https://docs.datacontroller.io"; "documentation, please visit https://docs.datacontroller.io";
run; run;
%end; %end;
@ -144,7 +144,7 @@ filename __out email ("&emails")
put "Please be advised that a change to table &alert_lib..&alert_ds has " put "Please be advised that a change to table &alert_lib..&alert_ds has "
"been approved by &from_user on the '&syshostname' SAS server."; "been approved by &from_user on the '&syshostname' SAS server.";
put " "; put " ";
put "This is an automated email by Data Controller for SAS®. For " put "This is an automated email by Data Controller for SAS. For "
"documentation, please visit https://docs.datacontroller.io"; "documentation, please visit https://docs.datacontroller.io";
run; run;
%end; %end;
@ -165,7 +165,7 @@ filename __out email ("&emails")
txt=symget('REVIEW_REASON_TXT'); txt=symget('REVIEW_REASON_TXT');
put "Reason provided: " txt; put "Reason provided: " txt;
put " "; put " ";
put "This is an automated email by Data Controller for SAS®. For " put "This is an automated email by Data Controller for SAS. For "
"documentation, please visit https://docs.datacontroller.io"; "documentation, please visit https://docs.datacontroller.io";
run; run;
%end; %end;

View File

@ -1014,7 +1014,8 @@ insert into &lib..mpe_selectbox set
,buskey='LIBREF DSN ACCESS_LEVEL SAS_GROUP' ,buskey='LIBREF DSN ACCESS_LEVEL SAS_GROUP'
,var_txfrom='TX_FROM' ,var_txfrom='TX_FROM'
,var_txto='TX_TO' ,var_txto='TX_TO'
,notes='Shows which metadata groups can edit which tables' ,notes='Determines which groups can view/edit/approve which tables'
,post_edit_hook='services/hooks/mpe_security_postedit'
; ;
insert into &lib..mpe_tables insert into &lib..mpe_tables
set tx_from=0 set tx_from=0
@ -1351,6 +1352,15 @@ insert into &lib..MPE_VALIDATIONS set
,rule_value='UPCASE' ,rule_value='UPCASE'
,rule_active=1 ,rule_active=1
,tx_to='31DEC5999:23:59:59'dt; ,tx_to='31DEC5999:23:59:59'dt;
insert into &lib..MPE_VALIDATIONS set
tx_from=0
,base_lib="&lib"
,base_ds="MPE_SECURITY"
,base_col="LIBREF"
,rule_type='CASE'
,rule_value="UPCASE"
,rule_active=1
,tx_to='31DEC5999:23:59:59'dt;
insert into &lib..MPE_VALIDATIONS set insert into &lib..MPE_VALIDATIONS set
tx_from=0 tx_from=0
,base_lib="&lib" ,base_lib="&lib"
@ -1369,6 +1379,15 @@ insert into &lib..MPE_VALIDATIONS set
,rule_value="&lib..MPE_TABLES.LIBREF" ,rule_value="&lib..MPE_TABLES.LIBREF"
,rule_active=1 ,rule_active=1
,tx_to='31DEC5999:23:59:59'dt; ,tx_to='31DEC5999:23:59:59'dt;
insert into &lib..MPE_VALIDATIONS set
tx_from=0
,base_lib="&lib"
,base_ds="MPE_SECURITY"
,base_col="DSN"
,rule_type='CASE'
,rule_value="UPCASE"
,rule_active=1
,tx_to='31DEC5999:23:59:59'dt;
insert into &lib..MPE_VALIDATIONS set insert into &lib..MPE_VALIDATIONS set
tx_from=0 tx_from=0
,base_lib="&lib" ,base_lib="&lib"
@ -1733,12 +1752,12 @@ proc format library=&lib..mpe_x_catalog;
6 = "Agree" 6 = "Agree"
7 = "Strongly Agree" 7 = "Strongly Agree"
; ;
VALUE LIKERT7_A VALUE LIKERT7_ELEVEN
1,2,3 = "Disagree" 1,2,3 = "Disagree"
4 = "Neither Agree nor Disagree" 4 = "Neither Agree nor Disagree"
5,6,7 = "Agree" 5,6,7 = "Agree"
; ;
VALUE LIKERT7_B VALUE LIKERT7_SISTERS
1-3 = "Disagree" 1-3 = "Disagree"
4 = "Neither Agree nor Disagree" 4 = "Neither Agree nor Disagree"
5-7 = "Agree" 5-7 = "Agree"

View File

@ -142,10 +142,14 @@ run;
%mp_lockanytable(UNLOCK,lib=&lib,ds=&ds,ctl_ds=&dclib..mpe_lockanytable) %mp_lockanytable(UNLOCK,lib=&lib,ds=&ds,ctl_ds=&dclib..mpe_lockanytable)
%end; %end;
%else %do; %else %do;
/* is full replace so treat everything as a mod in diff screen */ /* is full replace so treat all staged records as new in diff screen */
data work.outds_mod work.outds_add work.outds_del; data work.outds_mod work.outds_add ;
set work.&staging_ds; set work.&staging_ds;
output work.outds_mod; /* _add and _del will be empty */ output work.outds_add;
run;
/* previous table will be considered fully deleted */
data work.outds_del;
set &lib..&ds;
run; run;
%end; %end;
%end; %end;

View File

@ -283,7 +283,7 @@
"rejectUnauthorized": false, "rejectUnauthorized": false,
"allowInsecureRequests": true "allowInsecureRequests": true
}, },
"appLoc": "/Public/app/mihajlo", "appLoc": "/Public/app/dc2",
"deployConfig": { "deployConfig": {
"deployServicePack": true, "deployServicePack": true,
"deployScripts": [] "deployScripts": []

View File

@ -186,20 +186,15 @@ options notes mprint;
libname approve "&dir"; libname approve "&dir";
/* take copy of webin file */ /* take copy of webin file */
data _null_; data _null_;
if symexist('_WEBIN_FILEREF1') if symexist('_WEBIN_FILEREF1') then ref=symget('_WEBIN_FILEREF1');
then ref=symget('_WEBIN_FILEREF1'); else if symexist('sasjs_tables') then ref='0ref'; /* no fileref created */
else if symexist('sasjs_tables') then do;
rc=filename('ref',"%sysfunc(pathname(work))/&dsn.csv");
ref='ref';
end;
else ref='indata1'; else ref='indata1';
call symputx('ref',ref); call symputx('ref',ref);
putlog ref=; putlog ref=;
run; run;
%mp_binarycopy(inref=&ref, outloc="&dir/_WEBIN_FILEREF1.txt") %mp_binarycopy(inref=&ref,outloc="&dir/_WEBIN_FILEREF1.txt",iftrue=&ref ne 0ref)
/* take copy of macvars */ /* take copy of macvars */

View File

@ -0,0 +1,34 @@
/**
@file
@brief Post Edit Hook script for the MPE_SECURITY table
@details Post edit hooks provide additional backend validation against
user-sourced data. The incoming dataset is always `work.staging_ds` and this
file is included from the mpe_loader.sas macro.
Available (at runtime) macro variables:
@li DC_LIBREF - The DC control library for your site
@li LIBREF - The library of the dataset being edited (is assigned)
@li DS - The dataset being edited
**/
/* ensure upcase and check access level values*/
%let errval=0;
%let errmsg=;
data work.staging_ds;
set work.staging_ds;
LIBREF=upcase(LIBREF);
DSN=upcase(DSN);
ACCESS_LEVEL=upcase(ACCESS_LEVEL);
if ACCESS_LEVEL not in ('EDIT','APPROVE','VIEW','SIGNOFF','AUDIT') then do;
putlog "ERR" +(-1) "OR: invalid ACCESS_LEVEL - " access_level;
call symputx('errval',1);
call symputx('errmsg',"Invalid ACCESS_LEVEL: "!!access_level);
end;
run;
%mp_abort(iftrue=(&errval=1)
,mac=mpe_security_postedit.sas
,msg=%str(&errmsg)
)