From 5e3c540c27005fd8376ead0bed6f50b8b46b793e Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:58:19 +0100 Subject: [PATCH] ufal/fe-add-default-static-pages (#406) * Added static pages from the lindat git * Fixed redirection and created safeHtml pipe. * Could redirect out of namespace url, small refactoring. * Updated tests. * Added images into the static pages. --- src/app/shared/shared.module.ts | 4 +- src/app/shared/utils/clarin-safehtml.pipe.ts | 15 + .../static-page/static-page.component.html | 2 +- .../static-page/static-page.component.spec.ts | 19 +- src/app/static-page/static-page.component.ts | 36 ++- src/app/static-page/static-page.module.ts | 10 +- src/assets/images/static-pages/bibtex.png | Bin 0 -> 82042 bytes src/assets/images/static-pages/refbox.png | Bin 0 -> 70878 bytes src/assets/images/static-pages/step1.png | Bin 0 -> 3995 bytes src/assets/images/static-pages/step2.png | Bin 0 -> 5136 bytes src/assets/images/static-pages/step2_1.png | Bin 0 -> 25958 bytes src/assets/images/static-pages/step3.png | Bin 0 -> 59819 bytes src/assets/images/static-pages/step4.png | Bin 0 -> 112617 bytes src/assets/images/static-pages/step4_1.png | Bin 0 -> 44847 bytes src/assets/images/static-pages/step5.png | Bin 0 -> 49433 bytes src/assets/images/static-pages/step6_1.png | Bin 0 -> 33679 bytes src/assets/images/static-pages/step6_2.png | Bin 0 -> 44091 bytes src/assets/images/static-pages/step6_3.png | Bin 0 -> 114055 bytes src/static-files/about.html | 160 +++++++++++ src/static-files/cite.html | 41 +++ src/static-files/cookies.html | 32 +++ src/static-files/cs/about.html | 160 +++++++++++ src/static-files/cs/cite.html | 41 +++ src/static-files/cs/cookies.html | 33 +++ src/static-files/cs/deposit.html | 136 +++++++++ src/static-files/cs/error.html | 39 +++ src/static-files/cs/faq.html | 220 +++++++++++++++ src/static-files/cs/item-lifecycle.html | 68 +++++ src/static-files/cs/metadata.html | 166 +++++++++++ src/static-files/deposit.html | 150 ++++++++++ src/static-files/disco-juice.html | 76 +++++ src/static-files/faq.html | 263 ++++++++++++++++++ src/static-files/item-lifecycle.html | 82 ++++++ src/static-files/metadata.html | 164 +++++++++++ src/static-files/search.html | 12 + src/static-files/terms-of-service.html | 174 ++++++++++++ 36 files changed, 2087 insertions(+), 16 deletions(-) create mode 100644 src/app/shared/utils/clarin-safehtml.pipe.ts create mode 100644 src/assets/images/static-pages/bibtex.png create mode 100644 src/assets/images/static-pages/refbox.png create mode 100644 src/assets/images/static-pages/step1.png create mode 100644 src/assets/images/static-pages/step2.png create mode 100644 src/assets/images/static-pages/step2_1.png create mode 100644 src/assets/images/static-pages/step3.png create mode 100644 src/assets/images/static-pages/step4.png create mode 100644 src/assets/images/static-pages/step4_1.png create mode 100644 src/assets/images/static-pages/step5.png create mode 100644 src/assets/images/static-pages/step6_1.png create mode 100644 src/assets/images/static-pages/step6_2.png create mode 100644 src/assets/images/static-pages/step6_3.png create mode 100644 src/static-files/about.html create mode 100644 src/static-files/cite.html create mode 100644 src/static-files/cookies.html create mode 100644 src/static-files/cs/about.html create mode 100644 src/static-files/cs/cite.html create mode 100644 src/static-files/cs/cookies.html create mode 100644 src/static-files/cs/deposit.html create mode 100644 src/static-files/cs/error.html create mode 100644 src/static-files/cs/faq.html create mode 100644 src/static-files/cs/item-lifecycle.html create mode 100644 src/static-files/cs/metadata.html create mode 100644 src/static-files/deposit.html create mode 100644 src/static-files/disco-juice.html create mode 100644 src/static-files/faq.html create mode 100644 src/static-files/item-lifecycle.html create mode 100644 src/static-files/metadata.html create mode 100644 src/static-files/search.html create mode 100644 src/static-files/terms-of-service.html diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 2329f43680b..acea16c0d4e 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -275,6 +275,7 @@ import { EpersonGroupListComponent } from './eperson-group-list/eperson-group-li import { EpersonSearchBoxComponent } from './eperson-group-list/eperson-search-box/eperson-search-box.component'; import { GroupSearchBoxComponent } from './eperson-group-list/group-search-box/group-search-box.component'; import { HtmlContentService } from './html-content.service'; +import { ClarinSafeHtmlPipe } from './utils/clarin-safehtml.pipe'; const MODULES = [ CommonModule, @@ -319,7 +320,8 @@ const PIPES = [ ClarinLicenseCheckedPipe, ClarinLicenseLabelRadioValuePipe, ClarinLicenseRequiredInfoPipe, - CharToEndPipe + CharToEndPipe, + ClarinSafeHtmlPipe ]; const COMPONENTS = [ diff --git a/src/app/shared/utils/clarin-safehtml.pipe.ts b/src/app/shared/utils/clarin-safehtml.pipe.ts new file mode 100644 index 00000000000..ebf2e21c8da --- /dev/null +++ b/src/app/shared/utils/clarin-safehtml.pipe.ts @@ -0,0 +1,15 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; + +/** + * Pipe to keep html tags e.g., `id` in the `innerHTML` attribute. + */ +@Pipe({ + name: 'dsSafeHtml' +}) +export class ClarinSafeHtmlPipe implements PipeTransform { + constructor(private sanitized: DomSanitizer) {} + transform(htmlString: string): SafeHtml { + return this.sanitized.bypassSecurityTrustHtml(htmlString); + } +} diff --git a/src/app/static-page/static-page.component.html b/src/app/static-page/static-page.component.html index 15c3ea6ef07..99b85f71fb9 100644 --- a/src/app/static-page/static-page.component.html +++ b/src/app/static-page/static-page.component.html @@ -1,3 +1,3 @@
VWU>e>YPN@LY=hiEN5;l)RSlks
z&OS&Oh4iGHU+W)4zQ&T4JSAnsMa?1ht$8}cZQBJqQYq63%Fe(GM$Cx=X8Fc`Ig&_v
zrzWeKG}pw-aYjMV;T @15o`
z2>y7D#?|ny*5vvZRP|*3VNJueFEeUY<4y|(KJPFfS8m^IBK+;30MQcxgS& G2nzKh4n{5UkdRmaT+u)>;ayk_RsaS~r#*Dd76Fe|{ch
z3W#wEt4x7L!ZU{&{`_d1j<@-|R8|vk!0OI};&=L4T{<&n!M94(PZ~vjTxpaJ(YTWj
zxxEeN=E8w@`W*O_Wu4Z~xUKsbZttXwxjjyg`z>2c(&4TBo_-lfraS*g+U^+8%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