@iservice365/layer-common 1.0.9 → 1.0.10

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.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 4cdf32b: Invitation form - revise app selection
8
+
3
9
  ## 1.0.9
4
10
 
5
11
  ### Patch Changes
@@ -48,14 +48,13 @@
48
48
  :items="roles"
49
49
  item-title="name"
50
50
  item-value="_id"
51
- :rules="[requiredRule]"
51
+ :rules="[requiredRule]"
52
52
  density="comfortable"
53
53
  ></v-autocomplete>
54
54
  </v-col>
55
55
  </v-row>
56
56
  </v-col>
57
57
 
58
-
59
58
  <v-col v-if="hasSite" cols="12">
60
59
  <v-row no-gutters>
61
60
  <InputLabel class="text-capitalize" title="Site" />
@@ -176,13 +175,13 @@ const props = defineProps({
176
175
  const emit = defineEmits(["cancel", "success", "success:create-more"]);
177
176
 
178
177
  const validForm = ref(false);
179
- const form = ref<HTMLFormElement | null>(null)
178
+ const form = ref<HTMLFormElement | null>(null);
180
179
  const app = computed(() => useRuntimeConfig().public.APP ?? "");
181
180
 
182
181
  const loading = reactive({
183
182
  submittingForm: false,
184
- verifyingEmail: false
185
- })
183
+ verifyingEmail: false,
184
+ });
186
185
 
187
186
  const invite = ref<Record<string, any>>({
188
187
  email: "",
@@ -203,27 +202,36 @@ if (props.mode === "edit") {
203
202
  }
204
203
 
205
204
  const { natureOfBusiness } = useLocal();
205
+ const { orgNature } = useLocalSetup();
206
206
 
207
207
  const apps = computed(() => {
208
208
  const items = [];
209
209
  items.unshift({ title: "Organization", value: "organization" });
210
210
 
211
- if (props.app === "security_agency") {
212
- items.push({ title: "Security Agency", value: "security_agency" });
211
+ const _org = "security_agency";
212
+
213
+ if (props.app === _org || orgNature.value === _org) {
214
+ items.push({ title: "Security Agency", value: _org });
213
215
  }
214
216
 
215
- if (props.app === "cleaning_agency") {
216
- items.push({ title: "Cleaning Agency", value: "cleaning_agency" });
217
+ const _cleaning = "cleaning_agency";
218
+
219
+ if (props.app === _cleaning || orgNature.value === _cleaning) {
220
+ items.push({ title: "Cleaning Agency", value: _cleaning });
217
221
  }
218
222
 
219
- if (props.app === "property_manager") {
220
- items.push({ title: "Property Manager", value: "property_manager" });
223
+ const _property = "property_manager";
224
+
225
+ if (props.app === _property || orgNature.value === _property) {
226
+ items.push({ title: "Property Manager", value: _property });
221
227
  }
222
228
 
223
- if (props.app === "mechanical_electrical_services") {
229
+ const _mechanical = "mechanical_electrical_services";
230
+
231
+ if (props.app === _mechanical || orgNature.value === _mechanical) {
224
232
  items.push({
225
233
  title: "Mechanical & Electrical Services",
226
- value: "mechanical_electrical_services",
234
+ value: _mechanical,
227
235
  });
228
236
  }
229
237
 
@@ -240,8 +248,7 @@ const { getAll: getAllCustomerSite } = useCustomerSite();
240
248
 
241
249
  const { data: siteData, refresh: refreshSiteData } = await useLazyAsyncData(
242
250
  "get-sites-by-org",
243
- async () => await getAllCustomerSite({ org: props.org, limit: 50 }),
244
- { }
251
+ async () => await getAllCustomerSite({ org: props.org, limit: 50 })
245
252
  );
246
253
 
247
254
  watchEffect(() => {
@@ -275,13 +282,12 @@ watchEffect(() => {
275
282
  }
276
283
  });
277
284
 
278
- function handleUpdateApp(value: string){
285
+ function handleUpdateApp(value: string) {
279
286
  invite.value.role = "";
280
287
  invite.value.site = "";
281
288
  refreshRoles();
282
289
  }
283
290
 
284
-
285
291
  const createMore = ref(false);
286
292
  const disable = ref(false);
287
293
 
@@ -296,14 +302,13 @@ function resetInvite() {
296
302
  message.value = "";
297
303
  }
298
304
 
299
- function handleUpdateSite(siteId: string){
300
- const obj = sites.value.find( x => x?.value === siteId)
301
- invite.value.siteName = obj?.title || ""
305
+ function handleUpdateSite(siteId: string) {
306
+ const obj = sites.value.find((x) => x?.value === siteId);
307
+ invite.value.siteName = obj?.title || "";
302
308
  }
303
309
 
304
310
  const { inviteUser } = useUser();
305
311
 
306
-
307
312
  async function submit() {
308
313
  loading.submittingForm = true;
309
314
  try {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iservice365/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.0.9",
5
+ "version": "1.0.10",
6
6
  "main": "./nuxt.config.ts",
7
7
  "scripts": {
8
8
  "dev": "nuxi dev .playground",