hl-core 0.0.10-beta.5 → 0.0.10-beta.50

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.
Files changed (41) hide show
  1. package/README.md +0 -2
  2. package/api/base.api.ts +327 -137
  3. package/api/interceptors.ts +3 -5
  4. package/components/Dialog/Dialog.vue +5 -1
  5. package/components/Form/DigitalDocument.vue +52 -0
  6. package/components/Form/FormSource.vue +30 -0
  7. package/components/Form/ManagerAttachment.vue +60 -11
  8. package/components/Form/ProductConditionsBlock.vue +12 -6
  9. package/components/Input/Datepicker.vue +5 -0
  10. package/components/Input/FileInput.vue +1 -1
  11. package/components/Input/FormInput.vue +5 -0
  12. package/components/Input/OtpInput.vue +25 -0
  13. package/components/Input/RoundedInput.vue +2 -0
  14. package/components/Input/RoundedSelect.vue +2 -0
  15. package/components/Input/TextAreaField.vue +71 -0
  16. package/components/Menu/MenuNav.vue +1 -1
  17. package/components/Pages/Anketa.vue +207 -176
  18. package/components/Pages/ContragentForm.vue +1 -1
  19. package/components/Pages/Documents.vue +436 -64
  20. package/components/Pages/MemberForm.vue +343 -170
  21. package/components/Pages/ProductConditions.vue +895 -241
  22. package/components/Panel/PanelHandler.vue +282 -124
  23. package/components/Utilities/Chip.vue +1 -1
  24. package/components/Utilities/JsonViewer.vue +1 -2
  25. package/composables/classes.ts +121 -20
  26. package/composables/constants.ts +45 -1
  27. package/composables/index.ts +333 -8
  28. package/composables/styles.ts +8 -24
  29. package/configs/pwa.ts +1 -7
  30. package/layouts/clear.vue +1 -1
  31. package/layouts/default.vue +1 -1
  32. package/layouts/full.vue +1 -1
  33. package/locales/ru.json +82 -19
  34. package/nuxt.config.ts +10 -12
  35. package/package.json +12 -12
  36. package/plugins/head.ts +7 -1
  37. package/store/data.store.ts +867 -525
  38. package/store/member.store.ts +17 -6
  39. package/store/rules.ts +23 -3
  40. package/types/enum.ts +40 -2
  41. package/types/index.ts +110 -56
@@ -1,10 +1,11 @@
1
1
  import { useDisplay } from 'vuetify';
2
- import jwt_decode from 'jwt-decode';
2
+ import { jwtDecode as jwt_decode } from 'jwt-decode';
3
3
  import { XMLParser } from 'fast-xml-parser';
4
4
  import { AxiosError } from 'axios';
5
5
  import { DocumentReaderApi, Scenario, TextFieldType, LCID } from '@regulaforensics/document-reader-webclient';
6
- import { PolicyholderClass } from '../composables/classes';
7
- import type { EnvModes, NestedKeyOf, ResponseStructure } from '../types';
6
+ import { PolicyholderClass, Value, User } from '../composables/classes';
7
+ import type { EnvModes, NestedKeyOf, Projects, ResponseStructure, Utils, RouteType } from '../types';
8
+ import { Roles, Statuses } from '../types/enum';
8
9
 
