Skip to content

Commit 8a08cd6

Browse files
committed
[NAE-1740] Disable "create case" button, while case is creating
- fix - 🦄🦄🦄
1 parent 63edab0 commit 8a08cd6

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

projects/netgrif-components-core/src/lib/data-fields/i18n-field/i18n-divider-field/abstract-i18n-divider-field.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ export abstract class AbstractI18nDividerFieldComponent {
1919
}
2020
}
2121

22+
public isDividerLGBTQ(): boolean {
23+
if (this.dividerPropertyEnabled('dividerLGBTQ')) {
24+
return this.dividerI18nField.component.properties.dividerLGBTQ === 'true';
25+
}
26+
return false;
27+
}
28+
2229
public getDividerFontSize(): string {
2330
if (this.dividerPropertyEnabled('fontSize')) {
2431
return this.dividerI18nField.component.properties.fontSize + 'px';

projects/netgrif-components-core/src/lib/side-menu/content-components/new-case/abstract-new-case.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ export abstract class AbstractNewCaseComponent implements OnDestroy {
155155
this._caseResourceService.createCase(newCase)
156156
.subscribe(
157157
(response: EventOutcomeMessageResource) => {
158+
this.loadingSubmit.off();
158159
if (!!response.outcome) {
159-
this.loadingSubmit.off();
160160
this._snackBarService.openSuccessSnackBar(response.outcome.message === undefined
161161
? this._translate.instant('side-menu.new-case.createCase') + ' ' + newCase.title
162162
: response.outcome.message);
@@ -169,7 +169,6 @@ export abstract class AbstractNewCaseComponent implements OnDestroy {
169169
data: (response.outcome as CreateCaseEventOutcome).aCase
170170
});
171171
} else if (!!response.error) {
172-
this.loadingSubmit.off();
173172
this._snackBarService.openWarningSnackBar(this._translate.instant('side-menu.new-case.createCaseError') + ' ' + newCase.title);
174173
this._sideMenuControl.close({
175174
opened: false,
@@ -179,7 +178,10 @@ export abstract class AbstractNewCaseComponent implements OnDestroy {
179178
});
180179
}
181180
},
182-
error => this._snackBarService.openErrorSnackBar(error.message ? error.message : error)
181+
error => {
182+
this.loadingSubmit.off();
183+
this._snackBarService.openErrorSnackBar(error.message ? error.message : error);
184+
}
183185
);
184186
}
185187
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<div fxFlex fxLayout="row" fxLayoutAlign="center center">
22
<div fxFlex="20" class="divider-line"
3-
[ngClass]="{'primary-background-color': !dividerPropertyEnabled('dividerColor')}"
3+
[ngClass]="{'divider-line-lgbt': isDividerLGBTQ(), 'primary-background-color': !dividerPropertyEnabled('dividerColor')}"
44
[ngStyle]="dividerPropertyEnabled('dividerColor') && {'background': getDividerColor()}"></div>
55
<span [ngClass]="{'margin-default': dividerI18nField.value.defaultValue !== ''}"
66
[ngStyle]="dividerPropertyEnabled('fontSize') && {'font-size': getDividerFontSize()}">
77
{{dividerI18nField.value.defaultValue}}
88
</span>
99
<div fxFlex class="divider-line"
10-
[ngClass]="{'primary-background-color': !dividerPropertyEnabled('dividerColor')}"
10+
[ngClass]="{'divider-line-lgbt': isDividerLGBTQ(), 'primary-background-color': !dividerPropertyEnabled('dividerColor')}"
1111
[ngStyle]="dividerPropertyEnabled('dividerColor') && {'background': getDividerColor()}"></div>
1212
</div>
13+

projects/netgrif-components/src/lib/data-fields/i18n-field/i18n-divider-field/i18n-divider-field.component.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,32 @@
66
margin-right: 8px;
77
margin-left: 8px;
88
}
9+
10+
.divider-line-lgbt {
11+
height: 2px;
12+
background: linear-gradient(to right,
13+
#B827FC 0%,
14+
#2C90FC 20%,
15+
#B8FD33 40%,
16+
#FEC837 60%,
17+
#FD1892 80%,
18+
#B827FC 100%)
19+
-0% 0/150% 100%;
20+
animation: move-divider-line-lgbt 10s linear infinite;
21+
-webkit-animation: move-divider-line-lgbt 10s linear infinite;
22+
}
23+
24+
@keyframes move-divider-line-lgbt {
25+
to {
26+
background-position: -1500% 0%
27+
}
28+
}
29+
30+
@-webkit-keyframes move-divider-line-lgbt {
31+
to {
32+
background-position: -1500% 0%
33+
}
34+
}
35+
36+
37+

0 commit comments

Comments
 (0)