Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Angular 10.2 #29

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
12 changes: 9 additions & 3 deletions yangcatalog-ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": [
"ngx-lightbox",
"ag-grid-angular",
"lodash",
"@fortawesome/free-solid-svg-icons",
"@fortawesome/free-regular-svg-icons"
],
"aot": true,
"outputPath": "dist/yangcatalog-ui",
"index": "src/index.html",
Expand All @@ -51,8 +58,7 @@
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/ngx-lightbox/lightbox.css"
],
"scripts": [],
"es5BrowserSupport": true
"scripts": []
},
"configurations": {
"production": {
Expand Down Expand Up @@ -167,4 +173,4 @@
"cli": {
"analytics": false
}
}
}
7,716 changes: 3,665 additions & 4,051 deletions yangcatalog-ui/package-lock.json

Large diffs are not rendered by default.

52 changes: 25 additions & 27 deletions yangcatalog-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~9.1.13",
"@angular/common": "~9.1.13",
"@angular/compiler": "~9.1.13",
"@angular/core": "~9.1.13",
"@angular/forms": "~9.1.13",
"@angular/localize": "9.1.13",
"@angular/platform-browser": "~9.1.13",
"@angular/platform-browser-dynamic": "~9.1.13",
"@angular/router": "~9.1.13",
"@fortawesome/angular-fontawesome": "0.6.1",
"@angular/animations": "~10.2.5",
"@angular/common": "~10.2.5",
"@angular/compiler": "~10.2.5",
"@angular/core": "~10.2.5",
"@angular/forms": "~10.2.5",
"@angular/localize": "10.2.5",
"@angular/platform-browser": "~10.2.5",
"@angular/platform-browser-dynamic": "~10.2.5",
"@angular/router": "~10.2.5",
"@fortawesome/angular-fontawesome": "~0.7.0",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-regular-svg-icons": "5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
Expand All @@ -30,40 +30,38 @@
"@pt/pt-topology": "file:./tmp/pt-topology-0.1.0.tgz",
"bootstrap": "5.0.0-beta2",
"bootstrap-icons": "1.4.0",
"core-js": "^2.5.4",
"ng-bootstrap-form-validation": "9.0.1",
"ngx-captcha": "^8.0.1",
"rxjs": "~6.6.6",
"tslib": "^1.10.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.15",
"@angular/cdk": "11.2.9",
"@angular/cli": "~9.1.15",
"@angular/compiler-cli": "~9.1.13",
"@angular/language-service": "~9.1.13",
"@angular-devkit/build-angular": "~0.1002.4",
"@angular/cdk": "~10.2.7",
"@angular/cli": "~10.2.4",
"@angular/compiler-cli": "~10.2.5",
"@swimlane/ngx-charts": "17.0.1",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"ag-grid-angular": "22.1.0",
"ag-grid-community": "22.1.0",
"codelyzer": "^5.1.2",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ngx-chips": "2.2.2",
"ngx-clipboard": "13.0.1",
"ngx-lightbox": "2.3.0",
"protractor": "~5.4.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.8.3",
"tslint": "~6.1.0",
"typescript": "~4.0.8",
"vis": "git+https://github.com/PANTHEONtech/vis#develop"
}
}
17 changes: 7 additions & 10 deletions yangcatalog-ui/src/app/core/advanced-format.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,20 @@ export class AdvancedFormatPipe implements PipeTransform {
}

linkify(inputText: string) {
let replacedText, replacePattern1, replacePattern2, replacePattern3;

// URLs starting with http://, https://, or ftp://
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');
const protocolPattern = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
let replacedText = inputText.replace(protocolPattern, '<a href="$1" target="_blank">$1</a>');

// URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
const wwwPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
replacedText = replacedText.replace(wwwPattern, '$1<a href="http://$2" target="_blank">$2</a>');

// Change email addresses to mailto:: links.
let emailPattern = /mailto:(([a-zA-Z0-9\-\_\.]+)@([a-zA-Z\_\-]+)\.([a-zA-Z]{2,6}))/gim;
if (replacedText.indexOf('mailto:') === -1) {
replacePattern3 = /(([a-zA-Z0-9\-\_\.]+)@([a-zA-Z\_\-]+)\.([a-zA-Z]{2,6}))/gim;
} else {
replacePattern3 = /mailto:(([a-zA-Z0-9\-\_\.]+)@([a-zA-Z\_\-]+)\.([a-zA-Z]{2,6}))/gim;
emailPattern = /(([a-zA-Z0-9\-\_\.]+)@([a-zA-Z\_\-]+)\.([a-zA-Z]{2,6}))/gim;
}
replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');
replacedText = replacedText.replace(emailPattern, '<a href="mailto:$1">$1</a>');
return replacedText;
}

