Meta data field customization #19
This commit is contained in:
parent
b4e40d2daa
commit
78ee146b71
8 changed files with 247 additions and 11 deletions
|
|
@ -17,8 +17,8 @@ export abstract class MediaTypeModel {
|
|||
|
||||
abstract getTags(): string[];
|
||||
|
||||
toMetaData(): string {
|
||||
return YAMLConverter.toYaml({...this.getWithOutUserData(), ...this.userData, tags: '#' + this.getTags().join('/')});
|
||||
toMetaDataObject(): object {
|
||||
return {...this.getWithOutUserData(), ...this.userData, tags: '#' + this.getTags().join('/')};
|
||||
}
|
||||
|
||||
getWithOutUserData(): object {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export class WikiModel extends MediaTypeModel {
|
|||
wikiUrl: string;
|
||||
lastUpdated: string;
|
||||
length: number;
|
||||
article: string;
|
||||
|
||||
userData: {};
|
||||
|
||||
|
|
@ -35,4 +36,11 @@ export class WikiModel extends MediaTypeModel {
|
|||
return MediaType.Wiki;
|
||||
}
|
||||
|
||||
override getWithOutUserData(): object {
|
||||
const copy = JSON.parse(JSON.stringify(this));
|
||||
delete copy.userData;
|
||||
delete copy.article;
|
||||
return copy;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue