Skip to content

Commit

Permalink
Merge branch 'master' into 8093-calendar-legend-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Jan 15, 2025
2 parents c29a386 + 107f00e commit e678a63
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"license": "AGPL-3.0",
"version": "0.16.60",
"myplanet": {
"latest": "v0.21.96",
"min": "v0.20.96"
"latest": "v0.22.7",
"min": "v0.21.7"
},
"scripts": {
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion src/app/news/news-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
<span class="margin-lr-8" i18n>OR</span>
</ng-container>
<button mat-raised-button mat-dialog-close i18n>Cancel</button>
<button color="primary" mat-raised-button [disabled]="okDisabled" (click)="ok()" i18n>OK</button>
<button color="primary" mat-raised-button [disabled]="okDisabled || isSubmitting" (click)="ok()" i18n>OK</button>
</mat-dialog-actions>
11 changes: 9 additions & 2 deletions src/app/shared/dialogs/dialogs-add-resources.component.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -16,11 +16,13 @@ export class DialogsAddResourcesComponent implements AfterViewInit {
okDisabled = true;
updateResource = false;
existingResource: any = {};
isSubmitting = false;

constructor(
public dialogRef: MatDialogRef<DialogsAddResourcesComponent>,
@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) {
Expand All @@ -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':
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/dialogs/dialogs-prompt.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
user {member}
change {change}
team {team}
enterprise {enterprise}
task {task}
certification {certification}
event {event}
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/forms/planet-tag-input-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`)
};
}

Expand Down
12 changes: 11 additions & 1 deletion src/app/teams/teams-reports.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { tap } from 'rxjs/operators';
import { convertUtcDate } from './teams.utils';
import { CsvService } from '../shared/csv.service';
import { StateService } from '../shared/state.service';
import { PlanetMessageService } from '../shared/planet-message.service';

@Component({
selector: 'planet-teams-reports',
Expand All @@ -38,6 +39,7 @@ export class TeamsReportsComponent implements DoCheck {
private csvService: CsvService,
private elementRef: ElementRef,
private stateService: StateService,
private planetMessageService: PlanetMessageService,
) {}

ngDoCheck() {
Expand Down Expand Up @@ -76,6 +78,8 @@ export class TeamsReportsComponent implements DoCheck {
disableIfInvalid: true,
onSubmit: (newReport) => this.updateReport(oldReport, newReport).subscribe(() => {
this.dialogsFormService.closeDialogsForm();
const action = isEdit ? 'edited' : 'added';
this.planetMessageService.showMessage(`Report ${action}`);
})
}
);
Expand All @@ -87,11 +91,17 @@ export class TeamsReportsComponent implements DoCheck {
data: {
changeType: 'delete',
type: 'report',
displayDates: report,
displayName: `${$localize`Report from`} ${new Date(report.startDate).toLocaleDateString('en-US', { timeZone: 'UTC' })} ${$localize`to`} ${new Date(report.endDate).toLocaleDateString('en-US', { timeZone: 'UTC' })}`,
okClick: {
request: this.updateReport(report),
onNext: () => {
this.planetMessageService.showMessage('Report deleted');
this.dialogsLoadingService.stop();
deleteDialog.close();
},
onError: () => {
this.planetMessageService.showAlert('There was a problem deleting the report.');
this.dialogsLoadingService.stop();
}
},
isDateUtc: true
Expand Down
17 changes: 10 additions & 7 deletions src/app/teams/teams.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand All @@ -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
}
});
Expand All @@ -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'}.`)
};
}

Expand All @@ -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
}
});
Expand All @@ -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`);
});
}

Expand Down

0 comments on commit e678a63

Please sign in to comment.