@7365admin1/layer-common 1.11.13 → 1.11.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 1.11.14
4
+
5
+ ### Patch Changes
6
+
7
+ - f0184df: updates
8
+
3
9
  ## 1.11.13
4
10
 
5
11
  ### Patch Changes
@@ -162,6 +162,7 @@ const emit = defineEmits(["saved", "close"]);
162
162
 
163
163
  const props = defineProps({
164
164
  action: { type: String, default: "checkIn" }, // "checkIn" or "checkOut"
165
+ serviceType: { type: String, default: "" },
165
166
  });
166
167
 
167
168
  const formRef = ref<any>(null);
@@ -386,6 +387,10 @@ const submit = async () => {
386
387
  payload[props.action].img = imageId;
387
388
  }
388
389
 
390
+ if (props.serviceType) {
391
+ payload[props.action].serviceType = props.serviceType;
392
+ }
393
+
389
394
  emit("saved", payload);
390
395
 
391
396
  close();
@@ -146,6 +146,7 @@ const showDialog = defineModel({ type: Boolean, default: false });
146
146
 
147
147
  const props = defineProps({
148
148
  attendanceId: { type: String, default: "" },
149
+ serviceType: { type: String, default: "" },
149
150
  });
150
151
 
151
152
  const emit = defineEmits(["close"]);
@@ -365,7 +365,7 @@ const onSubmit = async () => {
365
365
  payload.isGeofencingEnabled = false;
366
366
  }
367
367
 
368
- await updateAttendanceSettings(props.site, payload);
368
+ await updateAttendanceSettings(props.site, payload, props.serviceType);
369
369
  await getAttendanceSettingsRefresh();
370
370
 
371
371
  showSnackbar("Settings updated successfully");
@@ -62,6 +62,7 @@
62
62
  <AttendanceCheckInOutDialog
63
63
  v-model="dialogShowForm"
64
64
  :action="currentAction"
65
+ :serviceType="props.serviceType"
65
66
  @saved="onAttendanceSaved"
66
67
  @close="dialogShowForm = false"
67
68
  />
@@ -69,6 +70,7 @@
69
70
  <AttendanceDetailsDialog
70
71
  v-model="dialogShowMoreActions"
71
72
  :attendance-id="selectedAttendanceId"
73
+ :serviceType="props.serviceType"
72
74
  @close="dialogShowMoreActions = false"
73
75
  />
74
76
 
@@ -82,6 +84,7 @@ import { useAttendancePermission } from "../composables/useAttendancePermission"
82
84
  const props = defineProps({
83
85
  orgId: { type: String, default: "" },
84
86
  site: { type: String, default: "" },
87
+ serviceType: { type: String, default: "" },
85
88
  });
86
89
 
87
90
  const { canViewOwnAttendance, canCheckInOut, canViewAttendanceDetails } =
@@ -151,6 +154,7 @@ const {
151
154
  page: page.value,
152
155
  search: searchInput.value,
153
156
  site: props.site,
157
+ serviceType: props.serviceType,
154
158
  }),
155
159
  {
156
160
  watch: [page, searchInput, () => props.site],
@@ -53,7 +53,7 @@
53
53
  <v-autocomplete
54
54
  :items="
55
55
  localTemplateList.filter(
56
- (item) => !['All', 'Manually Added'].includes(item.name),
56
+ (item) => !['All', 'Manually Added'].includes(item.name)
57
57
  )
58
58
  "
59
59
  item-title="name"
@@ -69,9 +69,9 @@
69
69
  Select template
70
70
  <span class="text-red font-weight-bold">*</span>
71
71
  </template>
72
- <template v-slot:append-item>
72
+ <!-- <template v-slot:append-item>
73
73
  <div v-intersect="endIntersectTemplateList" />
74
- </template>
74
+ </template> -->
75
75
  </v-autocomplete>
76
76
  </v-col>
77
77
  </v-row>
@@ -833,57 +833,57 @@ watch(
833
833
  () => props.templateList,
834
834
  (newVal) => {
835
835
  localTemplateList.value = newVal;
836
- },
836
+ }
837
837
  );
838
838
 
839
839
  // interset start
840
840
 
841
841
  // const page = ref(1); // replace with your actual page value