Expand Down
8 changes: 4 additions & 4 deletions yangcatalog-ui/src/app/core/yc-validations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class YcValidationsService {

getNumberValidation(): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } => {
return (control.value && (!Number(control.value) && control.value !== '0')) ? { 'notNumber': { value: control.value } } : null;
return (control.value && (!Number(control.value) && control.value !== '0')) ? { notNumber: { value: control.value } } : null;
};
}

Expand All @@ -19,14 +19,14 @@ export class YcValidationsService {
if (!control.parent) {
return null;
}
var isRegexSearch = control.parent.get('searchOptions').get('regularExpression').value;
var isValid = true;
const isRegexSearch = control.parent.get('searchOptions').get('regularExpression').value;
let isValid = true;
try {
new RegExp(control.value);
} catch (e) {
isValid = false;
}
return (isRegexSearch && !isValid) ? { 'notValidRegex': { value: control.value } } : null;
return (isRegexSearch && !isValid) ? { notValidRegex: { value: control.value } } : null;
};
}

Expand Down
8 changes: 4 additions & 4 deletions yangcatalog-ui/src/app/features/account/account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export class AccountComponent implements OnInit, OnDestroy {
result: any;
siteKey: string;
fieldValidators = [Validators.required, Validators.maxLength(255), this.noWhitespaceValidator];
emailValidator = this.fieldValidators.concat(Validators.email)
minLengthValidator = this.fieldValidators.concat(Validators.minLength(25))
emailValidator = this.fieldValidators.concat(Validators.email);
minLengthValidator = this.fieldValidators.concat(Validators.minLength(25));


customPatternErrorMessages: ErrorMessage[] = [
Expand Down Expand Up @@ -88,7 +88,7 @@ export class AccountComponent implements OnInit, OnDestroy {
console.log(err);
this.error = err;
if (err.status === 409) {
this.form.controls['username'].setErrors({ 'existingUsername': true });
this.form.controls['username'].setErrors({ existingUsername: true });
}
}
);
Expand All @@ -97,6 +97,6 @@ export class AccountComponent implements OnInit, OnDestroy {
private noWhitespaceValidator(control: FormControl) {
const isWhitespace = (control.value || '').trim().length === 0;
const isValid = !isWhitespace;
return isValid ? null : { 'required': true };
return isValid ? null : { required: true };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ImpactNodesListComponent implements OnInit {
cellStyle: { 'white-space': 'normal' },
};

constructor(private modal: NgbActiveModal,) { }
constructor(private modal: NgbActiveModal) { }

ngOnInit(): void {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ImpactWarningsComponent implements OnInit {
{ colId: 'warning', field: 'warning', headerName: 'Warnings' },
];

constructor(private modal: NgbActiveModal,) { }
constructor(private modal: NgbActiveModal) { }

ngOnInit(): void {
this.warningsObjs = this.warnings.map(w => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit
takeUntil(this.componentDestroyed)
).subscribe(impactResult => {
this.warnings.push(...impactResult.warnings);
if (!impactResult.name) return;
if (!impactResult.name) { return; }
this.mainResults.push(impactResult);
this.mainResultsNames.push(impactResult.name);
this.addOrganizations(impactResult.getOrganisations());
Expand Down Expand Up @@ -439,7 +439,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit
this.onClusterMaturityToggle(false);
}
this.organizations.forEach((organization: string) => {
let organizationNodes: ImpactAnalysisModel[] = [];
const organizationNodes: ImpactAnalysisModel[] = [];

this.mainResults.forEach((res: ImpactAnalysisModel) => {
const orgMembers = res.getOrganizationMembers(organization);
Expand All @@ -448,7 +448,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit
organizationNodes.push(...uniqueOrgMembers);
});

let membersCount = organizationNodes.length;
const membersCount = organizationNodes.length;
const clusterOptionsByData = {
joinCondition: (childOptions) => {
return childOptions['organization'] === organization && this.mainResults.findIndex(res => res.name === childOptions['label']) === -1;
Expand Down Expand Up @@ -494,7 +494,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit

} else {
this.organizations.forEach((organization: string) => {
let organizationNodes: ImpactAnalysisModel[] = [];
const organizationNodes: ImpactAnalysisModel[] = [];

this.mainResults.forEach((res: ImpactAnalysisModel) => {
const orgMembers = res.getOrganizationMembers(organization);
Expand All @@ -517,15 +517,15 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit
this.onClusterOrganizationsToggle(false);
}
this.maturities.forEach((maturity: string) => {
let maturityNodes: ImpactAnalysisModel[] = [];
const maturityNodes: ImpactAnalysisModel[] = [];

this.mainResults.forEach((res: ImpactAnalysisModel) => {
const matMembers = res.getMaturityMembers(maturity);
const matMembersNoMains = matMembers.filter(matMember => this.mainResults.findIndex(mainRes => mainRes.name === matMember.name) === -1);
const uniqueMatMembers = matMembersNoMains.filter(mat => maturityNodes.findIndex(node => node.name === mat.name) === -1);
maturityNodes.push(...uniqueMatMembers);
});
let membersCount = maturityNodes.length;
const membersCount = maturityNodes.length;
const clusterOptionsByData = {
joinCondition: (childOptions) => {
return childOptions['maturity'] === maturity && this.mainResults.findIndex(res => res.name === childOptions['label']) === -1;
Expand Down Expand Up @@ -571,7 +571,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit

} else {
this.maturities.forEach((maturity: string) => {
let maturityNodes: ImpactAnalysisModel[] = [];
const maturityNodes: ImpactAnalysisModel[] = [];

this.mainResults.forEach((res: ImpactAnalysisModel) => {
const matMembers = res.getMaturityMembers(maturity);
Expand Down Expand Up @@ -673,7 +673,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit
}).componentInstance;

if (selectedClusterId.indexOf('_org_') !== -1) {
let organizationNodes: ImpactAnalysisModel[] = [];
const organizationNodes: ImpactAnalysisModel[] = [];

this.mainResults.forEach((res: ImpactAnalysisModel) => {
const orgMembers = res.getOrganizationMembers(selectedClusterId.replace('cluster_org_', ''));
Expand All @@ -684,7 +684,7 @@ export class ImpactAnalysisComponent implements OnInit, OnDestroy, AfterViewInit

modalNodeDetail.nodesList = organizationNodes;
} else {
let maturityNodes: ImpactAnalysisModel[] = [];
const maturityNodes: ImpactAnalysisModel[] = [];

this.mainResults.forEach((res: ImpactAnalysisModel) => {
const matMembers = res.getMaturityMembers(selectedClusterId.replace('cluster_mat_', ''));
Expand Down
42 changes: 21 additions & 21 deletions yangcatalog-ui/src/app/features/private/private.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export class PrivateComponent implements OnInit, OnDestroy {
problematicDraftsColDefs: ColDef[] = [
{
colId: '1', field: 'draftName', maxWidth: 400, headerName: 'Draft Name',
cellRenderer: function (params) {
return '<a target="_blank" href="https://www.ietf.org/archive/id/' + params.value + '">' + params.value + '</a>'
cellRenderer(params) {
return '<a target="_blank" href="https://www.ietf.org/archive/id/' + params.value + '">' + params.value + '</a>';
}
},
{ colId: '2', field: 'xymError', headerName: 'XYM Error' }
Expand All @@ -115,27 +115,27 @@ export class PrivateComponent implements OnInit, OnDestroy {
ciscoStatsSelection = 'XR';
showStatsOnly = false;
currentStats = {};
problematicDrafts = {}
problematicDrafts = {};
statsError = null;
privateError = null;
validatorsVersion = {}
validatorsVersion = {};
tabIds = {
'Statistics': 1,
'SDO': 2,
'Graphs': 3,
'IETF': 4,
'Cisco': 5,
'Juniper': 6,
'Huawei': 7,
'Ciena': 8,
'Fujitsu': 9,
'Nokia': 10,
'Etsi': 11,
'OpenROADM': 12
}
Statistics: 1,
SDO: 2,
Graphs: 3,
IETF: 4,
Cisco: 5,
Juniper: 6,
Huawei: 7,
Ciena: 8,
Fujitsu: 9,
Nokia: 10,
Etsi: 11,
OpenROADM: 12
};
queryParams = {
'tab': 'Statistics'
}
tab: 'Statistics'
};

constructor(
private dataService: PrivateService,
Expand Down Expand Up @@ -172,7 +172,7 @@ export class PrivateComponent implements OnInit, OnDestroy {
if (results.query.hasOwnProperty('tab')) {
this.queryParams['tab'] = results.query['tab'];
if (results.query['tab'] in this.tabIds) {
this.active = this.tabIds[results.query['tab']]
this.active = this.tabIds[results.query['tab']];
} else {
this.queryParams['tab'] = null;
}
Expand Down Expand Up @@ -614,7 +614,7 @@ export class PrivateComponent implements OnInit, OnDestroy {

onNavTabChange(event: any) {
const newTabName = Object.keys(this.tabIds).find(key => this.tabIds[key] === event.nextId);
this.queryParams['tab'] = newTabName
this.queryParams['tab'] = newTabName;
this.updateURL();
}

Expand Down
6 changes: 3 additions & 3 deletions yangcatalog-ui/src/app/features/private/private.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export class PrivateService extends DataService {
return this.customGet('api/problematic-drafts').pipe(
map(response => Object.keys(response).map(key => {
return {
'draftName': key,
'xymError': response[key]
}
draftName: key,
xymError: response[key]
};
}))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ export class YangStatsComponent implements OnInit, OnDestroy {
const tallestHeaderTextHeight = Math.max(...clientHeights);

return tallestHeaderTextHeight;
};
}

}
Loading