2021-05-19 13:40:29 +02:00
|
|
|
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
2023-03-13 20:26:31 +01:00
|
|
|
import {UntypedFormArray, UntypedFormBuilder, UntypedFormControl} from '@angular/forms';
|
2023-03-15 10:56:28 +01:00
|
|
|
import {ActivatedRoute} from '@angular/router';
|
2019-03-07 16:43:10 +01:00
|
|
|
import {CommunityService} from '../../../openaireLibrary/connect/community/community.service';
|
|
|
|
import {SubjectsService} from '../subjects.service';
|
|
|
|
import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-properties';
|
2020-04-01 15:40:48 +02:00
|
|
|
import {Title} from '@angular/platform-browser';
|
2021-05-19 13:40:29 +02:00
|
|
|
import {properties} from '../../../../environments/environment';
|
|
|
|
import {AlertModal} from '../../../openaireLibrary/utils/modal/alert';
|
|
|
|
import {SearchInputComponent} from '../../../openaireLibrary/sharedComponents/search-input/search-input.component';
|
2023-03-09 15:30:13 +01:00
|
|
|
import {forkJoin, Subscription} from 'rxjs';
|
2021-05-19 13:40:29 +02:00
|
|
|
import {CommunityInfo} from '../../../openaireLibrary/connect/community/communityInfo';
|
2022-07-04 14:13:33 +02:00
|
|
|
import {FullScreenModalComponent} from 'src/app/openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component';
|
|
|
|
import {HelperFunctions} from 'src/app/openaireLibrary/utils/HelperFunctions.class';
|
2022-07-13 19:26:10 +02:00
|
|
|
import {NotificationHandler} from "../../../openaireLibrary/utils/notification-handler";
|
2022-08-11 11:58:20 +02:00
|
|
|
import {ClearCacheService} from "../../../openaireLibrary/services/clear-cache.service";
|
2023-03-09 15:30:13 +01:00
|
|
|
import {SdgSelectionComponent} from '../../../openaireLibrary/sdg/sdg-selection/sdg-selection.component';
|
2023-03-13 20:26:31 +01:00
|
|
|
import {FosSelectionComponent} from '../../../openaireLibrary/fos/fos-selection/fos-selection.component';
|
2023-04-04 09:49:59 +02:00
|
|
|
import {InputComponent} from "../../../openaireLibrary/sharedComponents/input/input.component";
|
2023-03-13 20:26:31 +01:00
|
|
|
|
|
|
|
declare var UIkit: any;
|
2021-05-19 13:40:29 +02:00
|
|
|
|
2018-10-30 16:31:16 +01:00
|
|
|
@Component({
|
2021-05-19 13:40:29 +02:00
|
|
|
selector: 'subjects-edit-form',
|
|
|
|
templateUrl: './subjects-edit-form.component.html',
|
2018-10-30 16:31:16 +01:00
|
|
|
})
|
2019-03-07 16:43:10 +01:00
|
|
|
export class SubjectsEditFormComponent implements OnInit {
|
2023-03-15 10:56:28 +01:00
|
|
|
properties: EnvProperties = properties;
|
|
|
|
communityId: string = null;
|
|
|
|
community: CommunityInfo = null;
|
|
|
|
showLoading = true;
|
|
|
|
params: any;
|
|
|
|
private subscriptions: any[] = [];
|
|
|
|
|
|
|
|
filterForm: UntypedFormControl;
|
2023-03-09 15:30:13 +01:00
|
|
|
subjectsForm = new UntypedFormArray([]);
|
2023-03-15 10:56:28 +01:00
|
|
|
hasChanges: boolean = false;
|
|
|
|
originalAllSubjects = [];
|
|
|
|
originalSubjects = [];
|
|
|
|
originalSdg = [];
|
|
|
|
originalFos = [];
|
|
|
|
displayedAllSubjects = [];
|
|
|
|
displayedSubjects = [];
|
|
|
|
displayedSdg = [];
|
|
|
|
displayedFos = [];
|
2023-03-09 15:30:13 +01:00
|
|
|
groupedAllSubjects = [];
|
|
|
|
groupedSubjects = [];
|
|
|
|
groupedSdg = [];
|
|
|
|
groupedFos = [];
|
|
|
|
subjectsColumns = [];
|
|
|
|
subjectsLimit: number = 6;
|
2023-03-15 10:56:28 +01:00
|
|
|
maxCharacters: number = 25;
|
|
|
|
activeTab: 'all' | 'freeText' | 'sdg' | 'fos' = 'all';
|
|
|
|
indexAll: number = 0;
|
|
|
|
indexSubjects: number = 0;
|
|
|
|
indexSdg: number = 0;
|
|
|
|
indexFos: number = 0;
|
2023-03-09 15:30:13 +01:00
|
|
|
|
2023-04-04 09:49:59 +02:00
|
|
|
@ViewChild('addSubjectsInput') addSubjectsInput: InputComponent;
|
2021-05-19 13:40:29 +02:00
|
|
|
@ViewChild('editModal') editModal: AlertModal;
|
|
|
|
@ViewChild('deleteModal') deleteModal: AlertModal;
|
2022-07-04 14:13:33 +02:00
|
|
|
@ViewChild('fsModal', {static: true}) fullscreen: FullScreenModalComponent;
|
2023-03-13 20:26:31 +01:00
|
|
|
@ViewChild('modalTabs') modalTabs: ElementRef;
|
2023-03-09 15:30:13 +01:00
|
|
|
@ViewChild('sdgSelection') sdgSelection: SdgSelectionComponent;
|
2023-03-13 20:26:31 +01:00
|
|
|
@ViewChild('fosSelection') fosSelection: FosSelectionComponent;
|
|
|
|
|
|
|
|
onEnter: () => void = () => {
|
|
|
|
this.addSubjectsIntoList();
|
|
|
|
}
|
|
|
|
|
2023-03-15 10:56:28 +01:00
|
|
|
constructor(private route: ActivatedRoute,
|
2022-09-23 16:14:20 +02:00
|
|
|
public _fb: UntypedFormBuilder,
|
2021-05-19 13:40:29 +02:00
|
|
|
private title: Title,
|
|
|
|
private _communityService: CommunityService,
|
|
|
|
private _subjectsService: SubjectsService,
|
2023-03-15 10:56:28 +01:00
|
|
|
private _clearCacheService: ClearCacheService) {
|
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.filterForm = this._fb.control('');
|
|
|
|
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
|
2023-03-15 10:56:28 +01:00
|
|
|
this.displayedAllSubjects = this.originalAllSubjects.filter(subject => {
|
|
|
|
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
|
|
|
|
});
|
|
|
|
this.displayedSubjects = this.originalSubjects.filter(subject => {
|
|
|
|
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
|
|
|
|
});
|
|
|
|
this.displayedSdg = this.originalSdg.filter(subject => {
|
2022-07-04 14:13:33 +02:00
|
|
|
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
|
2021-05-19 13:40:29 +02:00
|
|
|
});
|
2023-03-15 10:56:28 +01:00
|
|
|
this.displayedFos = this.originalFos.filter(subject => {
|
|
|
|
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
|
|
|
|
});
|
|
|
|
if(this.activeTab === 'all') {
|
|
|
|
this.groupSubjects(this.displayedAllSubjects, 'all');
|
|
|
|
} else if(this.activeTab === 'freeText') {
|
|
|
|
this.groupSubjects(this.displayedSubjects, 'freeText');
|
|
|
|
} else if(this.activeTab === 'sdg') {
|
|
|
|
this.groupSubjects(this.displayedSdg, 'sdg');
|
|
|
|
} else if(this.activeTab === 'fos') {
|
|
|
|
this.groupSubjects(this.displayedFos, 'fos');
|
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
}));
|
|
|
|
this.subscriptions.push(this.route.params.subscribe(
|
|
|
|
params => {
|
|
|
|
this.communityId = params['community'];
|
|
|
|
this.title.setTitle(this.communityId.toUpperCase() + ' | Subjects');
|
|
|
|
this.showLoading = true;
|
|
|
|
this.subscriptions.push(this._communityService.getCommunityAsObservable().subscribe(
|
|
|
|
community => {
|
|
|
|
this.community = community;
|
|
|
|
this.params = {
|
|
|
|
community: encodeURIComponent(
|
|
|
|
'"' + community.queryId + '"')
|
|
|
|
};
|
|
|
|
this.community.subjects.sort((n1,n2)=> {
|
|
|
|
if (n1.toLowerCase() > n2.toLowerCase()) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (n1.toLowerCase() < n2.toLowerCase()) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return 0;
|
2018-10-30 16:31:16 +01:00
|
|
|
});
|
2023-03-13 20:26:31 +01:00
|
|
|
this.displayedSubjects = HelperFunctions.copy(this.community.subjects);
|
2023-03-09 15:30:13 +01:00
|
|
|
this.displayedSdg = this.community.sdg;
|
|
|
|
this.displayedFos = this.community.fos;
|
|
|
|
this.displayedAllSubjects = [...this.displayedSubjects, ...this.displayedSdg, ...this.displayedFos];
|
|
|
|
this.groupSubjects(this.displayedAllSubjects, 'all');
|
2023-03-15 10:56:28 +01:00
|
|
|
this.originalAllSubjects = HelperFunctions.copy(this.displayedAllSubjects);
|
|
|
|
this.originalSubjects = HelperFunctions.copy(this.displayedSubjects);
|
|
|
|
this.originalSdg = HelperFunctions.copy(this.displayedSdg);
|
|
|
|
this.originalFos = HelperFunctions.copy(this.displayedFos);
|
2021-05-19 13:40:29 +02:00
|
|
|
this.showLoading = false;
|
|
|
|
},
|
|
|
|
error => this.handleUpdateError('System error retrieving community profile', error)
|
|
|
|
));
|
|
|
|
}));
|
|
|
|
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
this.subscriptions.forEach(subscription => {
|
|
|
|
if (subscription instanceof Subscription) {
|
|
|
|
subscription.unsubscribe();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2023-03-09 15:30:13 +01:00
|
|
|
|
|
|
|
public groupSubjects(subjects: string[], type: string) {
|
|
|
|
if(subjects.length === 0) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
subjects.sort((a, b) => a.localeCompare(b));
|
|
|
|
if(type === 'all') {
|
2023-03-15 10:56:28 +01:00
|
|
|
this.indexAll = 0;
|
|
|
|
this.activeTab = 'all';
|
2023-03-09 15:30:13 +01:00
|
|
|
this.groupedAllSubjects = Object.values(
|
|
|
|
subjects.reduce((acc, subject) => {
|
|
|
|
let firstLetter = subject[0].toLocaleUpperCase();
|
|
|
|
if(!acc[firstLetter]) {
|
|
|
|
acc[firstLetter] = {group: firstLetter, data: [subject]};
|
|
|
|
} else {
|
|
|
|
acc[firstLetter].data.push(subject);
|
|
|
|
}
|
|
|
|
return acc;
|
|
|
|
},{})
|
|
|
|
)
|
|
|
|
if(subjects.length > 1) {
|
|
|
|
this.groupedAllSubjects.unshift({group: 'All', data: subjects});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(type === 'freeText') {
|
2023-03-15 10:56:28 +01:00
|
|
|
this.indexSubjects = 0;
|
|
|
|
this.activeTab = 'freeText';
|
2023-03-09 15:30:13 +01:00
|
|
|
this.groupedSubjects = Object.values(
|
|
|
|
subjects.reduce((acc, subject) => {
|
|
|
|
let firstLetter = subject[0].toLocaleUpperCase();
|
|
|
|
if(!acc[firstLetter]) {
|
|
|
|
acc[firstLetter] = {group: firstLetter, data: [subject]};
|
|
|
|
} else {
|
|
|
|
acc[firstLetter].data.push(subject);
|
|
|
|
}
|
|
|
|
return acc;
|
|
|
|
},{})
|
|
|
|
)
|
|
|
|
if(subjects.length > 1) {
|
|
|
|
this.groupedSubjects.unshift({group: 'All', data: subjects});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(type === 'sdg') {
|
2023-03-15 10:56:28 +01:00
|
|
|
this.indexSdg = 0;
|
|
|
|
this.activeTab = 'sdg';
|
2023-03-09 15:30:13 +01:00
|
|
|
this.groupedSdg = Object.values(
|
|
|
|
subjects.reduce((acc, subject) => {
|
|
|
|
let firstLetter = subject[0].toLocaleUpperCase();
|
|
|
|
if(!acc[firstLetter]) {
|
|
|
|
acc[firstLetter] = {group: firstLetter, data: [subject]};
|
|
|
|
} else {
|
|
|
|
acc[firstLetter].data.push(subject);
|
|
|
|
}
|
|
|
|
return acc;
|
|
|
|
},{})
|
|
|
|
)
|
|
|
|
if(subjects.length > 1) {
|
|
|
|
this.groupedSdg.unshift({group: 'All', data: subjects});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(type === 'fos') {
|
2023-03-15 10:56:28 +01:00
|
|
|
this.indexFos = 0;
|
|
|
|
this.activeTab = 'fos';
|
2023-03-09 15:30:13 +01:00
|
|
|
this.groupedFos = Object.values(
|
|
|
|
subjects.reduce((acc, subject) => {
|
2023-03-13 20:26:31 +01:00
|
|
|
let key = subject.substring(0,2).toLocaleUpperCase();
|
|
|
|
if(!acc[key]) {
|
|
|
|
acc[key] = {group: key, data: [subject]};
|
2023-03-09 15:30:13 +01:00
|
|
|
} else {
|
2023-03-13 20:26:31 +01:00
|
|
|
acc[key].data.push(subject);
|
2023-03-09 15:30:13 +01:00
|
|
|
}
|
|
|
|
return acc;
|
|
|
|
},{})
|
|
|
|
)
|
|
|
|
if(subjects.length > 1) {
|
|
|
|
this.groupedFos.unshift({group: 'All', data: subjects});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public changeDisplayedSubjects(i, group) {
|
|
|
|
this.subjectsColumns = [];
|
2023-03-15 10:56:28 +01:00
|
|
|
if(this.activeTab === 'all') {
|
|
|
|
this.indexAll = i;
|
|
|
|
} else if(this.activeTab === 'freeText') {
|
|
|
|
this.indexSubjects = i;
|
|
|
|
} else if(this.activeTab === 'sdg') {
|
|
|
|
this.indexSdg = i;
|
|
|
|
} else if(this.activeTab === 'fos') {
|
|
|
|
this.indexFos = i;
|
|
|
|
}
|
2023-03-09 15:30:13 +01:00
|
|
|
if(group.data.length > this.subjectsLimit && group.group != 'All') {
|
|
|
|
this.divideSubjects(group);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public divideSubjects(group) {
|
|
|
|
let columns = [];
|
|
|
|
for(let i = 0; i < (group.data.length / this.subjectsLimit); i++) {
|
|
|
|
columns.push(group.data.slice(i * this.subjectsLimit, ((i + 1) * this.subjectsLimit)));
|
|
|
|
}
|
|
|
|
this.subjectsColumns = columns;
|
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
|
|
|
public getSubjectsExistOnlyInFirst(firstArray: string[], secondArray: string[]): string[] {
|
|
|
|
const difference = [];
|
|
|
|
for (let i = 0; i < firstArray.length; i++) {
|
|
|
|
if (secondArray.indexOf(firstArray[i]) === -1) {
|
|
|
|
difference.push(firstArray[i]);
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2018-11-13 16:26:49 +01:00
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
return difference;
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2023-03-09 15:30:13 +01:00
|
|
|
|
|
|
|
public editAllSubjects() {
|
2023-03-13 20:26:31 +01:00
|
|
|
UIkit.tab(this.modalTabs.nativeElement).show(0);
|
|
|
|
this.displayedSubjects = HelperFunctions.copy(this.community.subjects);
|
|
|
|
this.sdgSelection.reset();
|
|
|
|
this.sdgSelection.sdgs.markAsPristine();
|
|
|
|
this.fosSelection.reset();
|
|
|
|
this.fosSelection.fosOptions.markAsPristine();
|
2023-03-09 15:30:13 +01:00
|
|
|
this.fullscreen.title = "Add/Edit Subjects";
|
|
|
|
this.fullscreen.okButtonText = "Save";
|
|
|
|
this.fullscreen.back = true;
|
|
|
|
this.fullscreen.okButton = true;
|
|
|
|
this.fullscreen.open();
|
|
|
|
}
|
|
|
|
|
|
|
|
public addSubjectsIntoList() {
|
2023-04-04 09:49:59 +02:00
|
|
|
if(this.addSubjectsInput.searchControl.getRawValue()) {
|
|
|
|
this.addSubjectsInput.add(null, true);
|
|
|
|
}
|
|
|
|
this.subjectsForm.getRawValue().forEach(element => {
|
2023-03-09 15:30:13 +01:00
|
|
|
this.displayedSubjects.unshift(element);
|
|
|
|
});
|
|
|
|
this.subjectsForm.clear();
|
2023-03-13 20:26:31 +01:00
|
|
|
this.hasChanges = true;
|
2023-03-09 15:30:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public removeSubjectFromList(i) {
|
|
|
|
this.displayedSubjects.splice(i, 1);
|
2023-03-13 20:26:31 +01:00
|
|
|
this.hasChanges = true;
|
2023-03-09 15:30:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public saveAllSubjects() {
|
|
|
|
let selectedSdg = this.sdgSelection.getSelectedSubjects().map(a => a.id);
|
|
|
|
let selectedFos = this.fosSelection.getSelectedSubjects().map(a => a.id);
|
|
|
|
let requests = [
|
|
|
|
...this.saveSubjects(this.community.subjects, this.displayedSubjects, 'subjects'),
|
|
|
|
...this.saveSubjects(this.community.sdg, selectedSdg, 'sdg'),
|
|
|
|
...this.saveSubjects(this.community.fos, selectedFos, 'fos')
|
|
|
|
];
|
|
|
|
this.subscriptions.push(forkJoin(requests).subscribe(res => {
|
|
|
|
this.afterUpdateActions(res, "updated");
|
|
|
|
}));
|
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
2023-03-09 15:30:13 +01:00
|
|
|
public saveSubjects(subjects, displayedSubjects, type: string) {
|
2022-07-04 14:13:33 +02:00
|
|
|
if (this.communityId != null && this.communityId !== '') {
|
|
|
|
this.showLoading = true;
|
2023-03-09 15:30:13 +01:00
|
|
|
const subjectsToDeleteAr = this.getSubjectsExistOnlyInFirst(subjects, displayedSubjects);
|
|
|
|
const subjectsToAddAr = this.getSubjectsExistOnlyInFirst(displayedSubjects, subjects);
|
2022-07-04 14:13:33 +02:00
|
|
|
const subjectsToDelete = this.getNonEmptyItems(subjectsToDeleteAr);
|
|
|
|
const subjectsToAdd = this.getNonEmptyItems(subjectsToAddAr);
|
2023-03-09 15:30:13 +01:00
|
|
|
let requests = [];
|
|
|
|
if (subjectsToDelete.length > 0) {
|
|
|
|
requests.push(this._subjectsService.removeSubjects(
|
|
|
|
this.properties.communityAPI + this.communityId + '/' + type, subjectsToDelete))
|
|
|
|
}
|
|
|
|
if (subjectsToAdd.length > 0) {
|
|
|
|
requests.push(this._subjectsService.addSubjects(
|
|
|
|
this.properties.communityAPI + this.communityId + '/' + type, subjectsToAdd))
|
2022-07-04 14:13:33 +02:00
|
|
|
}
|
2023-03-09 15:30:13 +01:00
|
|
|
return requests;
|
2022-07-04 14:13:33 +02:00
|
|
|
}
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
2022-07-13 19:26:10 +02:00
|
|
|
handleUpdateError(message: string, error = null) {
|
|
|
|
if(error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
|
|
|
NotificationHandler.rise(message, 'danger');
|
2021-05-19 13:40:29 +02:00
|
|
|
this.showLoading = false;
|
|
|
|
}
|
|
|
|
|
2023-03-09 15:30:13 +01:00
|
|
|
afterUpdateActions(response, message: string) {
|
|
|
|
response.forEach(res => {
|
|
|
|
if (res.subjects) {
|
|
|
|
this.community.subjects = res.subjects;
|
|
|
|
} else if (res.sdg) {
|
|
|
|
this.community.sdg = res.sdg;
|
|
|
|
} else if (res.fos) {
|
|
|
|
this.community.fos = res.fos;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg);
|
2023-03-15 10:56:28 +01:00
|
|
|
this._clearCacheService.purgeBrowserCache("Subjects "+message, this.communityId);
|
2023-03-09 15:30:13 +01:00
|
|
|
NotificationHandler.rise('Subjects successfully ' + message + '!')
|
2018-10-30 16:31:16 +01:00
|
|
|
this.showLoading = false;
|
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
|
|
|
|
2018-10-30 16:31:16 +01:00
|
|
|
private getNonEmptyItems(data: string[]): string[] {
|
2021-05-19 13:40:29 +02:00
|
|
|
const length = data.length;
|
|
|
|
const arrayNonEmpty = new Array<string>();
|
|
|
|
let j = 0;
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
|
|
if (this.isEmpty(data[i])) {
|
|
|
|
} else if (this.isNonEmpty(data[i])) {
|
|
|
|
arrayNonEmpty[j] = data[i];
|
|
|
|
j++;
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
}
|
|
|
|
return arrayNonEmpty;
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
|
|
|
|
2018-10-30 16:31:16 +01:00
|
|
|
private isEmpty(data: string): boolean {
|
2021-05-19 13:40:29 +02:00
|
|
|
if (data !== undefined && !data.replace(/\s/g, '').length) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
2021-05-19 13:40:29 +02:00
|
|
|
|
2018-10-30 16:31:16 +01:00
|
|
|
private isNonEmpty(data: string): boolean {
|
2021-05-19 13:40:29 +02:00
|
|
|
if (data !== undefined && data != null) {
|
2018-10-30 16:31:16 +01:00
|
|
|
return true;
|
2021-05-19 13:40:29 +02:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2018-10-30 16:31:16 +01:00
|
|
|
}
|
|
|
|
}
|