chore(git): Merge branch 'restore' of ssh://git.datacontroller.io:29419/dc/dc into restore
Build / Build-and-ng-test (pull_request) Failing after 15s Details

This commit is contained in:
Mihajlo Medjedovic 2024-04-30 15:26:07 +02:00
commit 1589c799ec
5 changed files with 28 additions and 30 deletions

14
sas/package-lock.json generated
View File

@ -7,7 +7,7 @@
"name": "dc-sas",
"dependencies": {
"@sasjs/cli": "^4.11.1",
"@sasjs/core": "^4.51.3"
"@sasjs/core": "^4.51.5"
}
},
"node_modules/@coolaj86/urequest": {
@ -116,9 +116,9 @@
"integrity": "sha512-Grwydm5GxBsYk238PZw41XPjXVVQ9vWcvfZ06L2P0bQbvK0sGn7l69JA7H5MGr3QcaLpiD4Kg70cAh7PgE+JOw=="
},
"node_modules/@sasjs/core": {
"version": "4.51.3",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.51.3.tgz",
"integrity": "sha512-ATc6+Mk0oEN14Ih9jZYJAuNhU4wcXqDgD3oKGnCvW/jVVcMNRNuQlh6O2bBR9H31DnCW7W94MxhtPHud786+tg=="
"version": "4.51.5",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.51.5.tgz",
"integrity": "sha512-MrhHFOM8I7UUsuCvab4ko2bi9wBf7saLZiyo3Hz5CTKdMAK4RtYyyskFbREC/AX32DqziXm5TM9OiBLoY3eDKw=="
},
"node_modules/@sasjs/lint": {
"version": "2.3.1",
@ -1834,9 +1834,9 @@
}
},
"@sasjs/core": {
"version": "4.51.3",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.51.3.tgz",
"integrity": "sha512-ATc6+Mk0oEN14Ih9jZYJAuNhU4wcXqDgD3oKGnCvW/jVVcMNRNuQlh6O2bBR9H31DnCW7W94MxhtPHud786+tg=="
"version": "4.51.5",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.51.5.tgz",
"integrity": "sha512-MrhHFOM8I7UUsuCvab4ko2bi9wBf7saLZiyo3Hz5CTKdMAK4RtYyyskFbREC/AX32DqziXm5TM9OiBLoY3eDKw=="
},
"@sasjs/lint": {
"version": "2.3.1",

View File

@ -29,6 +29,6 @@
"private": true,
"dependencies": {
"@sasjs/cli": "^4.11.1",
"@sasjs/core": "^4.51.3"
"@sasjs/core": "^4.51.5"
}
}

View File

@ -39,6 +39,18 @@
%let &outresult=NO;
%let &outreason=NOTFOUND;
/* check if there is actually a version to restore */
%local chk;
%let chk=0;
proc sql noprint;
select count(*) into: chk from &dc_libref..mpe_audit
where load_ref="&load_ref";
%if &chk=0 %then %do;
%let allow_restore=NO;
%let reason=No entry for &load_ref in MPE_AUDIT;
%return;
%end;
/* grab user groups */
%local user;
%let user=%mf_getuser();
@ -117,20 +129,7 @@
%return;
%end;
%else %do;
/* check if there is actually a version to restore */
%local chk;
%let chk=0;
proc sql noprint;
select count(*) into: chk from &dc_libref..mpe_audit
where load_ref="&table";
%if &chk=0 %then %do;
%let allow_restore=NO;
%let reason=No entry for &table in MPE_AUDIT;
%end;
%else %do;
%let allow_restore=YES;
%let reason=CHECKS PASSED;
%end;
%return;
%let allow_restore=YES;
%let reason=CHECKS PASSED;
%end;
%mend mpe_checkrestore;

View File

@ -38,12 +38,11 @@ data work.jsdata;
_____DELETE__THIS__RECORD_____='Yes';
output;
_____DELETE__THIS__RECORD_____='No';
do i=&maxpk to 5;
/* modify 1 record and add 4 more */
primary_key_field=i;
some_char=' leadingblanks';
some_char=' leadingblanks';
some_bestnum=._;
/* modify 1 record and add 4 more */
do primary_key_field=&maxpk to (&maxpk+5);
some_num=ranuni(0);
some_bestnum=._;
output;
end;
end;

View File

@ -92,6 +92,6 @@ run;
desc=Checking data was returned
)
%mp_assert(
iftrue=(&ALLOW_RESTORE=YES),
desc=Checking admin user can restore
iftrue=(&ALLOW_RESTORE=NO),
desc=Checking admin user cannot restore - as table was not approved
)