From b718486526c6debbb4d446f1e5225c7c05286141 Mon Sep 17 00:00:00 2001 From: Erman Celikceviren Date: Sun, 19 Apr 2020 22:07:57 +0300 Subject: [PATCH 1/4] Added banner & youtube video fields to info modal --- .../edit-resource.component.html | 27 +++++++++++++++++++ src/app/models/resource.ts | 3 +++ src/app/service/resource/resource.service.ts | 3 +++ 3 files changed, 33 insertions(+) diff --git a/src/app/components/edit-resource/edit-resource.component.html b/src/app/components/edit-resource/edit-resource.component.html index 5a8861ec..63861d17 100644 --- a/src/app/components/edit-resource/edit-resource.component.html +++ b/src/app/components/edit-resource/edit-resource.component.html @@ -77,6 +77,33 @@ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
diff --git a/src/app/models/resource.ts b/src/app/models/resource.ts index c7ef0c2d..79d0d18b 100644 --- a/src/app/models/resource.ts +++ b/src/app/models/resource.ts @@ -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; diff --git a/src/app/service/resource/resource.service.ts b/src/app/service/resource/resource.service.ts index 06703a15..7edde0f2 100644 --- a/src/app/service/resource/resource.service.ts +++ b/src/app/service/resource/resource.service.ts @@ -73,6 +73,9 @@ export class ResourceService extends AbstractService { onesky_project_id: resource.oneskyProjectId, description: resource.description, manifest: resource.manifest, + attr_banner: resource.banner, + attr_banner_about: resource.bannerAbout, + attr_about_overview_video_youtube: resource.aboutOverviewVideoYoutube, }, }, }; From f214f7bf54ab6517e066edc2df04fbcdd848de2d Mon Sep 17 00:00:00 2001 From: Erman Celikceviren Date: Wed, 22 Apr 2020 23:09:07 +0300 Subject: [PATCH 2/4] Fix: attribute values display issue --- .../edit-resource/update-resource/update-resource.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/edit-resource/update-resource/update-resource.component.ts b/src/app/components/edit-resource/update-resource/update-resource.component.ts index e83fdeab..6e10d8ac 100644 --- a/src/app/components/edit-resource/update-resource/update-resource.component.ts +++ b/src/app/components/edit-resource/update-resource/update-resource.component.ts @@ -41,6 +41,9 @@ 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 { From 2efca32d035321e38be7688b13f4c4cc9a440ce6 Mon Sep 17 00:00:00 2001 From: Daniel Frett Date: Fri, 19 Mar 2021 14:41:12 -0400 Subject: [PATCH 3/4] yarn prettier --- .../components/edit-resource/edit-resource.component.html | 7 +++++-- .../update-resource/update-resource.component.ts | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/components/edit-resource/edit-resource.component.html b/src/app/components/edit-resource/edit-resource.component.html index 63861d17..e298e00a 100644 --- a/src/app/components/edit-resource/edit-resource.component.html +++ b/src/app/components/edit-resource/edit-resource.component.html @@ -82,7 +82,10 @@
- +
@@ -103,7 +106,7 @@ - +
diff --git a/src/app/components/edit-resource/update-resource/update-resource.component.ts b/src/app/components/edit-resource/update-resource/update-resource.component.ts index 6e10d8ac..32ce2206 100644 --- a/src/app/components/edit-resource/update-resource/update-resource.component.ts +++ b/src/app/components/edit-resource/update-resource/update-resource.component.ts @@ -41,7 +41,9 @@ export class UpdateResourceComponent ); this.resource.oneskyProjectId = this.resource['onesky-project-id']; - this.resource.aboutOverviewVideoYoutube = this.resource['attr-about-overview-video-youtube']; + 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']; } From c09fb2e015b26fdb3893480e097b7586f9fa5f0b Mon Sep 17 00:00:00 2001 From: Daniel Frett Date: Thu, 8 Apr 2021 11:37:32 -0400 Subject: [PATCH 4/4] fix saving the banner and about video to the API --- src/app/service/resource/resource.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/service/resource/resource.service.ts b/src/app/service/resource/resource.service.ts index 7edde0f2..13871c02 100644 --- a/src/app/service/resource/resource.service.ts +++ b/src/app/service/resource/resource.service.ts @@ -73,9 +73,10 @@ export class ResourceService extends AbstractService { onesky_project_id: resource.oneskyProjectId, description: resource.description, manifest: resource.manifest, - attr_banner: resource.banner, - attr_banner_about: resource.bannerAbout, - attr_about_overview_video_youtube: resource.aboutOverviewVideoYoutube, + 'attr-banner': resource.banner || null, + 'attr-banner-about': resource.bannerAbout || null, + 'attr-about-overview-video-youtube': + resource.aboutOverviewVideoYoutube || null, }, }, };