-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor of Category dertail view for metadata
- Loading branch information
1 parent
dee8fbb
commit c455f2e
Showing
16 changed files
with
485 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="t-margin-extraSmall t-margin-bottom"> | ||
<div class="m-sectionLabel">{{data.label}}</div> | ||
</div> | ||
<ng-template [ngIf]="!!data.bodyString"> | ||
<p class="t-type-body" [innerHTML]="data.bodyString"></p> | ||
</ng-template> | ||
<ng-template [ngIf]="!!data.bodyTemplate"> | ||
<ng-container *ngTemplateOutlet="data.bodyTemplate"></ng-container> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
101 changes: 101 additions & 0 deletions
101
ui/src/app/metadata/detail/abstract-metadata-detail.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { Component, Input, OnInit} from "@angular/core"; | ||
import { Title } from "@angular/platform-browser"; | ||
import { ActivatedRoute } from "@angular/router"; | ||
|
||
import { IDetailCardSectionData } from "src/app/detail-card/section/section.component"; | ||
import { ApiJobCode } from "../job-codes/Jobcode"; | ||
import { ApiNamedReference } from "../named-references/NamedReference"; | ||
import { MetadataType } from "../rsd-metadata.enum"; | ||
import { QuickLinksHelper } from "../../core/quick-links-helper"; | ||
|
||
@Component({ | ||
template: `` | ||
}) | ||
export abstract class AbstractMetadataDetailComponent extends QuickLinksHelper implements OnInit { | ||
|
||
idParam: string | null; | ||
metadata?: ApiNamedReference | ApiJobCode; | ||
|
||
constructor( | ||
protected route: ActivatedRoute, | ||
protected titleService: Title | ||
) { | ||
super(); | ||
this.idParam = this.route.snapshot.paramMap.get("id"); | ||
} | ||
|
||
ngOnInit(): void { | ||
|
||
} | ||
|
||
protected loadMetadata() { | ||
if (this.idParam) { | ||
// this.categoryService.getById(this.idParam).subscribe( | ||
// (m: ApiNamedReference | ApiJobCode) => this.setMetadata(m)); | ||
} else { | ||
this.clearMetadata(); | ||
} | ||
} | ||
|
||
protected setMetadata(metadata: ApiNamedReference | ApiJobCode) { | ||
this.metadata = metadata; | ||
|
||
// this.titleService.setTitle(`${category.name} | Category | ${this.whitelabel.toolName}`) | ||
this.loadSkills(); | ||
} | ||
|
||
protected loadSkills(): void { | ||
if (this.metadata) { | ||
// this.skillTableControl.loadSkills(this.metadata.id); | ||
} else { | ||
this.clearSkills(); | ||
} | ||
} | ||
|
||
protected clearMetadata() { | ||
this.metadata = undefined; | ||
this.titleService.setTitle( | ||
`${this.getMetadataType()} | ${this.whitelabel.toolName}`); | ||
this.loadSkills(); | ||
} | ||
|
||
protected clearSkills() { | ||
// this.skillTableControl.clearSkills(); | ||
} | ||
|
||
getId(): number { | ||
return this.metadata?.id ?? -1; | ||
} | ||
|
||
getCardFormat(): IDetailCardSectionData[] { | ||
return []; | ||
} | ||
|
||
getMetadataName(): string { | ||
return "Fine Arts"; | ||
} | ||
|
||
getMetadataType(): string { | ||
if (this.metadata instanceof ApiNamedReference) { | ||
return this.metadata.type ?? ""; | ||
} | ||
else if (this.metadata instanceof ApiJobCode) { | ||
return MetadataType.JobCode; | ||
} | ||
else { | ||
return ""; | ||
} | ||
} | ||
|
||
getPublishStatus(): string { | ||
return ""; | ||
} | ||
|
||
getArchivedDate(): string { | ||
return ""; | ||
} | ||
|
||
getPublishedDate(): string { | ||
return ""; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
ui/src/app/metadata/detail/metadata-card/metadata-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="m-skillBackground m-skillBackground-detail m-skillBackground-collection l-skillBackground"> | ||
<div class="t-margin-extraSmall t-margin-bottom"> | ||
<div class="m-sectionLabel">Category</div> | ||
</div> | ||
<h2 class="t-type-heading1 t-margin-extraSmall t-margin-bottom" tabindex="0">{{categoryName}}</h2> | ||
<p *ngIf="showSkillCount" class="t-type-body">{{categorySkillsLabel}}</p> | ||
</div> |
Oops, something went wrong.