* Feedback message on error saving dataset.
* Unsubscribe backend calls on dashboard component destroy.
This commit is contained in:
Kristian Ntavidi 2021-07-09 13:03:09 +03:00
parent 6e21ad127d
commit cce9df8eb7
14 changed files with 52 additions and 2 deletions

View File

@ -78,7 +78,9 @@ export class DraftsComponent extends BaseComponent implements OnInit {
const dmpDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 5, { fields: fields });
dmpDataTableRequest.criteria = new DatasetCriteria();
dmpDataTableRequest.criteria.status = DmpStatus.Draft;
this.datasetService.getPaged(dmpDataTableRequest).subscribe(response => {
this.datasetService.getPaged(dmpDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.datasetDrafts = response.data;
this.totalCount = response.totalCount;
this.totalCountDraftDatasets.emit(this.datasetDrafts.length);
@ -314,7 +316,9 @@ export class DraftsComponent extends BaseComponent implements OnInit {
dmpDataTableRequest.criteria = new DatasetCriteria();
dmpDataTableRequest.criteria.status = DmpStatus.Draft;
dmpDataTableRequest.criteria.like = this.formGroup.get("like").value;
this.datasetService.getPaged(dmpDataTableRequest).subscribe(response => {
this.datasetService.getPaged(dmpDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.datasetDrafts = response.data;
this.totalCount = response.totalCount;
this.totalCountDraftDatasets.emit(this.datasetDrafts.length);

View File

@ -100,6 +100,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
allDataTableRequest.criteria.order = this.formGroup.get('order').value;
this.dashboardService
.getRecentActivity(allDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.allRecentActivities = response;
this.allRecentActivities.forEach(recentActivity => {
@ -123,6 +124,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
const allDataTableRequest = this.setPublicDataTableRequest();
this.dashboardService
.getRecentActivity(allDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.allRecentActivities = response;
this.allRecentActivities.forEach(recentActivity => {
@ -619,6 +621,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
allDataTableRequest.criteria.order = this.formGroup.get("order").value;
this.dashboardService
.getRecentActivity(allDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.allRecentActivities = response;
this.allRecentActivities.forEach(recentActivity => {

View File

@ -77,6 +77,7 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
datasetDataTableRequest.criteria.like = "";
this.datasetService
.getPaged(datasetDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.datasetActivities = response.data;
this.totalCount = response.totalCount;
@ -130,6 +131,7 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
}
this.datasetService
.getPaged(datasetDataTableRequest)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.datasetActivities = response.data;
this.totalCount = response.totalCount;

View File

@ -90,6 +90,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
dmpDataTableRequest.criteria.like = "";
this.dmpService
.getPaged(dmpDataTableRequest, "listing")
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.dmpActivities = response.data;
this.totalCount = response.totalCount;

View File

@ -8,6 +8,7 @@ import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from "rxjs/operators";
@Component({
selector: "app-recent-visited-activity",
@ -38,6 +39,7 @@ export class RecentVisitedActivityComponent extends BaseComponent
dmpDataTableRequest.criteria.like = "";
this.dmpService
.getPaged(dmpDataTableRequest, "listing")
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
this.dmpActivities = response.data;
});

View File

@ -854,6 +854,12 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
}
onCallbackError(error: any) {
const errmes = error && error.message? error.message as string : null;
let feedbackMessage = this.language.instant('DATASET-EDITOR.ERRORS.ERROR-OCCURED');
if(errmes){
feedbackMessage += errmes;
}
this.uiNotificationService.snackBarNotification(feedbackMessage, SnackBarNotificationLevel.Warning);
this.setErrorModel(error.error);
}

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Die Versionierung ist automatisiert.",
"QUESTION": "Es scheint, dass Ihre Vorlage der Datensatzbeschreibung veraltet ist. Möchten Sie sie auf die neueste Version aktualisieren?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occured.",
"MESSAGE": "Message: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Versioning is automated.",
"QUESTION": "It seems your Dataset Template is outdated. Do you want to update it to the latest version?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occured.",
"MESSAGE": "Message: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Versionado es automático.",
"QUESTION": "Parece que su plantilla de descripción del dataset está desactualizada. ¿Queire actualizarla a la última versión?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occured.",
"MESSAGE": "Message: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Η δημιουργία νέας έκδοσης συμβαίνει αυτόματα",
"QUESTION": "Το Template το Συνόλου Δεδομένων που επιλέξατε χρειάζεται επικαιροποίηση. Θα θέλατε να το ενημερώσετε στην πιο πρόσφατη έκδοσή του;"
},
"ERRORS":{
"ERROR-OCCURED": "Προέκυψε κάποιο σφάλμα.",
"MESSAGE": "Μήνυμα: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "O versionamento é automático.",
"QUESTION": "O seu modelo de dados está desatualizado. Pretende atualizá-lo de acordo com a última versão?"
},
"ERRORS":{
"ERROR-OCCURED": "Um erro ocorreu.",
"MESSAGE": "Mensangem: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Verziovanie je automatizované.",
"QUESTION": "Zdá sa, že Vaša šablóna súboru dát je zastaraná. Chcete ju aktualizovať na najnovšiu verziu?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occured.",
"MESSAGE": "Message: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Verzionisanje je automatsko.",
"QUESTION": "Izgleda da je obrazac za skup podataka zastareo. Da li želite da koristite najnoviju verziju?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occured.",
"MESSAGE": "Message: "
}
},
"DATASET-CREATE-WIZARD": {

View File

@ -1228,6 +1228,10 @@
"VERSION-DIALOG": {
"ABOUT": "Sürüm Otomatiktir.",
"QUESTION": "Veri Seti Şablonunuz güncel değil. Son sürüme güncellenmesini ister misiniz?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occured.",
"MESSAGE": "Message: "
}
},
"DATASET-CREATE-WIZARD": {