Skip to content

Commit

Permalink
teams: smoother reports dialogs (fixes #8084)(fixes #8085) (#8090)
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 15, 2025
1 parent 5c19534 commit 107f00e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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.58",
"version": "0.16.59",
"myplanet": {
"latest": "v0.21.99",
"min": "v0.20.99"
"latest": "v0.22.7",
"min": "v0.21.7"
},
"scripts": {
"ng": "ng",
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

0 comments on commit 107f00e

Please sign in to comment.