From b9f025239209934f7106a29990bf367425611147 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 17 May 2024 10:36:09 +0300 Subject: [PATCH] [plugins-functionality | DONE | CHANGED ] content providers use HTML editor --- .../communityContentProviders.module.ts | 3 +- .../manage-content-providers.component.ts | 29 ++++++++++++++++--- .../remove-content-providers.component.html | 5 ++-- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/app/pages/content-providers/communityContentProviders.module.ts b/src/app/pages/content-providers/communityContentProviders.module.ts index 843d787..4c5dbcd 100644 --- a/src/app/pages/content-providers/communityContentProviders.module.ts +++ b/src/app/pages/content-providers/communityContentProviders.module.ts @@ -29,6 +29,7 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte import {SearchDataprovidersService} from "../../openaireLibrary/services/searchDataproviders.service"; import {CriteriaModule} from "./criteria/criteria.module"; import {MatSlideToggleModule} from "@angular/material/slide-toggle"; +import {CKEditorModule} from "ng2-ckeditor"; @NgModule({ imports: [ @@ -49,7 +50,7 @@ import {MatSlideToggleModule} from "@angular/material/slide-toggle"; path: '', component: ManageContentProvidersComponent } ]), - NoLoadPaging, LoadingModule, IconsModule, FullScreenModalModule, ResultPreviewModule, CriteriaModule, MatSlideToggleModule + NoLoadPaging, LoadingModule, IconsModule, FullScreenModalModule, ResultPreviewModule, CriteriaModule, MatSlideToggleModule, CKEditorModule, ReactiveFormsModule ], declarations: [ ManageContentProvidersComponent, diff --git a/src/app/pages/content-providers/manage-content-providers.component.ts b/src/app/pages/content-providers/manage-content-providers.component.ts index 97f75bc..bf5243e 100644 --- a/src/app/pages/content-providers/manage-content-providers.component.ts +++ b/src/app/pages/content-providers/manage-content-providers.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, OnInit, SimpleChanges, ViewChild} from '@angular/core'; import {RemoveContentProvidersComponent} from './remove-content-providers.component'; import {Title} from '@angular/platform-browser'; import { @@ -15,6 +15,7 @@ import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFie import {CriteriaComponent} from "./criteria/criteria.component"; import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler"; import {ManageCommunityContentProvidersService} from "../../services/manageContentProviders.service"; +import {UntypedFormBuilder} from "@angular/forms"; @Component({ selector: 'manage-content-providers', @@ -39,9 +40,20 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte
-
-
+ --> +
Type a message or instruction for researchers about deposition in this datasource
+ +
Content filters
@@ -75,10 +87,12 @@ export class ManageContentProvidersComponent implements OnInit { deposit= false; enabled = false; depositInfoChanged =false; + messageForm = this.fb.control(""); constructor(private title: Title, private cdr: ChangeDetectorRef, private communityService: CommunityService, - private manageCommunityContentProvidersService: ManageCommunityContentProvidersService) { + private manageCommunityContentProvidersService: ManageCommunityContentProvidersService, + private fb: UntypedFormBuilder) { } ngOnInit() { @@ -113,6 +127,7 @@ export class ManageContentProvidersComponent implements OnInit { this.deposit = this.dataProvider.deposit; this.message = this.dataProvider.message; this.enabled = this.dataProvider.enabled; + this.messageForm = this.fb.control(this.message); this.depositInfoChanged = false; this.filtersModal.title = 'Edit datasource options'; this.filtersModal.okButtonText = "Save"; @@ -153,7 +168,13 @@ export class ManageContentProvidersComponent implements OnInit { depositReset(){ this.message = this.dataProvider.message; + this.messageForm.setValue(this.message); this.deposit = this.dataProvider.deposit; this.enabled = this.dataProvider.enabled; } + + messageChanged(){ + this.message = this.messageForm.value; + this.depositInfoChanged = true; + } } diff --git a/src/app/pages/content-providers/remove-content-providers.component.html b/src/app/pages/content-providers/remove-content-providers.component.html index 13e869f..32693d7 100644 --- a/src/app/pages/content-providers/remove-content-providers.component.html +++ b/src/app/pages/content-providers/remove-content-providers.component.html @@ -57,8 +57,9 @@
Content source
Suggested for deposit
- Deposit info: - {{item.message}}
+
Deposit info:
+
+
Filters