diff --git a/package.json b/package.json index 683659b0b7..fc020b2c9c 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.15.39", + "version": "0.15.40", "myplanet": { "latest": "v0.20.90", "min": "v0.19.90" diff --git a/src/app/community/community-link-dialog.component.ts b/src/app/community/community-link-dialog.component.ts index 049f839c23..5483e4986f 100644 --- a/src/app/community/community-link-dialog.component.ts +++ b/src/app/community/community-link-dialog.component.ts @@ -6,6 +6,7 @@ import { CustomValidators } from '../validators/custom-validators'; import { TeamsService } from '../teams/teams.service'; import { switchMap } from 'rxjs/operators'; import { ValidatorService } from '../validators/validator.service'; +import { PlanetMessageService } from '../shared/planet-message.service'; @Component({ templateUrl: './community-link-dialog.component.html', @@ -25,6 +26,7 @@ export class CommunityLinkDialogComponent { @Inject(MAT_DIALOG_DATA) public data: any, private fb: FormBuilder, private teamsService: TeamsService, + private planetMessageService: PlanetMessageService, private validatorService: ValidatorService ) { this.linkForm = this.fb.group({ @@ -50,10 +52,17 @@ export class CommunityLinkDialogComponent { } linkSubmit() { + const linkTitle = this.linkForm.get('title')?.value; this.teamsService.createServicesLink(this.linkForm.value).pipe( switchMap(() => this.data.getLinks()) - ).subscribe(() => { - this.dialogRef.close(); + ).subscribe({ + next: () => { + this.dialogRef.close(); + this.planetMessageService.showMessage(`${linkTitle} added successfully`); + }, + error: () => { + this.planetMessageService.showAlert(`Error adding link`); + } }); } diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 479df194d3..2865a9bbe6 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -327,10 +327,15 @@ export class CommunityComponent implements OnInit, OnDestroy { this.teamsService.updateTeam({ ...this.team, description: description.text }).pipe( finalize(() => this.dialogsLoadingService.stop()) ).subscribe(newTeam => { + const previousDescription = Boolean(this.team.description); this.team = newTeam; this.servicesDescriptionLabel = newTeam.description ? 'Edit' : 'Add'; + const msg = newTeam.description + ? (previousDescription ? $localize`Description edited` : $localize`Description added`) + : $localize`Description deleted`; + this.dialogsFormService.closeDialogsForm(); + this.planetMessageService.showMessage(msg); }); - this.dialogsFormService.closeDialogsForm(); }; this.dialogsFormService.openDialogsForm( this.team.description ? $localize`Edit Description` : $localize`Add Description`,