Merge branch 'Development' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into Development
This commit is contained in:
commit
45227cca10
|
@ -1,6 +1,5 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import eu.eudat.data.dao.entities.UserDatasetProfileDao;
|
|
||||||
import eu.eudat.data.entities.UserDatasetProfile;
|
import eu.eudat.data.entities.UserDatasetProfile;
|
||||||
import eu.eudat.data.entities.UserInfo;
|
import eu.eudat.data.entities.UserInfo;
|
||||||
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
|
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
|
||||||
|
@ -17,7 +16,6 @@ import eu.eudat.models.data.datasetprofile.DatasetProfileListingModel;
|
||||||
import eu.eudat.models.data.helpers.common.DataTableData;
|
import eu.eudat.models.data.helpers.common.DataTableData;
|
||||||
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
||||||
import org.springframework.core.env.Environment;
|
|
||||||
import eu.eudat.models.data.security.Principal;
|
import eu.eudat.models.data.security.Principal;
|
||||||
import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
||||||
import eu.eudat.types.ApiMessageCode;
|
import eu.eudat.types.ApiMessageCode;
|
||||||
|
@ -70,16 +68,7 @@ public class Admin extends BaseController {
|
||||||
userDatasetProfile.setUser(userInfo);
|
userDatasetProfile.setUser(userInfo);
|
||||||
userDatasetProfile.setRole(0);
|
userDatasetProfile.setRole(0);
|
||||||
getApiContext().getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile);
|
getApiContext().getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile);
|
||||||
if (profile.getUsers() != null && !profile.getUsers().isEmpty()) {
|
datasetProfileManager.storeDatasetProfileUsers(datasetProfile, profile);
|
||||||
profile.getUsers().forEach(userInfoListingModel -> {
|
|
||||||
UserDatasetProfile userDatasetProfile1 = new UserDatasetProfile();
|
|
||||||
userDatasetProfile1.setDatasetProfile(datasetProfile);
|
|
||||||
UserInfo userInfo1 = getApiContext().getOperationsContext().getDatabaseRepository().getUserInfoDao().find(userInfoListingModel.getId());
|
|
||||||
userDatasetProfile1.setUser(userInfo1);
|
|
||||||
userDatasetProfile1.setRole(1);
|
|
||||||
getApiContext().getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(modelDefinition.getId());
|
return ResponseEntity.status(HttpStatus.OK).body(modelDefinition.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,16 +84,7 @@ public class Admin extends BaseController {
|
||||||
datasetprofile.setDescription(modelDefinition.getDescription());
|
datasetprofile.setDescription(modelDefinition.getDescription());
|
||||||
datasetprofile.setLanguage(modelDefinition.getLanguage());
|
datasetprofile.setLanguage(modelDefinition.getLanguage());
|
||||||
eu.eudat.data.entities.DatasetProfile datasetProfile = this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(datasetprofile);
|
eu.eudat.data.entities.DatasetProfile datasetProfile = this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(datasetprofile);
|
||||||
if (profile.getUsers() != null && !profile.getUsers().isEmpty()) {
|
datasetProfileManager.storeDatasetProfileUsers(datasetProfile, profile);
|
||||||
profile.getUsers().forEach(userInfoListingModel -> {
|
|
||||||
UserDatasetProfile userDatasetProfile1 = new UserDatasetProfile();
|
|
||||||
userDatasetProfile1.setDatasetProfile(datasetProfile);
|
|
||||||
UserInfo userInfo1 = getApiContext().getOperationsContext().getDatabaseRepository().getUserInfoDao().find(userInfoListingModel.getId());
|
|
||||||
userDatasetProfile1.setUser(userInfo1);
|
|
||||||
userDatasetProfile1.setRole(1);
|
|
||||||
getApiContext().getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UUID>().status(ApiMessageCode.NO_MESSAGE));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UUID>().status(ApiMessageCode.NO_MESSAGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,16 +128,7 @@ public class Admin extends BaseController {
|
||||||
eu.eudat.models.data.admin.composite.DatasetProfile datasetprofile = AdminManager.generateDatasetProfileModel(profile);
|
eu.eudat.models.data.admin.composite.DatasetProfile datasetprofile = AdminManager.generateDatasetProfileModel(profile);
|
||||||
datasetprofile.setLabel(profile.getLabel() + " new ");
|
datasetprofile.setLabel(profile.getLabel() + " new ");
|
||||||
datasetprofile.setLanguage(profile.getLanguage());
|
datasetprofile.setLanguage(profile.getLanguage());
|
||||||
if (profile.getUsers() != null && !profile.getUsers().isEmpty()) {
|
datasetProfileManager.retrieveUsers(profile, datasetprofile);
|
||||||
datasetprofile.setUsers(profile.getUsers().stream().map(userDatasetProfile -> {
|
|
||||||
UserInfoListingModel userInfoListingModel = new UserInfoListingModel();
|
|
||||||
userInfoListingModel.setId(userDatasetProfile.getUser().getId());
|
|
||||||
userInfoListingModel.setName(userDatasetProfile.getUser().getName());
|
|
||||||
userInfoListingModel.setEmail(userDatasetProfile.getUser().getEmail());
|
|
||||||
userInfoListingModel.setRole(userDatasetProfile.getRole());
|
|
||||||
return userInfoListingModel;
|
|
||||||
}).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<eu.eudat.models.data.admin.composite.DatasetProfile>().payload(datasetprofile));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<eu.eudat.models.data.admin.composite.DatasetProfile>().payload(datasetprofile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,14 @@ public class Users extends BaseController {
|
||||||
ResponseEntity exportCsv(@ClaimedAuthorities(claims = {ADMIN}) Principal principal) throws Exception {
|
ResponseEntity exportCsv(@ClaimedAuthorities(claims = {ADMIN}) Principal principal) throws Exception {
|
||||||
return userManager.exportToCsv(principal);
|
return userManager.exportToCsv(principal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.POST, value = {"/find"}, consumes = "application/json", produces = "application/json")
|
||||||
|
public @ResponseBody
|
||||||
|
ResponseEntity<ResponseItem<UserProfile>> find(@Valid @RequestBody String email) throws Exception {
|
||||||
|
UserProfile userProfile = userManager.getFromEmail(email);
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UserProfile>().payload(userProfile).status(ApiMessageCode.NO_MESSAGE));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.jayway.jsonpath.DocumentContext;
|
||||||
import com.jayway.jsonpath.JsonPath;
|
import com.jayway.jsonpath.JsonPath;
|
||||||
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DatasetProfile;
|
||||||
|
import eu.eudat.data.entities.UserDatasetProfile;
|
||||||
|
import eu.eudat.data.entities.UserInfo;
|
||||||
import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileAutocompleteRequest;
|
import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileAutocompleteRequest;
|
||||||
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
|
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
|
||||||
import eu.eudat.exceptions.datasetprofile.DatasetProfileNewVersionException;
|
import eu.eudat.exceptions.datasetprofile.DatasetProfileNewVersionException;
|
||||||
|
@ -72,16 +74,7 @@ public class DatasetProfileManager {
|
||||||
datasetprofile.setDescription(profile.getDescription());
|
datasetprofile.setDescription(profile.getDescription());
|
||||||
datasetprofile.setLanguage(profile.getLanguage());
|
datasetprofile.setLanguage(profile.getLanguage());
|
||||||
datasetprofile.setUsers(new ArrayList<>());
|
datasetprofile.setUsers(new ArrayList<>());
|
||||||
if (profile.getUsers() != null && !profile.getUsers().isEmpty()) {
|
retrieveUsers(profile, datasetprofile);
|
||||||
datasetprofile.getUsers().addAll(profile.getUsers().stream().map(userDatasetProfile -> {
|
|
||||||
UserInfoListingModel userInfoListingModel = new UserInfoListingModel();
|
|
||||||
userInfoListingModel.setId(userDatasetProfile.getUser().getId());
|
|
||||||
userInfoListingModel.setName(userDatasetProfile.getUser().getName());
|
|
||||||
userInfoListingModel.setEmail(userInfoListingModel.getEmail());
|
|
||||||
userInfoListingModel.setRole(userInfoListingModel.getRole());
|
|
||||||
return userInfoListingModel;
|
|
||||||
}).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
return datasetprofile;
|
return datasetprofile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,4 +269,34 @@ public class DatasetProfileManager {
|
||||||
throw new DatasetProfileNewVersionException("Version to update not the latest.");
|
throw new DatasetProfileNewVersionException("Version to update not the latest.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void storeDatasetProfileUsers(DatasetProfile entity, eu.eudat.models.data.admin.composite.DatasetProfile model) {
|
||||||
|
if (model.getUsers() != null && !model.getUsers().isEmpty()) {
|
||||||
|
model.getUsers().stream().filter(userInfoListingModel -> entity.getUsers().stream().filter(userDatasetProfile -> userDatasetProfile.getUser().getId().equals(userInfoListingModel.getId())).count() == 0).forEach(userInfoListingModel -> {
|
||||||
|
UserDatasetProfile userDatasetProfile1 = new UserDatasetProfile();
|
||||||
|
userDatasetProfile1.setDatasetProfile(entity);
|
||||||
|
UserInfo userInfo1 = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(userInfoListingModel.getId());
|
||||||
|
userDatasetProfile1.setUser(userInfo1);
|
||||||
|
userDatasetProfile1.setRole(1);
|
||||||
|
apiContext.getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
entity.getUsers().stream().filter(userDatasetProfile -> model.getUsers().stream().filter(userInfoListingModel -> userDatasetProfile.getUser().getId().equals(userInfoListingModel.getId())).count() == 0).forEach(userDatasetProfile -> {
|
||||||
|
userDatasetProfile.setRole(2);
|
||||||
|
apiContext.getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retrieveUsers(DatasetProfile entity, eu.eudat.models.data.admin.composite.DatasetProfile model) {
|
||||||
|
if (entity.getUsers() != null && !entity.getUsers().isEmpty()) {
|
||||||
|
model.setUsers(entity.getUsers().stream().filter(userDatasetProfile -> userDatasetProfile.getRole() < 2).map(userDatasetProfile -> {
|
||||||
|
UserInfoListingModel userInfoListingModel = new UserInfoListingModel();
|
||||||
|
userInfoListingModel.setId(userDatasetProfile.getUser().getId());
|
||||||
|
userInfoListingModel.setName(userDatasetProfile.getUser().getName());
|
||||||
|
userInfoListingModel.setEmail(userDatasetProfile.getUser().getEmail());
|
||||||
|
userInfoListingModel.setRole(userDatasetProfile.getRole());
|
||||||
|
return userInfoListingModel;
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,4 +240,9 @@ public class UserManager {
|
||||||
return new ResponseEntity<>(content, responseHeaders, HttpStatus.OK);
|
return new ResponseEntity<>(content, responseHeaders, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserProfile getFromEmail(String email) {
|
||||||
|
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().asQueryable().where((builder, root) -> builder.equal(root.get("email"), email)).getSingle();
|
||||||
|
return new UserProfile().fromDataModel(user);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { ValidationType } from "../../../common/enum/validation-type";
|
import { ValidationType } from "../../../common/enum/validation-type";
|
||||||
|
import { UserInfoListingModel } from "../../user/user-info-listing";
|
||||||
|
|
||||||
export interface DatasetProfile {
|
export interface DatasetProfile {
|
||||||
label: string;
|
label: string;
|
||||||
|
@ -8,6 +9,7 @@ export interface DatasetProfile {
|
||||||
version: number;
|
version: number;
|
||||||
description: string;
|
description: string;
|
||||||
language: string;
|
language: string;
|
||||||
|
users: UserInfoListingModel[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Page {
|
export interface Page {
|
||||||
|
|
|
@ -53,6 +53,10 @@ export class UserService {
|
||||||
return this.http.post<DataTableData<UserListingModel>>(this.actionUrl + 'getCollaboratorsPaged', JSON.stringify(dataTableRequest), { headers: this.headers });
|
return this.http.post<DataTableData<UserListingModel>>(this.actionUrl + 'getCollaboratorsPaged', JSON.stringify(dataTableRequest), { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFromEmail(email: string): Observable<UserListingModel> {
|
||||||
|
return this.http.post<UserListingModel>(this.actionUrl + 'find', email, {headers: this.headers});
|
||||||
|
}
|
||||||
|
|
||||||
public hasDOIToken(): Observable<any> {
|
public hasDOIToken(): Observable<any> {
|
||||||
const url = this.actionUrl + 'hasDOIToken';
|
const url = this.actionUrl + 'hasDOIToken';
|
||||||
return this.http.get(url, { headers: this.headers });
|
return this.http.get(url, { headers: this.headers });
|
||||||
|
|
|
@ -54,6 +54,7 @@ import {DragulaModule} from 'ng2-dragula';
|
||||||
import {MatBadgeModule} from '@angular/material/badge';
|
import {MatBadgeModule} from '@angular/material/badge';
|
||||||
import { DatasetProfileEditorSectionFieldSetComponent } from './editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component';
|
import { DatasetProfileEditorSectionFieldSetComponent } from './editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component';
|
||||||
import { FinalPreviewComponent } from './editor/components/final-preview/final-preview.component';
|
import { FinalPreviewComponent } from './editor/components/final-preview/final-preview.component';
|
||||||
|
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -68,7 +69,8 @@ import { FinalPreviewComponent } from './editor/components/final-preview/final-p
|
||||||
AngularStickyThingsModule,
|
AngularStickyThingsModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
MatBadgeModule,
|
MatBadgeModule,
|
||||||
DragulaModule
|
DragulaModule,
|
||||||
|
AutoCompleteModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DatasetProfileListingComponent,
|
DatasetProfileListingComponent,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
|
||||||
import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
||||||
import { PageEditorModel } from '../admin/page-editor-model';
|
import { PageEditorModel } from '../admin/page-editor-model';
|
||||||
|
@ -15,6 +16,7 @@ export class DatasetProfileEditorModel extends BaseFormModel {
|
||||||
public version: number;
|
public version: number;
|
||||||
private description: string;
|
private description: string;
|
||||||
private language: string;
|
private language: string;
|
||||||
|
private users: UserInfoListingModel[] = [];
|
||||||
|
|
||||||
fromModel(item: DatasetProfile): DatasetProfileEditorModel {
|
fromModel(item: DatasetProfile): DatasetProfileEditorModel {
|
||||||
if (item.sections) { this.sections = item.sections.map(x => new SectionEditorModel().fromModel(x)); }
|
if (item.sections) { this.sections = item.sections.map(x => new SectionEditorModel().fromModel(x)); }
|
||||||
|
@ -24,6 +26,7 @@ export class DatasetProfileEditorModel extends BaseFormModel {
|
||||||
this.version = item.version;
|
this.version = item.version;
|
||||||
this.description = item.description;
|
this.description = item.description;
|
||||||
this.language = item.language;
|
this.language = item.language;
|
||||||
|
this.users = item.users;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +36,8 @@ export class DatasetProfileEditorModel extends BaseFormModel {
|
||||||
description: [{ value: this.description, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.description')) }, [Validators.required]],
|
description: [{ value: this.description, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.description')) }, [Validators.required]],
|
||||||
language: [{ value: this.language, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.language')) }, [Validators.required]],
|
language: [{ value: this.language, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.language')) }, [Validators.required]],
|
||||||
status: [{ value: this.status, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.status')) }],
|
status: [{ value: this.status, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.status')) }],
|
||||||
version: [{ value: this.version, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.version')) }]
|
version: [{ value: this.version, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.version')) }],
|
||||||
|
users: [{ value: this.users, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.users')) }]
|
||||||
});
|
});
|
||||||
|
|
||||||
const sectionsFormArray = new Array<FormGroup>();
|
const sectionsFormArray = new Array<FormGroup>();
|
||||||
|
|
|
@ -164,6 +164,29 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<!-- <div class="heading">1.3 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}</div> -->
|
||||||
|
<div class="heading">1.4 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-USERS'| translate}}</div>
|
||||||
|
<div class="full-width basic-info-input">
|
||||||
|
<table class="col-12">
|
||||||
|
<tr class="row">
|
||||||
|
<th class="col-4">{{'USERS.LISTING.NAME' | translate}}</th>
|
||||||
|
<th class="col-4">{{'USERS.LISTING.EMAIL' | translate}}</th>
|
||||||
|
<th class="col-4"></th>
|
||||||
|
</tr>
|
||||||
|
<tr *ngFor="let user of userChipList" class="row">
|
||||||
|
<td class="col-4">{{user.name}}</td>
|
||||||
|
<td class="col-4">{{user.email}}</td>
|
||||||
|
<td class="col-4">
|
||||||
|
<button mat-raised-button class="delete-btn" (click)="removeUser(user)">delete</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<input matInput #email class = "col-8" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-USERS'| translate}}">
|
||||||
|
<button mat-raised-button color="primary" (click)="checkAndAdd(email.value)">Add and Validate</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <div class="col-12">
|
<!-- <div class="col-12">
|
||||||
<button mat-button class="full-width" (click)="addPage()"
|
<button mat-button class="full-width" (click)="addPage()"
|
||||||
[disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.NEXT' | translate}}</button>
|
[disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.NEXT' | translate}}</button>
|
||||||
|
|
|
@ -228,3 +228,8 @@ $blue-color-light: #5cf7f2;
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.delete-btn {
|
||||||
|
background-color: rgba(255, 0, 0, 0.76);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
|
@ -45,6 +45,12 @@ import { EditorCustomValidators, EditorCustomValidatorsEnum } from './custom-val
|
||||||
import { CustomErrorValidator } from '@common/forms/validation/custom-validator';
|
import { CustomErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { STEPPER_ANIMATIONS } from './animations/animations';
|
import { STEPPER_ANIMATIONS } from './animations/animations';
|
||||||
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
||||||
|
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||||
|
import { DmpInvitationUser } from '@app/core/model/dmp/invitation/dmp-invitation-user';
|
||||||
|
import { RequestItem } from '@app/core/query/request-item';
|
||||||
|
import { DmpInvitationUserCriteria } from '@app/core/query/dmp/dmp-invitation-user-criteria';
|
||||||
|
import { DmpInvitationService } from '@app/core/services/dmp/dmp-invitation.service';
|
||||||
|
import { UserService } from '@app/core/services/user/user.service';
|
||||||
|
|
||||||
|
|
||||||
const skipDisable: any[] = require('../../../../../assets/resources/skipDisable.json');
|
const skipDisable: any[] = require('../../../../../assets/resources/skipDisable.json');
|
||||||
|
@ -75,6 +81,8 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
||||||
nestedIndex: number = 0;
|
nestedIndex: number = 0;
|
||||||
errorMessages: string[] = [];
|
errorMessages: string[] = [];
|
||||||
tocEntryEnumValues = ToCEntryType;
|
tocEntryEnumValues = ToCEntryType;
|
||||||
|
public userChipList:any[] = [];
|
||||||
|
displayedColumns: String[] = ['name', 'email', 'button'];
|
||||||
|
|
||||||
colorizeInvalid:boolean = false;
|
colorizeInvalid:boolean = false;
|
||||||
|
|
||||||
|
@ -101,7 +109,8 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
||||||
private datasetWizardService: DatasetWizardService,
|
private datasetWizardService: DatasetWizardService,
|
||||||
private visibilityRulesService: VisibilityRulesService,
|
private visibilityRulesService: VisibilityRulesService,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private sidenavService: SideNavService
|
private sidenavService: SideNavService,
|
||||||
|
private userService: UserService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
// this.profileID = route.snapshot.params['id'];
|
// this.profileID = route.snapshot.params['id'];
|
||||||
|
@ -248,6 +257,8 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
||||||
this.steps = this.stepper.steps;
|
this.steps = this.stepper.steps;
|
||||||
});
|
});
|
||||||
this._initializeToCEntries();
|
this._initializeToCEntries();
|
||||||
|
console.log(this.form.get('users').value);
|
||||||
|
this.userChipList = [...this.form.get('users').value];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1824,6 +1835,18 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkAndAdd(ev: any) {
|
||||||
|
this.userService.getFromEmail(ev).pipe(takeUntil(this._destroyed)).subscribe((result) => {
|
||||||
|
this.userChipList.push(result);
|
||||||
|
this.form.patchValue({'users': this.userChipList});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
removeUser(user: any) {
|
||||||
|
this.userChipList.splice(this.userChipList.indexOf(user), 1);
|
||||||
|
this.form.patchValue({'users': this.userChipList});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface InvalidControl{
|
interface InvalidControl{
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
|
@ -289,6 +289,7 @@
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
"DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.",
|
||||||
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
"DATASET-TEMPLATE-LANGUAGE": "Dataset template language",
|
||||||
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
"DATASET-TEMPLATE-SELECT-LANGUAGE": "Select a language",
|
||||||
|
"DATASET-TEMPLATE-USERS": "Users",
|
||||||
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
"DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER": "Dataset template description",
|
||||||
"UNTITLED": "Untitled",
|
"UNTITLED": "Untitled",
|
||||||
"QUESTION": "Question",
|
"QUESTION": "Question",
|
||||||
|
|
Loading…
Reference in New Issue