argos/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-title/form-composite-title.compon...

27 lines
665 B
TypeScript
Raw Normal View History

import { Component, OnInit, Input } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ToCEntry } from '../../dataset-description.component';
@Component({
selector: 'app-form-composite-title',
templateUrl: './form-composite-title.component.html',
styleUrls: ['./form-composite-title.component.scss']
})
export class FormCompositeTitleComponent implements OnInit {
@Input() form: FormGroup;
@Input() isChild: Boolean = false;
@Input() tocentry:ToCEntry;
Description boxes in admin forms replaced with rich text editor <angular-editor>. 1. dataset-profile-editor-composite-field.component.ts & dataset-profile-editor-section.component.ts & dataset-profile-editor.component.ts: Initialize AngularEditorConfig. 2. dataset-profile-editor-composite-field.component.html & dataset-profile-editor-section.component.html & dataset-profile-editor.component.html: Use <angular-editor> in description. 3. multiple-auto-complete.component.html & dataset-profile-listing.component.html & form-section.component.html: Show description as html. 4. dataset-profile.module.ts: Imported HttpClientModule, AngularEditorModule (needed for <angular-editor>). 5. available-profiles.component.html: Show description as html, under the Dataset Template title, not as tooltip (matTooltip does not receive html). 6. available-profiles.component.ts: Added styleUrls: ['available-profiles.component.scss']. 7. available-profiles.component.scss: [NEW] Added css for class "list-option" to cut description if too long. 8. form-composite-title.component.html: Show description and extendedDescription as html | Add view more/less functionality to show/hide extendedDescription. 9. form-composite-title.component.ts: Added "public showExtendedDescription: boolean = false;" field. 10. form-composite-title.component.scss: Added css for "more" class, to make "view more/less" seem like link. 11. assets/i18n/: In language files added DATASET-EDITOR.QUESTION.EXTENDED-DESCRIPTION.VIEW-MORE (-LESS). 12. assets/styles.css: Added css for <angular-editor>, to be similar to the other text areas and forms.
2021-10-12 17:14:22 +02:00
public showExtendedDescription: boolean = false;
constructor() { }
ngOnInit() {
if(this.tocentry){
this.form = this.tocentry.form as FormGroup;
}
}
}