Skip to content

Commit

Permalink
teams: smoother resources handling (fixes #8072) (#8078)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
jessewashburn and dogi authored Jan 14, 2025
1 parent 3db52ef commit 2ace99e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
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

0 comments on commit 2ace99e

Please sign in to comment.