add Supportive Material

This commit is contained in:
amentis 2023-10-18 12:26:57 +03:00
parent 3dee4857f8
commit 17bb6bd4b0
11 changed files with 8 additions and 186 deletions

View File

@ -9,19 +9,6 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>eu.eudat</groupId>
<artifactId>data</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>dmp-backend</groupId>
<artifactId>web</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<artifactId>core</artifactId>
<properties>

View File

@ -1,22 +0,0 @@
package eu.eudat.service.externalreferences;
import eu.eudat.data.entities.DataRepository;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.model.ExternalReference2;
import eu.eudat.model.ExternalReference;
import eu.eudat.models.data.security.Principal;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface ExternalReferencesService {
DataRepository create(ExternalReference externalReference, Principal principal) throws Exception;
List<ExternalReference> getExternal(String externalType, String query, String type, Principal principal) throws HugeResultSet, NoURLFound;
List<ExternalReference2> getExternal2(String externalType, String query, String type, Principal principal) throws HugeResultSet,NoURLFound;
}

View File

@ -48,14 +48,6 @@ public class SupportiveMaterialController {
}
}
// @PostMapping("userguide/current")
// public @ResponseBody
// ResponseEntity<ResponseItem<String>> updateGuide(@RequestBody UserGuidePersist guide, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) throws IOException {
// String fileName = this.environment.getProperty("userguide.path") + guide.getName();
// this.supportiveMaterialService.persist(guide, fileName);
// return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<String>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Updated").payload("Updated"));
// }
@PostMapping("current")
public @ResponseBody
ResponseEntity<ResponseItem<String>> persist(@RequestBody UserGuidePersist guide, String field, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) throws IOException {

View File

@ -27,13 +27,13 @@ cache:
expireAfterAccessMinutes: 10
refreshAfterWriteMinutes: 10
- names: [ "externalReference" ]
allowNullValues: true
initialCapacity: 100
maximumSize: 500
enableRecordStats: false
expireAfterWriteMinutes: 10
expireAfterAccessMinutes: 10
refreshAfterWriteMinutes: 10
allowNullValues: true
initialCapacity: 100
maximumSize: 500
enableRecordStats: false
expireAfterWriteMinutes: 10
expireAfterAccessMinutes: 10
refreshAfterWriteMinutes: 10
mapCaches:
apiKey:
name: apikey

View File

@ -40,17 +40,12 @@ import { ProjectService } from './services/project/project.service';
import { QuickWizardService } from './services/quick-wizard/quick-wizard.service';
import { SearchBarService } from './services/search-bar/search-bar.service';
import { TimezoneService } from './services/timezone/timezone-service';
import { UserGuideService } from './services/user-guide/user-guide.service';
import { UserService } from './services/user/user.service';
import { CollectionUtils } from './services/utilities/collection-utils.service';
import { TypeUtils } from './services/utilities/type-utils.service';
import { SpecialAuthGuard } from './special-auth-guard.service';
import {PrefillingService} from "@app/core/services/prefilling.service";
import { DepositRepositoriesService } from './services/deposit-repositories/deposit-repositories.service';
import { AboutService } from './services/about/about.service';
import { FaqService } from './services/faq/faq.service';
import { GlossaryService } from './services/glossary/glossary.service';
import { TermsOfServiceService } from './services/terms-of-service/terms-of-service.service';
import { UnlinkAccountEmailConfirmationService } from './services/unlink-account-email-confirmation/unlink-account-email-confirmation.service';
import { DescriptionTemplateTypeService } from './services/description-template-type/description-template-type.service';
import { BaseHttpV2Service } from './services/http/base-http-v2.service';
@ -121,12 +116,7 @@ export class CoreServiceModule {
ContactSupportService,
LanguageService,
LockService,
UserGuideService,
AboutService,
PrincipalService,
FaqService,
GlossaryService,
TermsOfServiceService,
SupportiveMaterialService,
CurrencyService,
MergeEmailConfirmationService,

View File

@ -1,23 +0,0 @@
import { Injectable } from "@angular/core";
import { ConfigurationService } from "../configuration/configuration.service";
import { HttpClient, HttpResponse } from "@angular/common/http";
import { Observable } from "rxjs";
@Injectable()
export class AboutService {
private aboutUrl : string;
constructor(
private http: HttpClient,
private configurationService: ConfigurationService
) {
this.aboutUrl = `${configurationService.server}material/about`;
}
public getAbout(lang: string): Observable<HttpResponse<Blob>> {
return this.http.get(`${this.aboutUrl}/${lang}`, { responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html',
'Accept': 'text/html',
'Access-Control-Allow-Origin': this.configurationService.app,
'Access-Control-Allow-Credentials': 'true'} });
}
}

View File

@ -1,23 +0,0 @@
import { Injectable } from "@angular/core";
import { ConfigurationService } from "../configuration/configuration.service";
import { HttpClient, HttpResponse } from "@angular/common/http";
import { Observable } from "rxjs";
@Injectable()
export class FaqService {
private faqUrl : string;
constructor(
private http: HttpClient,
private configurationService: ConfigurationService
) {
this.faqUrl = `${configurationService.server}material`;
}
public getFaq(lang: string, field: string): Observable<HttpResponse<Blob>> {
return this.http.get(`${this.faqUrl}/${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'} });
}
}

View File

@ -1,23 +0,0 @@
import { Injectable } from "@angular/core";
import { ConfigurationService } from "../configuration/configuration.service";
import { HttpClient, HttpResponse } from "@angular/common/http";
import { Observable } from "rxjs";
@Injectable()
export class GlossaryService {
private glossaryUrl : string;
constructor(
private http: HttpClient,
private configurationService: ConfigurationService
) {
this.glossaryUrl = `${configurationService.server}material/glossary`;
}
public getGlossary(lang: string): Observable<HttpResponse<Blob>> {
return this.http.get(`${this.glossaryUrl}/${lang}`, { responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html',
'Accept': 'text/html',
'Access-Control-Allow-Origin': this.configurationService.app,
'Access-Control-Allow-Credentials': 'true'} });
}
}

View File

@ -1,23 +0,0 @@
import { Injectable } from "@angular/core";
import { ConfigurationService } from "../configuration/configuration.service";
import { HttpClient, HttpResponse } from "@angular/common/http";
import { Observable } from "rxjs";
@Injectable()
export class TermsOfServiceService {
private termsOfServiceUrl : string;
constructor(
private http: HttpClient,
private configurationService: ConfigurationService
) {
this.termsOfServiceUrl = `${configurationService.server}material/termsofservice`;
}
public getTermsOfService(lang: string): Observable<HttpResponse<Blob>> {
return this.http.get(`${this.termsOfServiceUrl}/${lang}`, { responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html',
'Accept': 'text/html',
'Access-Control-Allow-Origin': this.configurationService.app,
'Access-Control-Allow-Credentials': 'true'} });
}
}

View File

@ -1,33 +0,0 @@
import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { HttpResponse, HttpClient } from '@angular/common/http';
import { BaseHttpService } from '../http/base-http.service';
import { ConfigurationService } from '../configuration/configuration.service';
@Injectable()
export class UserGuideService {
private userGuideUrl : string;
constructor(
private translate: TranslateService,
private http: HttpClient,
private baseHttp: BaseHttpService,
private configurationService: ConfigurationService
) {
this.userGuideUrl = `${configurationService.server}material/userguide`;
}
public getUserGuide(lang: string): Observable<HttpResponse<Blob>> {
return this.http.get(`${this.userGuideUrl}/${lang}`, { responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html',
'Accept': 'text/html',
'Access-Control-Allow-Origin': this.configurationService.app,
'Access-Control-Allow-Credentials': 'true'} });
}
public updateUserGuide(data: any): Observable<String> {
return this.http.post<string>(`${this.userGuideUrl}/current`, data);
}
}

View File

@ -77,7 +77,7 @@ 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, "userguide").pipe(takeUntil(this._destroyed))
this.supportiveMaterialService.persist(this.formGroup.value, SupportiveMaterialFieldType.userguide).pipe(takeUntil(this._destroyed))
.subscribe(
complete => {
this.onCallbackSuccess(complete);