9
10
  export const useEnv = () => {
10
11
  return {
@@ -17,7 +18,8 @@ export const useEnv = () => {
17
18
 
18
19
  export class Masks {
19
20
  numbers: string = '#*';
20
- otp: string = '# # # #';
21
+ otp: string = '####';
22
+ otpSixDigit: string = '######';
21
23
  spacedNumbers: string = '### ### ### ### ### ### ###';
22
24
  iin: string = '###-###-###-###';
23
25
  phone: string = '+7 (7##) ### ## ##';
@@ -87,6 +89,29 @@ export const reformatDate = (date: string) => {
87
89
  }
88
90
  };
89
91
 
92
+ export const reformatDateWithHours = (date: string) => {
93
+ if (date) {
94
+ const data = new Date(date);
95
+ let day: string | number = data.getDate();
96
+ let month: string | number = data.getMonth() + 1;
97
+ let hour: string | number = data.getHours();
98
+ let minute: string | number = data.getMinutes();
99
+ if (month < 10) {
100
+ month = '0' + month;
101
+ }
102
+ if (day < 10) {
103
+ day = '0' + day;
104
+ }
105
+ if (minute < 10) {
106
+ minute = '0' + minute;
107
+ }
108
+ const year = data.getFullYear();
109
+ return `${day}.${month}.${year} - ${hour}:${minute}`;
110
+ } else {
111
+ return null;
112
+ }
113
+ };
114
+
90
115
  export const reformatIin = (iin: string) => {
91
116
  if (!!iin) {
92
117
  const matched = iin.match(/.{1,3}/g);
@@ -102,13 +127,22 @@ export const formatPhone = (phone: string) => {
102
127
 
103
128
  export const cleanWhiteSpace = (str: string) => String(str).replace(/\s+/g, '');
104
129
 
105
- export const jwtDecode = (token: string): any => {
106
- if (token) return jwt_decode(token);
130
+ export const jwtDecode = (token?: string | null) => {
131
+ if (token) return jwt_decode<Utils.JwtToken>(token);
107
132
  else return null;
108
133
  };
109
134
 
110
135
  export const isValidToken = (token: string) => {
111
- return (new Date(jwtDecode(token).exp * 1000).getTime() - Date.now()) / 1000 > 0;
136
+ try {
137
+ if (token) {
138
+ const decoded = jwtDecode(token);
139
+ return !!decoded && (new Date(Number(decoded.exp) * 1000).getTime() - Date.now()) / 1000 > 0;
140
+ }
141
+ return false;
142
+ } catch (err) {
143
+ console.log(err);
144
+ return false;
145
+ }
112
146
  };
113
147
 
114
148
  export const isValidGUID = (value: string) => {
@@ -147,8 +181,16 @@ export const parseProcents = (val: string | number) => (val ? Number(((val as nu
147
181
 
148
182
  export const formatProcents = (val: string | number) => (val ? Number(((val as number) / 100).toFixed(2)) : Number(val));
149
183
 
184
+ export const formatSpacedNumber = (val: any) => ((!isNaN(val) && val !== null) || typeof val === 'string' ? Number(String(val).replace(/\s/g, '')) : 0);
185
+
150
186
  export const sanitizeURL = (text: string) => (text ? text.replace(/\r?\n|\r|\\|"/g, '') : '');
151
187
 
188
+ export const sanitize = (text: string) =>
189
+ String(text)
190
+ .replace(/\r?\n|\r/g, '')
191
+ .replace(/\\/g, '')
192
+ .replace(/"/g, '');
193
+
152
194
  export const yearEnding = (number: number, titles: string[], cases: number[]) => {
153
195
  return titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[number % 10 < 5 ? number % 10 : 5]];
154
196
  };
@@ -274,6 +316,7 @@ export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean)
274
316
  if (beneficiary.id === 0) {
275
317
  beneficiary.registrationCity = new Value();
276
318
  beneficiary.registrationCountry = new Value();
319
+ beneficiary.birthPlace = new Value();
277
320
  beneficiary.registrationMicroDistrict = '';
278
321
  beneficiary.registrationNumberApartment = '';
279
322
  beneficiary.registrationNumberApartment = '';
@@ -296,6 +339,13 @@ export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean)
296
339
  const city = dataStore.cities.find(i => i.nameRu === cityName.replace('г.', ''));
297
340
  beneficiary.registrationCity = city ?? new Value();
298
341
  }
342
+ const contragentData = beneficiary.response.contragent;
343
+ if (contragentData) {
344
+ const country = dataStore.countries.find((i: Value) => i.nameRu?.match(new RegExp(contragentData.birthPlace, 'i')));
345
+ beneficiary.birthPlace = country ?? new Value();
346
+ } else {
347
+ beneficiary.birthPlace = new Value();
348
+ }
299
349
  const province = dataStore.states.find(i => i.ids === benAddress[0].stateCode);
300
350
  const localityType = dataStore.localityTypes.find(i => i.nameRu === benAddress[0].cityTypeName);
301
351
  const region = dataStore.regions.find(i => i.ids == benAddress[0].regionCode);
@@ -333,6 +383,7 @@ export const setAddressInsured = (whichIndex: number, sameAddress: boolean) => {
333
383
  if (insured.id === 0) {
334
384
  insured.registrationCity = new Value();
335
385
  insured.registrationCountry = new Value();
386
+ insured.birthPlace = new Value();
336
387
  insured.registrationMicroDistrict = '';
337
388
  insured.registrationNumberApartment = '';
338
389
  insured.registrationNumberApartment = '';
@@ -355,6 +406,13 @@ export const setAddressInsured = (whichIndex: number, sameAddress: boolean) => {
355
406
  const city = dataStore.cities.find(i => i.nameRu === cityName.replace('г.', ''));
356
407
  insured.registrationCity = city ?? new Value();
357
408
  }
409
+ const contragentData = insured.response.contragent;
410
+ if (contragentData) {
411
+ const country = dataStore.countries.find((i: Value) => i.nameRu?.match(new RegExp(contragentData.birthPlace, 'i')));
412
+ insured.birthPlace = country ?? new Value();
413
+ } else {
414
+ insured.birthPlace = new Value();
415
+ }
358
416
  const province = dataStore.states.find(i => i.ids === benAddress[0].stateCode);
359
417
  const localityType = dataStore.localityTypes.find(i => i.nameRu === benAddress[0].cityTypeName);
360
418
  const region = dataStore.regions.find(i => i.ids == benAddress[0].regionCode);
@@ -410,7 +468,8 @@ type WhichValuePerEnv =
410
468
  | 'efoBaseApi'
411
469
  | 'efoBaseApiLocal'
412
470
  | 'amlBaseApi'
413
- | 'amlBaseApiLocal';
471
+ | 'amlBaseApiLocal'
472
+ | 'lkaUrl';
414
473
 
415
474
  export const getStrValuePerEnv = (which: WhichValuePerEnv) => {
416
475
  const valuesPerEnv: {
@@ -473,6 +532,11 @@ export const getStrValuePerEnv = (which: WhichValuePerEnv) => {
473
532
  development: 'http://aml-dev.halyklife.nb/api',
474
533
  test: 'http://aml-dev.halyklife.nb/api',
475
534
  },
535
+ lkaUrl: {
536
+ production: '/#/efo',
537
+ development: '/#/efo',
538
+ test: '/#/efo',
539
+ },
476
540
  };
477
541
  return valuesPerEnv[which][import.meta.env.VITE_MODE as EnvModes];
478
542
  };
@@ -491,6 +555,83 @@ export const getMainPageRoute = () => {
491
555
  return 'index';
492
556
  };
493
557
 
558
+ export const validateToken = (to: RouteType) => {
559
+ const dataStore = useDataStore();
560
+ if (to.query) {
561
+ if ('token' in to.query) {
562
+ const token = to.query.token as string;
563
+ if (isValidToken(token)) {
564
+ localStorage.setItem('accessToken', token);
565
+ dataStore.accessToken = token;
566
+ dataStore.getUserRoles();
567
+ }
568
+ } else {
569
+ const token = localStorage.getItem('accessToken') || null;
570
+ if (token && isValidToken(token)) {
571
+ dataStore.accessToken = token;
572
+ dataStore.getUserRoles();
573
+ } else {
574
+ dataStore.sendToParent(constants.postActions.toHomePage, dataStore.t('toaster.tokenExpire'));
575
+ }
576
+ }
577
+ }
578
+ };
579
+
580
+ export const validateRoute = (to: RouteType) => {
581
+ const dataStore = useDataStore();
582
+ const token = localStorage.getItem('accessToken') || null;
583
+ if (to && to.meta && 'requiresAuth' in to.meta && to.meta.requiresAuth && (!token || (token && isValidToken(token) === false))) {
584
+ localStorage.clear();
585
+ dataStore.sendToParent(constants.postActions.toHomePage, dataStore.t('toaster.tokenExpire'));
586
+ }
587
+ };
588
+
589
+ export const validateSettingsPanel = () => {
590
+ const dataStore = useDataStore();
591
+ const formStore = useFormStore();
592
+ const hasPanelItem = (id: string) => {
593
+ return !!Object.values(dataStore.settings.items).find(i => i.id === id);
594
+ };
595
+ // Bug in getApplicationData, if there is empty member it didn't update
596
+ // if (!hasPanelItem('reload') && route.params.taskId !== '0') {
597
+ // dataStore.settings.items.push(
598
+ // new MenuItem({
599
+ // id: 'reload',
600
+ // title: dataStore.t('buttons.reload'),
601
+ // icon: 'mdi-reload',
602
+ // action: async () => await dataStore.getApplicationData(route.params.taskId),
603
+ // }),
604
+ // );
605
+ // }
606
+ if (!hasPanelItem('reject') && dataStore.isInitiator()) {
607
+ dataStore.settings.items.push(
608
+ new MenuItem({
609
+ id: 'reject',
610
+ title: dataStore.t('buttons.cancelApplication'),
611
+ icon: 'mdi-close',
612
+ action: () => (dataStore.panelAction = constants.actions.rejectclient),
613
+ show: computed(() => dataStore.isTask() && dataStore.isProcessCancel(formStore.applicationData.statusCode)),
614
+ }),
615
+ );
616
+ }
617
+ if (!hasPanelItem('return') && (dataStore.isInitiator() || dataStore.isUnderwriter())) {
618
+ dataStore.settings.items.push(
619
+ new MenuItem({
620
+ id: 'return',
621
+ title: dataStore.t('buttons.returnStatement'),
622
+ icon: 'mdi-restore',
623
+ action: () => (dataStore.panelAction = constants.actions.return),
624
+ show: computed(() => dataStore.isTask() && dataStore.isProcessReturnable(formStore.applicationData.statusCode)),
625
+ }),
626
+ );
627
+ }
628
+ };
629
+
630
+ export const isIframe = () => {
631
+ if (window.location.hostname !== 'localhost' && useEnv().isProduction) return window.self !== window.top;
632
+ return true;
633
+ };
634
+
494
635
  export const keyDeleter = <T extends object>(data: T, keys: Array<NestedKeyOf<T>>) => {
495
636
  if (typeof data === 'object' && !!data && keys && Array.isArray(keys) && keys.length) {
496
637
  keys.forEach(key => {
@@ -610,3 +751,187 @@ export const isEveryFormDisabled = (isDisabledForm: any) => {
610
751
  };
611
752
 
612
753
  export class ApiError extends AxiosError<any, any> {}
754
+
755
+ export class ProcessController {
756
+ isProcessEditable = (statusCode?: keyof typeof Statuses) => {
757
+ const getEditibleStatuses = () => {
758
+ const defaultStatuses = constants.editableStatuses;
759
+ return defaultStatuses;
760
+ };
761
+ return !!getEditibleStatuses().find(status => status === statusCode);
762
+ };
763
+ isProcessReturnable = (statusCode?: keyof typeof Statuses) => {
764
+ const getReturnableStatuses = () => {
765
+ const defaultStatuses = constants.returnStatementStatuses;
766
+ return defaultStatuses;
767
+ };
768
+ return !!getReturnableStatuses().find(status => status === statusCode);
769
+ };
770
+ isProcessCancel = (statusCode?: keyof typeof Statuses) => {
771
+ const getCanceleStatuses = () => {
772
+ const defaultStatuses = constants.cancelApplicationStatuses;
773
+ return defaultStatuses;
774
+ };
775
+ return !!getCanceleStatuses().find(status => status === statusCode);
776
+ };
777
+ isProcessReject = (statusCode?: keyof typeof Statuses) => {
778
+ const getRejectStatuses = () => {
779
+ const defaultStatuses = constants.rejectApplicationStatuses;
780
+ return defaultStatuses;
781
+ };
782
+ return !!getRejectStatuses().find(status => status === statusCode);
783
+ };
784
+ }
785
+
786
+ export class RoleController {
787
+ user: User = new User();
788
+
789
+ isRole = (whichRole: keyof typeof Roles) => {
790
+ if (this.user.roles.length === 0) {
791
+ const token = localStorage.getItem('accessToken') || null;
792
+ if (token) {
793
+ const decoded = jwtDecode(token);
794
+ if (decoded) {
795
+ this.user.id = String(decoded.sub);
796
+ this.user.fullName = `${decoded.lastName} ${decoded.firstName} ${decoded.middleName ?? ''}`;
797
+ this.user.code = decoded.code;
798
+ this.user.branchCode = decoded.branchCode;
799
+ const key = getKeyWithPattern(decoded, 'role');
800
+ if (key) {
801
+ const roles = decoded[key as keyof Utils.JwtToken];
802
+ if (typeof roles === 'string') {
803
+ this.user.roles.push(roles);
804
+ } else if (typeof roles === 'object') {
805
+ this.user.roles = roles;
806
+ }
807
+ }
808
+ }
809
+ }
810
+ }
811
+ return !!this.user.roles.find(i => i === whichRole);
812
+ };
813
+ isInitiator = (productFromExternal?: string) => {
814
+ const env = useEnv();
815
+ const dataStore = useDataStore();
816
+ const hasAccessByProduct = (() => {
817
+ const product = productFromExternal as Projects;
818
+ if (dataStore.isLifetrip || product === 'lifetrip') return this.isBranchDirector() || this.isTravelAgent();
819
+ if (dataStore.isPension || product === 'pensionannuitynew') return this.isBranchDirector() || this.isExecutor();
820
+ if (dataStore.isLifeBusiness || product === 'lifebusiness') return this.isHeadManager() || this.isBranchDirector();
821
+ if (dataStore.isCritical || product === 'criticalillness') return this.isBranchDirector();
822
+ return false;
823
+ })();
824
+ return this.isManager() || this.isAgent() || this.isAgentMycar() || this.isManagerHalykBank() || this.isServiceManager() || this.isAgentAuletti() || hasAccessByProduct;
825
+ };
826
+ isManager = () => this.isRole(constants.roles.Manager);
827
+ isCompliance = () => this.isRole(constants.roles.Compliance);
828
+ isAdmin = () => this.isRole(constants.roles.Admin);
829
+ isJurist = () => this.isRole(constants.roles.Jurist);
830
+ isAgent = () => this.isRole(constants.roles.Agent);
831
+ isManagerHalykBank = () => this.isRole(constants.roles.ManagerHalykBank);
832
+ isServiceManager = () => this.isRole(constants.roles.ServiceManager);
833
+ isUSNSsanctioner = () => this.isRole(constants.roles.USNSsanctioner);
834
+ isUnderwriter = () => this.isRole(constants.roles.Underwriter);
835
+ isActuary = () => this.isRole(constants.roles.Actuary);
836
+ isAgentMycar = () => this.isRole(constants.roles.AgentMycar);
837
+ isAgentAuletti = () => this.isRole(constants.roles.AgentAuletti);
838
+ isManagerAuletti = () => this.isRole(constants.roles.ManagerAuletti);
839
+ isAnalyst = () => this.isRole(constants.roles.Analyst);
840
+ isUpk = () => this.isRole(constants.roles.UPK);
841
+ isUrp = () => this.isRole(constants.roles.URP);
842
+ isUsns = () => this.isRole(constants.roles.USNS);
843
+ isAccountant = () => this.isRole(constants.roles.Accountant);
844
+ isDrn = () => this.isRole(constants.roles.DRNSJ);
845
+ isSupport = () => this.isRole(constants.roles.Support);
846
+ isFinCenter = () => this.isRole(constants.roles.FinCenter);
847
+ isSupervisor = () => this.isRole(constants.roles.Supervisor);
848
+ isHeadManager = () => this.isRole(constants.roles.HeadManager);
849
+ isBranchDirector = () => this.isRole(constants.roles.BranchDirector);
850
+ isUSNSACCINS = () => this.isRole(constants.roles.USNSACCINS);
851
+ isDsuio = () => this.isRole(constants.roles.Dsuio);
852
+ isHeadDso = () => this.isRole(constants.roles.HEADDSO);
853
+ isAdjuster = () => this.isRole(constants.roles.SettlementLosses);
854
+ isHeadAdjuster = () => this.isRole(constants.roles.HeadSettlementLosses);
855
+ isDsoDirector = () => this.isRole(constants.roles.DsoDirector);
856
+ isArchivist = () => this.isRole(constants.roles.Archivist);
857
+ isAccountantDirector = () => this.isRole(constants.roles.AccountantDirector);
858
+ isHeadOfDso = () => this.isRole(constants.roles.HeadOfDso);
859
+ isUrsp = () => this.isRole(constants.roles.URSP);
860
+ isExecutor = () => this.isRole(constants.roles.ExecutorGPH);
861
+ isDsuioOrv = () => this.isRole(constants.roles.DsuioOrv);
862
+ isUKP = () => this.isRole(constants.roles.UKP);
863
+ isDpDirector = () => this.isRole(constants.roles.DpDirector);
864
+ isSecurity = () => this.isRole(constants.roles.Security);
865
+ isURAP = () => this.isRole(constants.roles.URAP);
866
+ isTravelAgent = () => this.isRole(constants.roles.TravelAgent);
867
+ isHR = () => this.isRole(constants.roles.HR);
868
+ hasAccess = () => {
869
+ const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn() || this.isDsuioOrv();
870
+ return {
871
+ invoiceInfo: this.isAdmin() || this.isSupport(),
872
+ toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
873
+ toLKAv2: this.isHR() || baseAccessRoles,
874
+ toAML: this.isCompliance() || baseAccessRoles,
875
+ toAULETTI: this.isAgentAuletti() || this.isManagerAuletti() || baseAccessRoles,
876
+ toLKA_A: this.isAgentAuletti() || baseAccessRoles,
877
+ toUU:
878
+ this.isDsuio() ||
879
+ this.isActuary() ||
880
+ this.isUSNSACCINS() ||
881
+ this.isServiceManager() ||
882
+ this.isAccountant() ||
883
+ this.isAdjuster() ||
884
+ this.isHeadAdjuster() ||
885
+ this.isArchivist() ||
886
+ this.isSecurity() ||
887
+ baseAccessRoles,
888
+ toDSO:
889
+ this.isDsuio() ||
890
+ this.isActuary() ||
891
+ this.isHeadOfDso() ||
892
+ this.isAccountant() ||
893
+ this.isUSNSACCINS() ||
894
+ this.isDsoDirector() ||
895
+ this.isServiceManager() ||
896
+ this.isUSNSsanctioner() ||
897
+ this.isAccountantDirector() ||
898
+ baseAccessRoles,
899
+ toEFO:
900
+ this.isManager() ||
901
+ this.isAgent() ||
902
+ this.isAgentMycar() ||
903
+ this.isManagerHalykBank() ||
904
+ this.isHeadManager() ||
905
+ this.isServiceManager() ||
906
+ this.isUSNSsanctioner() ||
907
+ this.isUnderwriter() ||
908
+ this.isActuary() ||
909
+ this.isCompliance() ||
910
+ this.isUpk() ||
911
+ this.isFinCenter() ||
912
+ this.isSupervisor() ||
913
+ this.isUrp() ||
914
+ this.isUsns() ||
915
+ this.isJurist() ||
916
+ this.isAccountant() ||
917
+ this.isBranchDirector() ||
918
+ this.isUSNSACCINS() ||
919
+ this.isDsuio() ||
920
+ this.isAdjuster() ||
921
+ this.isDsoDirector() ||
922
+ this.isAccountantDirector() ||
923
+ this.isHeadAdjuster() ||
924
+ this.isHeadOfDso() ||
925
+ this.isUrsp() ||
926
+ this.isExecutor() ||
927
+ this.isArchivist() ||
928
+ this.isUKP() ||
929
+ this.isDpDirector() ||
930
+ this.isSecurity() ||
931
+ this.isURAP() ||
932
+ this.isTravelAgent() ||
933
+ this.isHR() ||
934
+ baseAccessRoles,
935
+ };
936
+ };
937
+ }
@@ -15,24 +15,13 @@ export class Styles {
15
15
  blueTextLight: string = 'text-[#F3F6FC]';
16
16
 
17
17
  // Green
18
- greenBg: string =
19
- import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
20
- ? 'bg-[#DEBE8C]'
21
- : 'bg-[#009C73]';
22
- greenBgHover: string =
23
- import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
24
- ? 'bg-[#C19B5F]'
25
- : 'hover:bg-[#00a277]';
26
- greenBgLight: string =
27
- import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
28
- ? 'bg-[#e8d2af]'
29
- : 'bg-[#EAF6EF]';
18
+ greenBg: string = String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#DEBE8C]' : 'bg-[#009C73]';
19
+ greenBgHover: string = String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#C19B5F]' : 'hover:bg-[#00a277]';
20
+ greenBgLight: string = String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#e8d2af]' : 'bg-[#EAF6EF]';
30
21
  greenText: string = '!text-[#009C73]';
31
22
  greenTextHover: string = 'hover:text-[#009C73]';
32
23
  greenBgLightHover: string =
33
- import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
34
- ? 'hover:bg-[#efdfc6]'
35
- : 'hover:bg-[#dbf0e4]';
24
+ String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'hover:bg-[#efdfc6]' : 'hover:bg-[#dbf0e4]';
36
25
 
37
26
  // Yellow
38
27
  yellowText: string = '!text-[#FAB31C]';
@@ -65,7 +54,7 @@ export class Styles {
65
54
  blueBorder: string = 'border-[1px] border-[#A0B3D8]';
66
55
  blueLightBorder: string = 'border-[1px] border-[#F3F6FC]';
67
56
  greenBorder: string =
68
- import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
57
+ String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti'
69
58
  ? 'border-[1px] border-[#DEBE8C]'
70
59
  : 'border-[1px] border-[#009C73]';
71
60
  redBorder: string = 'border-[1px] border-[#FD2D39]';
@@ -91,9 +80,9 @@ export class Styles {
91
80
  greenLightBtn: string;
92
81
 
93
82
  // Complex
94
- flexColNav: string;
95
- emptyBlockCol: string;
96
- scrollPage: string;
83
+ flexColNav: string = 'flex flex-col gap-[10px] px-2 pt-[14px]';
84
+ emptyBlockCol: string = 'w-[60px] sm:w-[100px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
85
+ scrollPage: string = 'max-h-[85svh] overflow-y-scroll';
97
86
  flexCenter: string = 'flex items-center justify-center';
98
87
 
99
88
  // Muted or disabled
@@ -111,11 +100,6 @@ export class Styles {
111
100
  this.whiteBorderBtn = ` ${this.blackText} ${this.textTitle} ${this.rounded} w-full ${this.blueLightBgHover} border-[#A0B3D8] border-[1px]`;
112
101
  this.blueLightBtn = `${this.blueBgLight} ${this.greyTextLight} ${this.textTitle} ${this.rounded} w-full ${this.blueBgLightHover}`;
113
102
  this.greenLightBtn = `${this.greenBgLight} ${this.greenText} ${this.textTitle} ${this.rounded} w-full ${this.greenBgLightHover}`;
114
-
115
- // Complex
116
- this.flexColNav = 'flex flex-col gap-[10px] px-2 pt-[14px]';
117
- this.emptyBlockCol = 'w-[60px] sm:w-[100px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
118
- this.scrollPage = 'max-h-[85svh] overflow-y-scroll';
119
103
  }
120
104
  }
121
105
 
package/configs/pwa.ts CHANGED
@@ -3,7 +3,7 @@ import type { ModuleOptions } from '@vite-pwa/nuxt';
3
3
  export const pwaBaseConfig: Partial<ModuleOptions> = {
4
4
  registerType: 'autoUpdate',
5
5
  workbox: {
6
- globPatterns: ['**/*.{js,css,html,txt,png,ico,svg}'],
6
+ globPatterns: ['**/*.{js,css,html,txt,png,ico,svg,json}'],
7
7
  navigateFallbackDenylist: [/^\/api\//],
8
8
  navigateFallback: '/',
9
9
  cleanupOutdatedCaches: true,
@@ -54,10 +54,4 @@ export const pwaBaseConfig: Partial<ModuleOptions> = {
54
54
  },
55
55
  registerWebManifestInRouteRules: true,
56
56
  writePlugin: true,
57
- devOptions: {
58
- enabled: true,
59
- suppressWarnings: true,
60
- navigateFallback: '/',
61
- type: 'module',
62
- },
63
57
  };
package/layouts/clear.vue CHANGED
@@ -8,7 +8,7 @@ const { $pwa } = useNuxtApp();
8
8
 
9
9
  const onInit = async () => {
10
10
  const projectConfig = dataStore.projectConfig;
11
- if (!useEnv().isProduction && process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
11
+ if (process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
12
12
  const hasConfig = await dataStore.getProjectConfig();
13
13
  if (hasConfig === true) {
14
14
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
@@ -52,7 +52,7 @@ const onBack = async (item: MenuItem) => {
52
52
 
53
53
  const onInit = async () => {
54
54
  const projectConfig = dataStore.projectConfig;
55
- if (!useEnv().isProduction && process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
55
+ if (process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
56
56
  const hasConfig = await dataStore.getProjectConfig();
57
57
  if (hasConfig === true) {
58
58
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
package/layouts/full.vue CHANGED
@@ -11,7 +11,7 @@ const { $pwa } = useNuxtApp();
11
11
 
12
12
  const onInit = async () => {
13
13
  const projectConfig = dataStore.projectConfig;
14
- if (!useEnv().isProduction && process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
14
+ if (process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
15
15
  const hasConfig = await dataStore.getProjectConfig();
16
16
  if (hasConfig === true) {
17
17
  const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);