From 8ee25e17b88b970703f4df9e74cb4726bbffd837 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 31 May 2021 11:33:49 +0200 Subject: Add ability to set custom markdown in description --- .../config/edit-custom-config/edit-homepage.component.html | 2 +- .../+admin/config/edit-custom-config/edit-homepage.component.ts | 8 +++----- .../edit-custom-config/edit-instance-information.component.html | 6 +++++- .../edit-custom-config/edit-instance-information.component.ts | 9 +++++++++ 4 files changed, 18 insertions(+), 7 deletions(-) (limited to 'client/src/app/+admin') diff --git a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html index baaac5fb7..2286a5a1a 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html @@ -17,7 +17,7 @@ diff --git a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts index 7decf8f75..1923ede39 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts @@ -7,7 +7,7 @@ import { CustomMarkupService } from '@app/shared/shared-custom-markup' templateUrl: './edit-homepage.component.html', styleUrls: [ './edit-custom-config.component.scss' ] }) -export class EditHomepageComponent implements OnInit { +export class EditHomepageComponent { @Input() form: FormGroup @Input() formErrors: any @@ -17,9 +17,7 @@ export class EditHomepageComponent implements OnInit { } - ngOnInit () { - this.customMarkdownRenderer = async (text: string) => { - return this.customMarkup.buildElement(text) - } + getCustomMarkdownRenderer () { + return this.customMarkup.getCustomMarkdownRenderer() } } diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html index cbff26e5a..d806616bd 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html @@ -32,10 +32,14 @@
- + +
+ +
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts index 26365e707..4185f121f 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts @@ -1,6 +1,7 @@ import { SelectOptionsItem } from 'src/types/select-options-item.model' import { Component, Input } from '@angular/core' import { FormGroup } from '@angular/forms' +import { CustomMarkupService } from '@app/shared/shared-custom-markup' @Component({ selector: 'my-edit-instance-information', @@ -13,4 +14,12 @@ export class EditInstanceInformationComponent { @Input() languageItems: SelectOptionsItem[] = [] @Input() categoryItems: SelectOptionsItem[] = [] + + constructor (private customMarkup: CustomMarkupService) { + + } + + getCustomMarkdownRenderer () { + return this.customMarkup.getCustomMarkdownRenderer() + } } -- cgit v1.2.3