842
- const totalNumberOfPagesTemplateList = ref(1); // replace with your actual total number of pages value
843
-
844
- const endIntersectTemplateList = async (isIntersecting) => {
845
- await getTemplateNameLists(page.value);
846
- if (isIntersecting && !isFetchingTemplates.value) {
847
- page.value += 1;
848
- await getTemplateNameLists(page.value);
849
- }
850
- };
851
-
852
- const getTemplateNameLists = async (page = 1, query = "") => {
853
- isFetchingTemplates.value = true;
854
-
855
- const result = await getTemplatesByPageSearch({
856
- sites: [route.params.site as string],
857
- limit: 10,
858
- page: page,
859
- statuses: ["active"],
860
- search: query,
861
- });
862
-
863
- totalNumberOfPagesTemplateList.value = result?.pages;
864
- if (result?.items.length) {
865
- const newItems = result?.items.map((item) => ({
866
- _id: item._id,
867
- name: item.name,
868
- prefixPass: item.prefixPass,
869
- prefixKey: item.prefixKey,
870
- }));
871
-
872
- if (page === 1) {
873
- newItems.unshift({ _id: null, name: "All" });
874
- newItems.push({ _id: "Manually Added", name: "Manually Added" });
875
- }
876
-
877
- // Only add new items if they don't already exist in the list
878
- newItems.forEach((newItem) => {
879
- if (!localTemplateList.value.find((item) => item._id === newItem._id)) {
880
- localTemplateList.value.push(newItem);
881
- }
882
- });
883
- }
884
-
885
- isFetchingTemplates.value = false;
886
- };
842
+ // const totalNumberOfPagesTemplateList = ref(1); // replace with your actual total number of pages value
843
+
844
+ // const endIntersectTemplateList = async (isIntersecting) => {
845
+ // await getTemplateNameLists(page.value);
846
+ // if (isIntersecting && !isFetchingTemplates.value) {
847
+ // page.value += 1;
848
+ // await getTemplateNameLists(page.value);
849
+ // }
850
+ // };
851
+
852
+ // const getTemplateNameLists = async (page = 1, query = "") => {
853
+ // isFetchingTemplates.value = true;
854
+
855
+ // const result = await getTemplatesByPageSearch({
856
+ // sites: [route.params.site as string],
857
+ // limit: 10,
858
+ // page: page,
859
+ // statuses: ["active"],
860
+ // search: query,
861
+ // });
862
+
863
+ // totalNumberOfPagesTemplateList.value = result?.pages;
864
+ // if (result?.items.length) {
865
+ // const newItems = result?.items.map((item) => ({
866
+ // _id: item._id,
867
+ // name: item.name,
868
+ // prefixPass: item.prefixPass,
869
+ // prefixKey: item.prefixKey,
870
+ // }));
871
+
872
+ // if (page === 1) {
873
+ // newItems.unshift({ _id: null, name: "All" });
874
+ // newItems.push({ _id: "Manually Added", name: "Manually Added" });
875
+ // }
876
+
877
+ // // Only add new items if they don't already exist in the list
878
+ // newItems.forEach((newItem) => {
879
+ // if (!localTemplateList.value.find((item) => item._id === newItem._id)) {
880
+ // localTemplateList.value.push(newItem);
881
+ // }
882
+ // });
883
+ // }
884
+
885
+ // isFetchingTemplates.value = false;
886
+ // };
887
887
 
888
888
  const searchTemplate = async (query) => {
889
889
  isFetchingTemplates.value = true;
@@ -999,7 +999,7 @@ watch(
999
999
  }
1000
1000
  }
1001
1001
  },
1002
- { immediate: true },
1002
+ { immediate: true }
1003
1003
  );
1004
1004
 
1005
1005
  const router = useRouter();
@@ -1031,7 +1031,7 @@ const printContent = () => {
1031
1031
  if (printOrientation == "KeyCard") {
1032
1032
  localStorage.setItem(
1033
1033
  "selectedKeysToPrint",
1034
- JSON.stringify(selectedKeysToPrint.value),
1034
+ JSON.stringify(selectedKeysToPrint.value)
1035
1035
  );
1036
1036
  }
1037
1037
 
@@ -1083,14 +1083,14 @@ watch(selectedChoicePaperSizeOrientation, async (newVal: any) => {
1083
1083
  resultKeys2.value.sort(
1084
1084
  (firstItem: { value: string }, secondItem: { value: string }) => {
1085
1085
  const numericValueOfFirstItem = Number(
1086
- firstItem.value.replace(/\D/g, ""),
1086
+ firstItem.value.replace(/\D/g, "")
1087
1087
  );
1088
1088
  const numericValueOfSecondItem = Number(
1089
- secondItem.value.replace(/\D/g, ""),
1089
+ secondItem.value.replace(/\D/g, "")
1090
1090
  );
1091
1091
 
1092
1092
  return numericValueOfFirstItem - numericValueOfSecondItem;
1093
- },
1093
+ }
1094
1094
  );
1095
1095
 
1096
1096
  startRange.value = props.start.toString();
@@ -1107,7 +1107,7 @@ watch(startRange, (newVal: any, oldVal: any) => {
1107
1107
 
1108
1108
  const endRangeKeys = computed(() => {
1109
1109
  return resultKeys2.value.filter(
1110
- (item: any) => item.value >= startRange.value,
1110
+ (item: any) => item.value >= startRange.value
1111
1111
  );
1112
1112
  });
1113
1113
  const message = ref("");
@@ -1127,7 +1127,7 @@ const showSnackbarEndRange = () => {
1127
1127
  ? "Please select a start range first."
1128
1128
  : `No ${tab.value == "key" ? "Key" : "Pass"} found. Please try to
1129
1129
  generate first.`,
1130
- "error",
1130
+ "error"
1131
1131
  );
1132
1132
  }
1133
1133
  };
@@ -57,7 +57,7 @@ export default function useAttendance() {
57
57
  );
58
58
  }
59
59
 
60
- function getAttendanceSettings(site: string, serviceType: string) {
60
+ function getAttendanceSettings(site: string, serviceType: string = "") {
61
61
  return useNuxtApp().$api<TAttendanceSettings>(
62
62
  `/api/attendance-settings/site/${site}`,
63
63
  {
@@ -69,13 +69,14 @@ export default function useAttendance() {
69
69
 
70
70
  function updateAttendanceSettings(
71
71
  site: string,
72
- payload: TAttendanceSettings
72
+ payload: TAttendanceSettings,
73
+ serviceType: string = ""
73
74
  ) {
74
75
  return useNuxtApp().$api<Record<string, any>>(
75
76
  `/api/attendance-settings/site/${site}`,
76
77
  {
77
78
  method: "PUT",
78
- body: payload,
79
+ body: { ...payload, serviceType },
79
80
  }
80
81
  );
81
82
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.11.13",
5
+ "version": "1.11.14",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {