Merge branch 'development' into tsdoc
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s

This commit is contained in:
dcbot 2023-08-24 09:43:45 +00:00
commit 5bcdef77b8
10 changed files with 419 additions and 349 deletions

719
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -71,7 +71,6 @@
"ngx-clipboard": "^16.0.0",
"ngx-json-viewer": "file:libraries/ngx-json-viewer-3.2.1.tgz",
"nodejs": "0.0.0",
"numbro": "^2.1.1",
"os-browserify": "0.3.0",
"rxjs": "^7.8.0",
"save-svg-as-png": "^1.4.17",

View File

@ -1,5 +1,5 @@
declare module 'save-svg-as-png'
declare module 'numbro/dist/languages.min'
declare interface Navigator {
msSaveBlob: (blob: any, defaultName?: string) => boolean
}

View File

@ -385,7 +385,6 @@
[class.hidden]="hotTable.hidden"
[licenseKey]="hotTable.licenseKey"
>
<!--[licenseKey]=""-->
</hot-table>
</div>

View File

@ -71,6 +71,8 @@ import {
} from './utils/renderers.utils'
import { isStringDecimal, isStringNumber } from './utils/types.utils'
import { LicenceService } from '../services/licence.service'
import * as numbro from 'numbro'
import * as languages from 'numbro/dist/languages.min'
@Component({
selector: 'app-editor',
@ -370,6 +372,10 @@ export class EditorComponent implements OnInit, AfterViewInit {
private cdf: ChangeDetectorRef,
private hotRegisterer: HotTableRegisterer
) {
const lang = languages[window.navigator.language]
if (lang)
numbro.default.registerLanguage(languages[window.navigator.language])
this.hotRegisterer = new HotTableRegisterer()
this.parseRestrictions()

View File

@ -19,6 +19,7 @@ import { mergeColsRules } from './utils/mergeColsRules'
import { parseColType } from './utils/parseColType'
import { dqValidate } from './validations/dq-validation'
import { specialMissingNumericValidator } from './validations/hot-custom-validators'
import { applyNumericFormats } from './utils/applyNumericFormats'
export class DcValidator {
private rules: DcValidation[] = []
@ -41,6 +42,7 @@ export class DcValidator {
this.hotInstance = hotInstance
this.rules = parseColType(sasparams.COLTYPE)
this.rules = mergeColsRules(cols, this.rules, $dataFormats)
this.rules = applyNumericFormats(this.rules)
this.dqrules = dqRules
this.dqdata = dqData
this.primaryKeys = sasparams.PK.split(' ')

View File

@ -0,0 +1,26 @@
import { DcValidation } from '../models/dc-validation.model'
import * as languages from 'numbro/dist/languages.min'
/**
* Applying the numeric formats based on the browser locale/language
* So that correct decimal separators are applied.
* For example european format (thousand dot, decimal comma): 1.000,00
*
* @param rules Cell Validation rules to be updated
* Those rules are passed in the `columns` property Of handsontable settings.
*/
export const applyNumericFormats = (rules: DcValidation[]): DcValidation[] => {
const lang = languages[window.navigator.language]
if (!lang) return rules
for (let rule of rules) {
if (rule.type === 'numeric')
rule.numericFormat = {
pattern: '0,0',
culture: window.navigator.language // use this for EUR (German),
// more cultures available on http://numbrojs.com/languages.html
}
}
return rules
}

View File

@ -6,7 +6,8 @@ import { DcValidation } from '../models/dc-validation.model'
* Merging old validation params from sasparams with cols params
* @param sasparams sasparams coming from SAS
* @param cols cols coming from SAS
* @param rules rules to be updated
* @param rules Cell Validation rules to be updated
* Those rules are passed in the `columns` property Of handsontable settings.
* @returns
*/
export const mergeColsRules = (

View File

@ -141,6 +141,13 @@ run;
%mp_lockanytable(UNLOCK,lib=&lib,ds=&ds,ctl_ds=&dclib..mpe_lockanytable)
%end;
%else %do;
/* is full replace so treat everything as a mod in diff screen */
data work.outds_mod work.outds_add work.outds_del;
set work.&staging_ds;
output work.outds_mod; /* _add and _del will be empty */
run;
%end;
%end;
%else %if &loadtype=UPDATE %then %do;
%bitemporal_dataloader(bus_from=,bus_to=

View File

@ -597,6 +597,7 @@ run;
%if &LOADTYPE=REPLACE %then %do;
data work.outds_add; run;
data work.outds_mod; run;
data work.outds_del; run;
%end;
libname approve "&mpelocapprovals/&TABLE";
data; set &libds;stop;run;