@molochko-dev/data 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enums.d.ts +2 -1
- package/dist/enums.js +2 -1
- package/package.json +1 -1
- package/settings.service.ts +35 -0
- package/src/enums.ts +5 -4
package/dist/enums.d.ts
CHANGED
|
@@ -118,7 +118,8 @@ export declare enum EVENT_ERROR_REASON_ENUM {
|
|
|
118
118
|
statusNotAllowedDry = "animal-status-not-allowed-dry",
|
|
119
119
|
statusNotAllowedDnb = "animal-status-not-allowed-dnb",
|
|
120
120
|
statusNotAllowedSold = "animal-status-not-allowed-sold",
|
|
121
|
-
statusNotAllowedDied = "animal-status-not-allowed",
|
|
121
|
+
statusNotAllowedDied = "animal-status-not-allowed-died",
|
|
122
|
+
statusNotAllowedBred = "animal-status-not-allowed-bred",
|
|
122
123
|
statusForFirstRecheckBredOnly = "animal-status-for-first-recheck-bred-only",
|
|
123
124
|
notACow = "animal-not-a-cow",
|
|
124
125
|
tooYoung = "animal-too-young"
|
package/dist/enums.js
CHANGED
|
@@ -114,7 +114,8 @@ var EVENT_ERROR_REASON_ENUM;
|
|
|
114
114
|
EVENT_ERROR_REASON_ENUM["statusNotAllowedDry"] = "animal-status-not-allowed-dry";
|
|
115
115
|
EVENT_ERROR_REASON_ENUM["statusNotAllowedDnb"] = "animal-status-not-allowed-dnb";
|
|
116
116
|
EVENT_ERROR_REASON_ENUM["statusNotAllowedSold"] = "animal-status-not-allowed-sold";
|
|
117
|
-
EVENT_ERROR_REASON_ENUM["statusNotAllowedDied"] = "animal-status-not-allowed";
|
|
117
|
+
EVENT_ERROR_REASON_ENUM["statusNotAllowedDied"] = "animal-status-not-allowed-died";
|
|
118
|
+
EVENT_ERROR_REASON_ENUM["statusNotAllowedBred"] = "animal-status-not-allowed-bred";
|
|
118
119
|
EVENT_ERROR_REASON_ENUM["statusForFirstRecheckBredOnly"] = "animal-status-for-first-recheck-bred-only";
|
|
119
120
|
EVENT_ERROR_REASON_ENUM["notACow"] = "animal-not-a-cow";
|
|
120
121
|
EVENT_ERROR_REASON_ENUM["tooYoung"] = "animal-too-young";
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { NavigationEnd, Router } from '@angular/router';
|
|
3
|
+
import { LocalStorageService } from './local-storage.service';
|
|
4
|
+
|
|
5
|
+
@Injectable({
|
|
6
|
+
providedIn: 'root',
|
|
7
|
+
})
|
|
8
|
+
export class SettingsService {
|
|
9
|
+
isLoading = false;
|
|
10
|
+
|
|
11
|
+
constructor(private router: Router, private storage: LocalStorageService) {}
|
|
12
|
+
|
|
13
|
+
init(): void {
|
|
14
|
+
this.lastUrl();
|
|
15
|
+
this.urlHandler();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private urlHandler(): void {
|
|
19
|
+
this.router.events.subscribe((data) => {
|
|
20
|
+
if (data instanceof NavigationEnd) {
|
|
21
|
+
if (data.url.includes('page-not-found')) {
|
|
22
|
+
this.storage.remove('url');
|
|
23
|
+
}
|
|
24
|
+
this.storage.set('url', data.url);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private lastUrl(): void {
|
|
30
|
+
const url = this.storage.get<string>('url');
|
|
31
|
+
if (url && url.length) {
|
|
32
|
+
this.router.navigateByUrl(url).then();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/enums.ts
CHANGED
|
@@ -46,9 +46,9 @@ export const ANIMAL_GENDER_AS_OBJECT = enumToObject(ANIMAL_GENDER_ENUM);
|
|
|
46
46
|
|
|
47
47
|
export enum EVENT_TYPES_ENUM {
|
|
48
48
|
otel = 'otel', // ОТЕЛ
|
|
49
|
-
recheck = 'recheck', // ПЕРЕПРОВЕРИТЬ
|
|
49
|
+
recheck = 'recheck', // ПЕРЕПРОВЕРИТЬ *
|
|
50
50
|
ohota = 'ohota', // ОХОТА
|
|
51
|
-
osemenenie = 'osemenenie', // ОСЕМЕНЕНИЕ
|
|
51
|
+
osemenenie = 'osemenenie', // ОСЕМЕНЕНИЕ *
|
|
52
52
|
stelnaya = 'stelnaya', // СТЕЛЬНАЯ
|
|
53
53
|
yalovaya = 'yalovaya', // ЯЛОВАЯ (НЕ СТЕЛЬНАЯ)
|
|
54
54
|
stelneotpos = 'stelneotpos', // СТЕЛЬНАЯ НЕ ОТ ПОС ОСЕМЕНЕНИЯ
|
|
@@ -56,7 +56,7 @@ export enum EVENT_TYPES_ENUM {
|
|
|
56
56
|
kbiku = 'kbiku', // КБЫКУ
|
|
57
57
|
suhostoi = 'suhostoi', //'СУХОСТОЙ
|
|
58
58
|
abort = 'abort', // АБОРТ
|
|
59
|
-
neosem = 'neosem', // НЕОСЕМ (БРАК)
|
|
59
|
+
neosem = 'neosem', // НЕОСЕМ (БРАК) *
|
|
60
60
|
prodazha = 'prodazha', // ПРОДАЖА
|
|
61
61
|
pala = 'pala', // ПАЛА
|
|
62
62
|
zamenaNomera = 'zamenaNomera', // ЗАМЕНА НОМЕРА
|
|
@@ -123,7 +123,8 @@ export enum EVENT_ERROR_REASON_ENUM {
|
|
|
123
123
|
statusNotAllowedDry = 'animal-status-not-allowed-dry',
|
|
124
124
|
statusNotAllowedDnb = 'animal-status-not-allowed-dnb',
|
|
125
125
|
statusNotAllowedSold = 'animal-status-not-allowed-sold',
|
|
126
|
-
statusNotAllowedDied = 'animal-status-not-allowed',
|
|
126
|
+
statusNotAllowedDied = 'animal-status-not-allowed-died',
|
|
127
|
+
statusNotAllowedBred = 'animal-status-not-allowed-bred',
|
|
127
128
|
statusForFirstRecheckBredOnly = 'animal-status-for-first-recheck-bred-only',
|
|
128
129
|
notACow = 'animal-not-a-cow',
|
|
129
130
|
tooYoung = 'animal-too-young'
|