Skip to content

Commit

Permalink
Merge pull request #146 from CruGlobal/feature/GT-644
Browse files Browse the repository at this point in the history
Added banner & youtube video fields to info modal
  • Loading branch information
frett authored Apr 8, 2021
2 parents 1f60635 + c09fb2e commit 569bf84
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/app/components/edit-resource/edit-resource.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,36 @@
</div>
</div>

<div class="row">
<div class="col">
<label>Youtube Video Id</label>
</div>
<div class="col">
<input
placeholder="Youtube Video Id"
[(ngModel)]="resource.aboutOverviewVideoYoutube"
/>
</div>
</div>

<div class="row">
<div class="col">
<label>Banner</label>
</div>
<div class="col">
<input placeholder="Attachment Id" [(ngModel)]="resource.banner" />
</div>
</div>

<div class="row">
<div class="col">
<label>Banner (About)</label>
</div>
<div class="col">
<input placeholder="Attachment Id" [(ngModel)]="resource.bannerAbout" />
</div>
</div>

<div class="row">
<div class="col">
<label>Manifest</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export class UpdateResourceComponent
);

this.resource.oneskyProjectId = this.resource['onesky-project-id'];
this.resource.aboutOverviewVideoYoutube = this.resource[
'attr-about-overview-video-youtube'
];
this.resource.banner = this.resource['attr-banner'];
this.resource.bannerAbout = this.resource['attr-banner-about'];
}

saveResource(): void {
Expand Down
3 changes: 3 additions & 0 deletions src/app/models/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export class Resource {
latest: Translation[];
data: { id: number };
customManifests: CustomManifest[];
aboutOverviewVideoYoutube?: string;
bannerAbout?: number;
banner?: number;

static getResourceTypeId(resource: Resource): number {
return resource.resourceType ? resource.resourceType.id : null;
Expand Down
4 changes: 4 additions & 0 deletions src/app/service/resource/resource.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export class ResourceService extends AbstractService {
onesky_project_id: resource.oneskyProjectId,
description: resource.description,
manifest: resource.manifest,
'attr-banner': resource.banner || null,
'attr-banner-about': resource.bannerAbout || null,
'attr-about-overview-video-youtube':
resource.aboutOverviewVideoYoutube || null,
},
},
};
Expand Down

0 comments on commit 569bf84

Please sign in to comment.