add supportive material editor to UI
This commit is contained in:
parent
b6278ab1ef
commit
c37530c022
|
@ -1,10 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
public enum SupportiveMaterialFieldType {
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
faq,
|
||||
about,
|
||||
glossary,
|
||||
termsofservice,
|
||||
userguide
|
||||
import java.util.Map;
|
||||
|
||||
public enum SupportiveMaterialFieldType implements DatabaseEnum<Short> {
|
||||
|
||||
Faq((short) 0),
|
||||
About((short) 1),
|
||||
Glossary((short) 2),
|
||||
TermsOfService((short) 3),
|
||||
UserGuide((short) 4);
|
||||
|
||||
private final Short value;
|
||||
|
||||
SupportiveMaterialFieldType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, SupportiveMaterialFieldType> map = EnumUtils.getEnumValueMap(SupportiveMaterialFieldType.class);
|
||||
|
||||
public static SupportiveMaterialFieldType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
package eu.eudat.model.persist;
|
||||
|
||||
import eu.eudat.commons.enums.SupportiveMaterialFieldType;
|
||||
import eu.eudat.commons.validation.ValidEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public class UserGuidePersist {
|
||||
public class SupportiveMaterialPersist {
|
||||
|
||||
@NotNull(message = "{validation.empty}")
|
||||
@NotEmpty(message = "{validation.empty}")
|
||||
private String name;
|
||||
|
||||
@ValidEnum(message = "{validation.empty}")
|
||||
private SupportiveMaterialFieldType type;
|
||||
|
||||
@NotNull(message = "{validation.empty}")
|
||||
@NotEmpty(message = "{validation.empty}")
|
||||
private String html;
|
||||
|
@ -20,6 +26,14 @@ public class UserGuidePersist {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public SupportiveMaterialFieldType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(SupportiveMaterialFieldType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getHtml() {
|
||||
return html;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package eu.eudat.service.supportivematerial;
|
||||
|
||||
import eu.eudat.model.persist.UserGuidePersist;
|
||||
import eu.eudat.model.persist.SupportiveMaterialPersist;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -10,7 +10,6 @@ import org.springframework.stereotype.Service;
|
|||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
@ -62,10 +61,10 @@ public class SupportiveMaterialService {
|
|||
return new ResponseEntity<>(supportiveMaterialCacheItem.getContent(), responseHeaders, HttpStatus.OK);
|
||||
}
|
||||
|
||||
public void persist(UserGuidePersist userGuidePersist, String fileName) throws IOException {
|
||||
this.supportiveMaterialCacheService.evict(fileName);
|
||||
OutputStream os = new FileOutputStream(fileName);
|
||||
os.write(userGuidePersist.getHtml().getBytes());
|
||||
public void persist(SupportiveMaterialPersist model) throws IOException {
|
||||
this.supportiveMaterialCacheService.evict(model.getName());
|
||||
OutputStream os = new FileOutputStream(model.getName());
|
||||
os.write(model.getHtml().getBytes());
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package eu.eudat.controllers.v2;
|
|||
import eu.eudat.authorization.Permission;
|
||||
import eu.eudat.commons.enums.SupportiveMaterialFieldType;
|
||||
import eu.eudat.logic.managers.MetricsManager;
|
||||
import eu.eudat.model.persist.UserGuidePersist;
|
||||
import eu.eudat.model.persist.SupportiveMaterialPersist;
|
||||
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
||||
import eu.eudat.service.supportivematerial.SupportiveMaterialService;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -19,6 +19,7 @@ import java.io.IOException;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
@ -38,24 +39,23 @@ public class SupportiveMaterialController {
|
|||
}
|
||||
|
||||
@GetMapping("{lang}")
|
||||
public ResponseEntity<byte[]> getMaterial(@PathVariable(name = "lang") String lang, String field) throws IOException {
|
||||
if( !EnumUtils.isValidEnum(SupportiveMaterialFieldType.class, field)){
|
||||
public ResponseEntity<byte[]> getMaterial(@PathVariable(name = "lang") String lang, int field) throws IOException {
|
||||
if( !EnumUtils.isValidEnum(SupportiveMaterialFieldType.class, SupportiveMaterialFieldType.of((short) field).name())){
|
||||
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
try (Stream<Path> paths = Files.walk(Paths.get(Objects.requireNonNull(this.environment.getProperty(field +".path"))))) {
|
||||
|
||||
try (Stream<Path> paths = Files.walk(Paths.get(Objects.requireNonNull(this.environment.getProperty(SupportiveMaterialFieldType.of((short) field).name().toLowerCase() +".path"))))) {
|
||||
return this.supportiveMaterialService.getResponseEntity(lang, paths);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("current")
|
||||
@PostMapping("persist")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<String>> persist(@RequestBody UserGuidePersist guide, String field) throws IOException {
|
||||
ResponseEntity<ResponseItem<String>> persist(@RequestBody SupportiveMaterialPersist model) throws IOException {
|
||||
this.authorizationService.authorizeForce(Permission.AdminRole);
|
||||
if( !EnumUtils.isValidEnum(SupportiveMaterialFieldType.class, field)){
|
||||
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
String fileName = this.environment.getProperty(field+ ".path") + guide.getName();
|
||||
this.supportiveMaterialService.persist(guide, fileName);
|
||||
|
||||
//String fileName = this.environment.getProperty(model.getName()+ ".path");
|
||||
this.supportiveMaterialService.persist(model);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<String>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Updated").payload("Updated"));
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<p> </p>
|
||||
<p>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
||||
</p>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Σχετικά με το Argos</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>Το ARGOS είναι ένα διαδικτυακό εργαλείο για την υποστήριξη αυτοματοποιημένων διαδικασιών για τη δημιουργία, τη διαχείριση, την κοινή χρήση και τη σύνδεση των DMP με ερευνητικά αντικείμενα στα οποία αντιστοιχούν. Αποτελεί κοινή προσπάθεια του OpenAIRE και της EUDAT να παραδώσουν μια ανοιχτή πλατφόρμα για τον Σχεδιασμό Διαχείρισης Δεδομένων που να αντιμετωπίζει τις βέλτιστες πρακτικές FAIR και Open και να μην προϋποθέτει εμπόδια για τη χρήση και την υιοθέτησή της. Το κάνει εφαρμόζοντας κοινά πρότυπα για μηχανικά ενεργά DMPs, όπως ορίζονται από την παγκόσμια κοινότητα ερευνητικών δεδομένων της RDA και επικοινωνώντας και διαβουλεύοντας τους ερευνητές, τις ερευνητικές κοινότητες και τους χρηματοδότες για να προβληματιστούν καλύτερα για τις ανάγκες τους.<br><br>Το ARGOS παρέχει ένα ευέλικτο περιβάλλον και μια εύκολη διεπαφή για την πλοήγηση και χρήση των χρηστών.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -240,11 +240,11 @@ const appRoutes: Routes = [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: 'user-guide-editor',
|
||||
loadChildren: () => import('./ui/user-guide-editor/user-guide-editor.module').then(m => m.UserGuideEditorModule),
|
||||
path: 'supportive-material',
|
||||
loadChildren: () => import('./ui/supportive-material-editor/supportive-material-editor.module').then(m => m.SupportiveMaterialEditorModule),
|
||||
data: {
|
||||
breadcrumb: true,
|
||||
title: 'GENERAL.TITLES.GUIDE-EDITOR'
|
||||
title: 'GENERAL.TITLES.SUPPORTIVE-MATERIAL'
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export enum SupportiveMaterialFieldType {
|
||||
faq = 'faq',
|
||||
about = 'about',
|
||||
glossary = 'glossary',
|
||||
termsofservice = 'termsofservice',
|
||||
userguide = 'userguide'
|
||||
Faq = 0,
|
||||
About = 1,
|
||||
Glossary = 2,
|
||||
TermsOfService = 3,
|
||||
UserGuide = 4
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
import { SupportiveMaterialFieldType } from "@app/core/common/enum/supportive-material-field-type";
|
||||
|
||||
export interface SupportiveMaterialPersist{
|
||||
name: string;
|
||||
type: SupportiveMaterialFieldType;
|
||||
html: string;
|
||||
}
|
|
@ -2,26 +2,26 @@ import { Injectable } from "@angular/core";
|
|||
import { ConfigurationService } from "../configuration/configuration.service";
|
||||
import { HttpClient, HttpResponse } from "@angular/common/http";
|
||||
import { Observable } from "rxjs";
|
||||
import { SupportiveMaterialFieldType } from "@app/core/common/enum/supportive-material-field-type";
|
||||
import { SupportiveMaterialPersist } from "@app/core/model/supportive-material/supportive-material";
|
||||
import { BaseHttpV2Service } from "../http/base-http-v2.service";
|
||||
|
||||
@Injectable()
|
||||
export class SupportiveMaterialService{
|
||||
private baseUrl : string;
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private http: BaseHttpV2Service,
|
||||
private configurationService: ConfigurationService
|
||||
) {
|
||||
this.baseUrl = `${configurationService.server}material`;
|
||||
}
|
||||
|
||||
public getMaterial(lang: string, field: string): Observable<HttpResponse<Blob>> {
|
||||
return this.http.get(`${this.baseUrl}/${lang}`, {params: {field}, responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html',
|
||||
'Accept': 'text/html',
|
||||
'Access-Control-Allow-Origin': this.configurationService.app,
|
||||
'Access-Control-Allow-Credentials': 'true'} });
|
||||
private get apiBase(): string { return `${this.configurationService.server}material`; }
|
||||
|
||||
public getMaterial(lang: string, field: number): Observable<HttpResponse<Blob>> {
|
||||
return this.http.get(`${this.apiBase}/${lang}`, {params: {field}, responseType: 'blob', observe: 'response' });
|
||||
}
|
||||
|
||||
public persist(data: any, field: string): Observable<String> {
|
||||
return this.http.post<string>(`${this.baseUrl}/current`, data, {params: {field}});
|
||||
public persist(item :SupportiveMaterialPersist): Observable<String> {
|
||||
return this.http.post<string>(`${this.apiBase}/persist`, item);
|
||||
}
|
||||
}
|
|
@ -33,7 +33,7 @@ export class AboutComponent extends BaseComponent implements OnInit {
|
|||
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/about']));
|
||||
});
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.about)
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.About)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'text/html' });
|
||||
|
|
|
@ -28,7 +28,7 @@ export class FaqContentComponent extends BaseComponent implements OnInit {
|
|||
|
||||
ngOnInit() {
|
||||
this.matomoService.trackPageView('FAQ');
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.faq)
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.Faq)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'text/html' });
|
||||
|
|
|
@ -36,7 +36,7 @@ export class GlossaryContentComponent extends BaseComponent implements OnInit {
|
|||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/glossary']));
|
||||
|
||||
});
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.glossary)
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.Glossary)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'text/html' });
|
||||
|
|
|
@ -33,7 +33,7 @@ export class TermsComponent extends BaseComponent implements OnInit {
|
|||
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/terms-and-conditions']));
|
||||
});
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.termsofservice)
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.TermsOfService)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'text/html' });
|
||||
|
|
|
@ -55,7 +55,7 @@ export const ADMIN_ROUTES: RouteInfo[] = [
|
|||
{ path: '/description-template-type', title: 'SIDE-BAR.DESCRIPTION-TEMPLATE-TYPES', icon: 'library_books' },
|
||||
{ path: '/users', title: 'SIDE-BAR.USERS', icon: 'people' },
|
||||
{ path: '/language-editor', title: 'SIDE-BAR.LANGUAGE-EDITOR', icon: 'language' },
|
||||
{ path: '/user-guide-editor', title: 'SIDE-BAR.GUIDE-EDITOR', icon: 'import_contacts' }
|
||||
{ path: '/supportive-material', title: 'SIDE-BAR.SUPPORTIVE-MATERIAL', icon: 'import_contacts' }
|
||||
];
|
||||
|
||||
export const DATASET_TEMPLATE_ROUTES: RouteInfo[] = [
|
||||
|
|
|
@ -1,8 +1,30 @@
|
|||
<div class="user-guide-editor">
|
||||
<div class="supportive-material-editor">
|
||||
<form (ngSubmit)="submit()" [formGroup]="formGroup">
|
||||
<div>
|
||||
<mat-card class="col-md-8 offset-md-2">
|
||||
<mat-card-title><div>{{'GUIDE.TITLE' | translate}}</div></mat-card-title>
|
||||
<div>
|
||||
<div class ="material">
|
||||
<mat-form-field>
|
||||
<mat-label>Material type</mat-label>
|
||||
<mat-select [value] ="selectedMaterial" (selectionChange)="selectedMaterialChanged($event.value)">
|
||||
<mat-option *ngFor="let vis of visiblesMaterialsTypes" [value]="vis">
|
||||
{{vis.name | translate}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class ="lang">
|
||||
<mat-form-field>
|
||||
<mat-label>Language</mat-label>
|
||||
<mat-select [value] ="selectedLang" (selectionChange)="selectedLangChanged($event.value)">
|
||||
<mat-option *ngFor="let vis of visiblesLangTypes" [value]="vis">
|
||||
{{vis.name | translate}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <mat-card-title><div>{{selectedMaterial.name | translate}}</div></mat-card-title> -->
|
||||
<mat-card-content>
|
||||
<editor [init]="{
|
||||
base_url: '/tinymce',
|
|
@ -0,0 +1,28 @@
|
|||
.supportive-material-editor {
|
||||
//padding-top: 5em;
|
||||
padding-bottom: 2em;
|
||||
margin-top: 1em;
|
||||
|
||||
.material{
|
||||
//width: 80px;
|
||||
//height: 80px;
|
||||
float: left;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.lang{
|
||||
//width: 80px;
|
||||
//height: 80px;
|
||||
float: right;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
padding-top: inherit !important;
|
||||
top: auto !important;
|
||||
width: 56px !important;
|
||||
bottom: 10px;
|
||||
position: fixed;
|
||||
right: 40px;
|
||||
}
|
||||
}
|
|
@ -14,13 +14,25 @@ import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||
import { SupportiveMaterialPersist } from '@app/core/model/supportive-material/supportive-material';
|
||||
|
||||
interface VisibleMaterialType{
|
||||
name: string;
|
||||
type: SupportiveMaterialFieldType;
|
||||
}
|
||||
|
||||
interface VisibleLangType{
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-guide-editor',
|
||||
templateUrl: './user-guide-editor.component.html',
|
||||
styleUrls: ['./user-guide-editor.component.scss']
|
||||
selector: 'app-supportive-material-editor',
|
||||
templateUrl: './supportive-material-editor.component.html',
|
||||
styleUrls: ['./supportive-material-editor.component.scss']
|
||||
})
|
||||
export class UserGuideEditorComponent extends BaseComponent implements OnInit {
|
||||
export class SupportiveMaterialEditorComponent extends BaseComponent implements OnInit {
|
||||
public formGroup: UntypedFormGroup;
|
||||
private formBuilder: UntypedFormBuilder;
|
||||
|
||||
|
@ -34,14 +46,57 @@ export class UserGuideEditorComponent extends BaseComponent implements OnInit {
|
|||
private matomoService: MatomoService
|
||||
) { super(); }
|
||||
|
||||
|
||||
visiblesMaterialsTypes: VisibleMaterialType[] = [
|
||||
{name: "FOOTER.FAQ", type: SupportiveMaterialFieldType.Faq},
|
||||
{name: "FOOTER.ABOUT", type: SupportiveMaterialFieldType.About},
|
||||
{name: "FOOTER.GLOSSARY", type: SupportiveMaterialFieldType.Glossary},
|
||||
{name: "FOOTER.TERMS-OF-SERVICE", type: SupportiveMaterialFieldType.TermsOfService},
|
||||
{name: "FOOTER.GUIDE", type: SupportiveMaterialFieldType.UserGuide}
|
||||
]
|
||||
|
||||
visiblesLangTypes: VisibleLangType[] = [
|
||||
{name: "GENERAL.LANGUAGES.ENGLISH", type: "en"},
|
||||
{name: "GENERAL.LANGUAGES.GREEK", type: "gr"},
|
||||
{name: "GENERAL.LANGUAGES.SPANISH", type: "es"},
|
||||
{name: "GENERAL.LANGUAGES.GERMAN", type: "de"},
|
||||
{name: "GENERAL.LANGUAGES.TURKISH", type: "tr"},
|
||||
{name: "GENERAL.LANGUAGES.SLOVAK", type: "sk"},
|
||||
{name: "GENERAL.LANGUAGES.SERBIAN", type: "sr"},
|
||||
{name: "GENERAL.LANGUAGES.PORTUGUESE", type: "pt"},
|
||||
{name: "GENERAL.LANGUAGES.CROATIAN", type: "hr"},
|
||||
{name: "GENERAL.LANGUAGES.POLISH", type: "pl"}
|
||||
|
||||
]
|
||||
|
||||
selectedMaterial: VisibleMaterialType;
|
||||
selectedLang: VisibleLangType;
|
||||
|
||||
ngOnInit() {
|
||||
this.matomoService.trackPageView('Admin: User Guide Editor');
|
||||
this.selectedMaterial = this.visiblesMaterialsTypes.find(x => x.type == SupportiveMaterialFieldType.Faq);
|
||||
this.selectedLang = this.visiblesLangTypes.find(x => x.type == this.languageService.getCurrentLanguage());
|
||||
this.getSupportiveMaterialData();
|
||||
|
||||
}
|
||||
|
||||
public selectedMaterialChanged(item: VisibleMaterialType){
|
||||
this.selectedMaterial = item;
|
||||
this.getSupportiveMaterialData();
|
||||
}
|
||||
|
||||
public selectedLangChanged(item: VisibleLangType){
|
||||
this.selectedLang = item;
|
||||
this.getSupportiveMaterialData();
|
||||
}
|
||||
|
||||
private getSupportiveMaterialData(){
|
||||
this.matomoService.trackPageView(`Admin: ${this.selectedMaterial.name} Editor`);
|
||||
this.formBuilder = new UntypedFormBuilder();
|
||||
this.formGroup = this.formBuilder.group({
|
||||
name: [''],
|
||||
html: ['']
|
||||
});
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.userguide).pipe(takeUntil(this._destroyed)).subscribe(data => {
|
||||
this.supportiveMaterialService.getMaterial(this.selectedLang.type, this.selectedMaterial.type).pipe(takeUntil(this._destroyed)).subscribe(data => {
|
||||
const contentDispositionHeader = data.headers.get('Content-Disposition');
|
||||
const filename = contentDispositionHeader.split(';')[1].trim().split('=')[1].replace(/"/g, '');
|
||||
|
||||
|
@ -77,7 +132,12 @@ export class UserGuideEditorComponent extends BaseComponent implements OnInit {
|
|||
let result = this.parseText(this.formGroup.get('html').value);
|
||||
//result = result.replace(/href="#/g, 'class="href" path="');
|
||||
this.formGroup.get('html').patchValue(result);
|
||||
this.supportiveMaterialService.persist(this.formGroup.value, SupportiveMaterialFieldType.userguide).pipe(takeUntil(this._destroyed))
|
||||
const item = {name: this.formGroup.value['name'], type: this.selectedMaterial.type ,html: this.formGroup.value['html']} as SupportiveMaterialPersist
|
||||
if(item.name.endsWith("_en.html") && this.selectedLang.type != "en" ){
|
||||
item.name = item.name.replace("_en.html", `_${this.selectedLang.type}.html`);
|
||||
}
|
||||
|
||||
this.supportiveMaterialService.persist(item).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => {
|
||||
this.onCallbackSuccess(complete);
|
|
@ -0,0 +1,18 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { SupportiveMaterialEditorRoutingModule } from './supportive-material-editor.routing';
|
||||
import { SupportiveMaterialEditorComponent } from './supportive-material-editor.component';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [SupportiveMaterialEditorComponent],
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
SupportiveMaterialEditorRoutingModule,
|
||||
EditorModule
|
||||
]
|
||||
})
|
||||
export class SupportiveMaterialEditorModule { }
|
|
@ -1,15 +1,15 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { UserGuideEditorComponent } from './user-guide-editor.component';
|
||||
import { SupportiveMaterialEditorComponent } from './supportive-material-editor.component';
|
||||
import { AdminAuthGuard } from '@app/core/admin-auth-guard.service';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', component: UserGuideEditorComponent, canActivate: [AdminAuthGuard] },
|
||||
{ path: '', component: SupportiveMaterialEditorComponent, canActivate: [AdminAuthGuard] },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class UserGuideEditorRoutingModule { }
|
||||
export class SupportiveMaterialEditorRoutingModule { }
|
|
@ -1,14 +0,0 @@
|
|||
.user-guide-editor {
|
||||
//padding-top: 5em;
|
||||
padding-bottom: 2em;
|
||||
margin-top: 1em;
|
||||
|
||||
.save-btn {
|
||||
padding-top: inherit !important;
|
||||
top: auto !important;
|
||||
width: 56px !important;
|
||||
bottom: 10px;
|
||||
position: fixed;
|
||||
right: 40px;
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { UserGuideEditorRoutingModule } from './user-guide-editor.routing';
|
||||
import { UserGuideEditorComponent } from './user-guide-editor.component';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [UserGuideEditorComponent],
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
UserGuideEditorRoutingModule,
|
||||
EditorModule
|
||||
]
|
||||
})
|
||||
export class UserGuideEditorModule { }
|
|
@ -51,7 +51,7 @@ export class UserGuideContentComponent extends BaseComponent implements OnInit {
|
|||
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/user-guide']));
|
||||
});
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.userguide)
|
||||
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.UserGuide)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(response => {
|
||||
const blob = new Blob([response.body], { type: 'text/html' });
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Benutzerhandbuch bearbeiten",
|
||||
"CO-BRANDING": "Co-Branding",
|
||||
"SUPPORT": "Support",
|
||||
"FEEDBACK": "Send feedback"
|
||||
"FEEDBACK": "Send feedback",
|
||||
"SUPPORTIVE-MATERIAL": "Unterstützendes Material"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -331,7 +331,8 @@
|
|||
"GUIDE-EDITOR": "User Guide Editor",
|
||||
"CO-BRANDING": "Co-Branding",
|
||||
"SUPPORT": "Support",
|
||||
"FEEDBACK": "Send feedback"
|
||||
"FEEDBACK": "Send feedback",
|
||||
"SUPPORTIVE-MATERIAL": "Supportive Material"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Editor de la guía de usuario",
|
||||
"CO-BRANDING": "Marca compartida",
|
||||
"SUPPORT": "Soporte",
|
||||
"FEEDBACK": "Enviar feedback"
|
||||
"FEEDBACK": "Enviar feedback",
|
||||
"SUPPORTIVE-MATERIAL": "Μaterial de Αpoyo"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Οδηγός Χρήστη",
|
||||
"CO-BRANDING": "Co-Branding",
|
||||
"SUPPORT": "Υποστήριξη",
|
||||
"FEEDBACK": "Στείλετε τα σχόλιά σας"
|
||||
"FEEDBACK": "Στείλετε τα σχόλιά σας",
|
||||
"SUPPORTIVE-MATERIAL": "Υποστηρικτικό Yλικό"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Uređivanje uputa za korisnike",
|
||||
"CO-BRANDING": "Razvoj i suradnja",
|
||||
"SUPPORT": "Podrška",
|
||||
"FEEDBACK": "Molimo pošaljite nam svoje sugestije i komentare"
|
||||
"FEEDBACK": "Molimo pošaljite nam svoje sugestije i komentare",
|
||||
"SUPPORTIVE-MATERIAL": "Potporni Materijal"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Edytor podręcznika użytkownika",
|
||||
"CO-BRANDING": "Wspólne oznaczenie",
|
||||
"SUPPORT": "Wsparcie",
|
||||
"FEEDBACK": "Wyślij opinię"
|
||||
"FEEDBACK": "Wyślij opinię",
|
||||
"SUPPORTIVE-MATERIAL": "Materiał Pomocniczy"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Editor do Guia de Utilizador",
|
||||
"CO-BRANDING": "Co-Branding",
|
||||
"SUPPORT": "Suporte",
|
||||
"FEEDBACK": "Enviar comentários"
|
||||
"FEEDBACK": "Enviar comentários",
|
||||
"SUPPORTIVE-MATERIAL": "Material de Suporte"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Úprava používateľskej príručky",
|
||||
"CO-BRANDING": "Co-Branding",
|
||||
"SUPPORT": "Podpora",
|
||||
"FEEDBACK": "Poslať spätnú väzbu"
|
||||
"FEEDBACK": "Poslať spätnú väzbu",
|
||||
"SUPPORTIVE-MATERIAL": "Podporný materiál"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Uređivanje vodiča za korisnike",
|
||||
"CO-BRANDING": "Partnerstvo",
|
||||
"SUPPORT": "Podrška",
|
||||
"FEEDBACK": "Pošaljite nam sugestije i komentare"
|
||||
"FEEDBACK": "Pošaljite nam sugestije i komentare",
|
||||
"SUPPORTIVE-MATERIAL": "Потпорни материјал"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -285,7 +285,8 @@
|
|||
"GUIDE-EDITOR": "Kullanıcı Rehberi Editörü",
|
||||
"CO-BRANDING": "Birlikte Markalama",
|
||||
"SUPPORT": "Destek",
|
||||
"FEEDBACK": "Geribildirim Yolla"
|
||||
"FEEDBACK": "Geribildirim Yolla",
|
||||
"SUPPORTIVE-MATERIAL": "Destekleyici Malzeme"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
Loading…
Reference in New Issue