Skip to content

Commit

Permalink
Make taxonomy tag configuable. Fixed unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanlin2018 committed Jul 18, 2024
1 parent e18fe4c commit ff292e1
Show file tree
Hide file tree
Showing 18 changed files with 524 additions and 749 deletions.
4 changes: 3 additions & 1 deletion angular/src/app/_helpers/fakeBackendInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export class FakeBackendInterceptor implements HttpInterceptor {
// const sampleData: any = require('../../assets/science-theme/BiometricsScienceTheme.json');
// const sampleData: any = require('../../assets/sample-data/semiconductorRecord.json');
const sampleData: any = require('../../assets/sample-data/semi-conductors.json');
const sampleCollection: any = require('../../assets/sample-data/semiconductors-collection.json');
// const sampleCollection: any = require('../../assets/sample-data/semiconductors-collection.json');
const sampleCollection: any = require('../../assets/sample-data/semiconductor-realdata.json');

const fields: any = require('../../assets/sample-data/fields.json');
// const sampleRecord: any = require('../../assets/science-theme/DNAScienceTheme.json');

Expand Down
202 changes: 19 additions & 183 deletions angular/src/app/landing/filters/filters.component.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions angular/src/app/landing/landingbody.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('LandingBodyComponent', () => {
component.md["@type"][0] = "nrdp:PublicDataResource";
component.metricsData = new MetricsData();
component.editEnabled = false;
component.collection = "Semiconductors";
fixture.detectChanges();
}));

Expand Down
2 changes: 1 addition & 1 deletion angular/src/app/landing/resultlist/resultlist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class ResultlistComponent implements OnInit {
);
}

this.allCollections = this.collectionService.loadCollections(this.collection);
this.allCollections = this.collectionService.loadAllCollections();

// Set colors
this.setColor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class SearchresultComponent implements OnInit {
prevMouseX: number = 0;
prevFilterWidth: number = 0;
taxonomyURI: any = {};
allCollections: any = {};

@ViewChild('parentDiv')
topLevelDiv: ElementRef;
Expand All @@ -49,9 +50,10 @@ export class SearchresultComponent implements OnInit {
}

ngOnInit(): void {
this.taxonomyURI[Collections.DEFAULT] = this.collectionService.loadCollections(Collections.DEFAULT)[Collections.DEFAULT].taxonomyURI;
this.taxonomyURI[Collections.FORENSICS] = this.collectionService.loadCollections(Collections.FORENSICS)[Collections.FORENSICS].taxonomyURI;
this.taxonomyURI[Collections.SEMICONDUCTORS] = this.collectionService.loadCollections(Collections.SEMICONDUCTORS)[Collections.SEMICONDUCTORS].taxonomyURI;
this.allCollections = this.collectionService.loadAllCollections();
this.taxonomyURI[Collections.DEFAULT] = this.allCollections[Collections.DEFAULT].taxonomyURI;
this.taxonomyURI[Collections.FORENSICS] = this.allCollections[Collections.FORENSICS].taxonomyURI;
this.taxonomyURI[Collections.SEMICONDUCTORS] = this.allCollections[Collections.SEMICONDUCTORS].taxonomyURI;
}

ngAfterViewInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('ResourceDescriptionComponent', () => {
beforeEach(waitForAsync(() => {
makeComp();
component.inBrowser = true;
component.collection = "Semiconductors";
fixture.detectChanges();
}));

Expand Down
2 changes: 1 addition & 1 deletion angular/src/app/landing/tools/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class MenuComponent implements OnInit {
}

ngOnInit(): void {
this.allCollections = this.collectionService.loadCollections(this.collection);
this.allCollections = this.collectionService.loadAllCollections();

this.setColor();

Expand Down
104 changes: 0 additions & 104 deletions angular/src/app/landing/tools/toolmenu.component.css

This file was deleted.

55 changes: 0 additions & 55 deletions angular/src/app/landing/tools/toolmenu.component.spec.ts

This file was deleted.

Loading

0 comments on commit ff292e1

Please sign in to comment.