From 2ace99efe82eae88a78376d600e382ab759edf0a Mon Sep 17 00:00:00 2001 From: Jesse Washburn <142361664+jessewashburn@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:45:06 -0500 Subject: [PATCH 1/3] teams: smoother resources handling (fixes #8072) (#8078) Co-authored-by: dogi --- package.json | 6 +++--- .../dialogs/dialogs-add-resources.component.html | 2 +- .../shared/dialogs/dialogs-add-resources.component.ts | 11 +++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d5c756aa8a..f2cbdad6a1 100755 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.16.55", + "version": "0.16.56", "myplanet": { - "latest": "v0.21.96", - "min": "v0.20.96" + "latest": "v0.21.99", + "min": "v0.20.99" }, "scripts": { "ng": "ng", diff --git a/src/app/shared/dialogs/dialogs-add-resources.component.html b/src/app/shared/dialogs/dialogs-add-resources.component.html index b56c029b15..fa189446c6 100644 --- a/src/app/shared/dialogs/dialogs-add-resources.component.html +++ b/src/app/shared/dialogs/dialogs-add-resources.component.html @@ -10,5 +10,5 @@ OR - + diff --git a/src/app/shared/dialogs/dialogs-add-resources.component.ts b/src/app/shared/dialogs/dialogs-add-resources.component.ts index 2e5ae0fbb0..d17aa4c862 100644 --- a/src/app/shared/dialogs/dialogs-add-resources.component.ts +++ b/src/app/shared/dialogs/dialogs-add-resources.component.ts @@ -1,4 +1,4 @@ -import { Component, Inject, ViewChild, AfterViewInit } from '@angular/core'; +import { Component, Inject, ViewChild, AfterViewInit, ChangeDetectorRef } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ResourcesComponent } from '../../resources/resources.component'; import { ResourcesAddComponent } from '../../resources/resources-add.component'; @@ -16,11 +16,13 @@ export class DialogsAddResourcesComponent implements AfterViewInit { okDisabled = true; updateResource = false; existingResource: any = {}; + isSubmitting = false; constructor( public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any, - private dialogsLoadingService: DialogsLoadingService + private dialogsLoadingService: DialogsLoadingService, + private cdr: ChangeDetectorRef ) { this.linkInfo = this.data.db ? { [this.data.db]: this.data.linkId } : undefined; if (this.data.resource) { @@ -32,9 +34,14 @@ export class DialogsAddResourcesComponent implements AfterViewInit { ngAfterViewInit() { this.initOkDisableChange(); + this.cdr.detectChanges(); } ok() { + if (this.isSubmitting) { + return; + } + this.isSubmitting = true; this.dialogsLoadingService.start(); switch (this.view) { case 'resources': From 46473e7869b83da7fdb2ae1b7730eb21c132a77e Mon Sep 17 00:00:00 2001 From: Jesse Washburn <142361664+jessewashburn@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:54:55 -0500 Subject: [PATCH 2/3] teams: smoother voices titles (fixes #8086)(fixes #8087) (#8089) Co-authored-by: dogi --- package.json | 2 +- src/app/news/news-list.component.ts | 2 +- src/app/shared/forms/planet-tag-input-dialog.component.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f2cbdad6a1..7bca8d8ea5 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.16.56", + "version": "0.16.57", "myplanet": { "latest": "v0.21.99", "min": "v0.20.99" diff --git a/src/app/news/news-list.component.ts b/src/app/news/news-list.component.ts index fb0b0cf5bd..daf1bf1d2c 100644 --- a/src/app/news/news-list.component.ts +++ b/src/app/news/news-list.component.ts @@ -22,7 +22,7 @@ import { dedupeShelfReduce } from '../shared/utils'; export class NewsListComponent implements OnChanges { @Input() items: any[] = []; - @Input() editSuccessMessage = $localize`News has been updated successfully.`; + @Input() editSuccessMessage = $localize`Message updated successfully.`; @Input() viewableBy = 'community'; @Input() viewableId: string; @Input() editable = true; diff --git a/src/app/shared/forms/planet-tag-input-dialog.component.ts b/src/app/shared/forms/planet-tag-input-dialog.component.ts index 418fdbbf44..35d967fb7d 100644 --- a/src/app/shared/forms/planet-tag-input-dialog.component.ts +++ b/src/app/shared/forms/planet-tag-input-dialog.component.ts @@ -223,10 +223,10 @@ export class PlanetTagInputDialogComponent { onNext: (data) => { this.data.initTags(); this.deleteDialog.close(); - this.planetMessageService.showMessage($localize`Tag deleted: ${tag.name}`); + this.planetMessageService.showMessage($localize`Collection deleted: ${tag.name}`); this.resetValidationAndCheck(this.addTagForm); }, - onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this tag.`) + onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this collection.`) }; } From 5c195345034fc454ffd53711ee00ff38678ae48b Mon Sep 17 00:00:00 2001 From: Jesse Washburn <142361664+jessewashburn@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:59:33 -0500 Subject: [PATCH 3/3] enterprises: smoother delete dialog (fixes #8083) (#8091) Co-authored-by: dogi --- package.json | 2 +- .../dialogs/dialogs-prompt.component.html | 1 + src/app/teams/teams.component.ts | 17 ++++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7bca8d8ea5..bc9b22e5d6 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.16.57", + "version": "0.16.58", "myplanet": { "latest": "v0.21.99", "min": "v0.20.99" diff --git a/src/app/shared/dialogs/dialogs-prompt.component.html b/src/app/shared/dialogs/dialogs-prompt.component.html index 456c4b973f..88b1c2e754 100644 --- a/src/app/shared/dialogs/dialogs-prompt.component.html +++ b/src/app/shared/dialogs/dialogs-prompt.component.html @@ -12,6 +12,7 @@ user {member} change {change} team {team} + enterprise {enterprise} task {task} certification {certification} event {event} diff --git a/src/app/teams/teams.component.ts b/src/app/teams/teams.component.ts index 9fdb471b82..db0f006ed1 100644 --- a/src/app/teams/teams.component.ts +++ b/src/app/teams/teams.component.ts @@ -195,7 +195,8 @@ export class TeamsComponent implements OnInit, AfterViewInit { this.teamsService.addTeamDialog(this.user._id, this.mode, { ...team, teamType }).subscribe(() => { this.getTeams(); const action = $localize`${team._id ? 'updated' : 'created'}`; - const msg = $localize`${toProperCase(this.mode)} ${action} successfully`; + const entityType = this.mode === 'enterprise' ? 'Enterprise' : 'Team'; + const msg = $localize`${entityType} ${action} successfully`; this.planetMessageService.showMessage(msg); }); } @@ -220,12 +221,13 @@ export class TeamsComponent implements OnInit, AfterViewInit { onNext: () => { this.leaveDialog.close(); this.teams.data = this.teamList(this.teams.data); - const msg = 'left'; - this.planetMessageService.showMessage($localize`You have ${msg} ${team.name}`); + const entityType = this.mode === 'enterprise' ? 'enterprise' : 'team'; + const msg = $localize`You have left ${entityType} ${team.name}`; + this.planetMessageService.showMessage(msg); }, }, changeType: 'leave', - type: 'team', + type: this.mode === 'enterprise' ? 'enterprise' : 'team', displayName: team.name } }); @@ -240,7 +242,7 @@ export class TeamsComponent implements OnInit, AfterViewInit { this.planetMessageService.showMessage($localize`You have deleted ${entityType} ${team.name}.`); this.removeTeamFromTable(team); }, - onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting this team.`) + onError: () => this.planetMessageService.showAlert($localize`There was a problem deleting this ${this.mode === 'enterprise' ? 'enterprise' : 'team'}.`) }; } @@ -249,7 +251,7 @@ export class TeamsComponent implements OnInit, AfterViewInit { data: { okClick: this.archiveTeam(team), changeType: 'delete', - type: 'team', + type: this.mode === 'enterprise' ? 'enterprise' : 'team', displayName: team.name } }); @@ -268,7 +270,8 @@ export class TeamsComponent implements OnInit, AfterViewInit { finalize(() => this.dialogsLoadingService.stop()) ).subscribe(() => { this.teams.data = this.teamList(this.teams.data); - this.planetMessageService.showMessage($localize`Request to join ${team.name} sent`); + const entityType = this.mode === 'enterprise' ? 'enterprise' : 'team'; + this.planetMessageService.showMessage($localize`Request to join ${entityType} ${team.name} sent`); }); }