Skip to content

Commit

Permalink
remove another flex-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
iJungleboy committed Sep 25, 2024
1 parent 2301ffa commit ec96a7b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,18 @@ export class EditDialogMainComponent extends BaseComponent implements OnInit, Af
}

#snackBarYouHaveUnsavedChanges() {
const snackBarData: UnsavedChangesSnackBarData = {
save: false,
};
const snackBarRef = this.snackBar.openFromComponent(SnackBarUnsavedChangesComponent, {
data: snackBarData,
data: {
save: false,
} satisfies UnsavedChangesSnackBarData,
duration: 5000,
});

snackBarRef.onAction().subscribe(() => {
if ((snackBarRef.containerInstance.snackBarConfig.data as UnsavedChangesSnackBarData).save) {
if ((snackBarRef.containerInstance.snackBarConfig.data as UnsavedChangesSnackBarData).save)
this.saveAll(true);
} else {
else
this.closeDialog(true);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<span class="error-message">{{ 'Errors.UnsavedChanges' | translate }}</span>
<!-- The message -->
<span class="error-message">
{{ 'Errors.UnsavedChanges' | translate }}
</span>

<div fxLayoutAlign="end end">
<!-- The save / exit buttons -->
<div class="my-flex-right">
<button mat-button color="primary" (click)="saveChanges(false)">
{{ 'General.Buttons.NotSave' | translate | uppercase }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.error-message {
font-size: 14px;
}

.my-flex-right {
display: flex;
justify-content: end;
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { Component, Inject } from '@angular/core';
import { MatSnackBarRef, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
import { UnsavedChangesSnackBarData } from './snack-bar-unsaved-changes.models';
import { TranslateModule } from '@ngx-translate/core';
import { UpperCasePipe } from '@angular/common';
import { Component, Inject } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { FlexModule } from '@angular/flex-layout/flex';
import { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar';
import { TranslateModule } from '@ngx-translate/core';
import { UnsavedChangesSnackBarData } from './snack-bar-unsaved-changes.models';

@Component({
selector: 'app-snack-bar-unsaved-changes',
templateUrl: './snack-bar-unsaved-changes.component.html',
styleUrls: ['./snack-bar-unsaved-changes.component.scss'],
standalone: true,
imports: [
FlexModule,
MatButtonModule,
UpperCasePipe,
TranslateModule,
UpperCasePipe
],
selector: 'app-snack-bar-unsaved-changes',
templateUrl: './snack-bar-unsaved-changes.component.html',
styleUrls: ['./snack-bar-unsaved-changes.component.scss'],
standalone: true,
imports: [
MatButtonModule,
UpperCasePipe,
TranslateModule,
UpperCasePipe
],
})
export class SnackBarUnsavedChangesComponent {
constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { logSpecsStateAdapter, StateAdapter } from "./state-adapter";
import { Injectable } from '@angular/core';
import { classLog } from "../../../../shared/logging";
import { logSpecsStateAdapter, StateAdapter } from "./state-adapter";
import { StateUiMapperNoop } from './state-ui-mapper-noop';

@Injectable()
export class StateAdapterEntity extends StateAdapter {

log = classLog({StateAdapterEntity}, logSpecsStateAdapter, true);
log = classLog({StateAdapterEntity}, logSpecsStateAdapter);

constructor() { super(); }

Expand Down

0 comments on commit ec96a7b

Please sign in to comment.