@simitgroup/simpleapp-generator 1.0.59 → 1.0.60

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 (96) hide show
  1. package/dist/buildinschemas/branch.d.ts.map +1 -1
  2. package/dist/buildinschemas/branch.js +1 -0
  3. package/dist/buildinschemas/branch.js.map +1 -1
  4. package/dist/buildinschemas/organization.d.ts.map +1 -1
  5. package/dist/buildinschemas/organization.js +1 -0
  6. package/dist/buildinschemas/organization.js.map +1 -1
  7. package/dist/buildinschemas/permission.js +1 -1
  8. package/dist/buildinschemas/permission.js.map +1 -1
  9. package/dist/buildinschemas/user.d.ts.map +1 -1
  10. package/dist/buildinschemas/user.js +4 -1
  11. package/dist/buildinschemas/user.js.map +1 -1
  12. package/dist/framework.js +1 -1
  13. package/dist/framework.js.map +1 -1
  14. package/dist/generate.js +6 -1
  15. package/dist/generate.js.map +1 -1
  16. package/dist/type.d.ts +1 -0
  17. package/dist/type.d.ts.map +1 -1
  18. package/docs/jsonschema.md +1 -0
  19. package/package.json +1 -1
  20. package/src/buildinschemas/branch.ts +1 -0
  21. package/src/buildinschemas/organization.ts +1 -0
  22. package/src/buildinschemas/permission.ts +1 -1
  23. package/src/buildinschemas/user.ts +4 -1
  24. package/src/framework.ts +1 -1
  25. package/src/generate.ts +6 -1
  26. package/src/type.ts +1 -0
  27. package/templates/basic/nest/controller.ts.eta +5 -3
  28. package/templates/basic/nest/model.ts.eta +32 -7
  29. package/templates/basic/nuxt/pages.crud.vue.eta +59 -163
  30. package/templates/basic/nuxt/pages.index.vue.eta +225 -0
  31. package/templates/nest/.env._eta +1 -0
  32. package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +1 -1
  33. package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +1 -1
  34. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +127 -22
  35. package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +1 -1
  36. package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +25 -2
  37. package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +20 -2
  38. package/templates/nest/src/simpleapp/services/branch.service.ts.eta +41 -40
  39. package/templates/nest/src/simpleapp/services/user.service.ts.eta +10 -9
  40. package/templates/nuxt/app.vue.eta +2 -1
  41. package/templates/nuxt/assets/css/style.css._eta +3 -12
  42. package/templates/nuxt/assets/primevue/passthrough.ts._eta +24 -20
  43. package/templates/nuxt/components/ButtonCreateTenant.vue.eta +30 -23
  44. package/templates/nuxt/components/ButtonHome.vue.eta +15 -2
  45. package/templates/nuxt/components/ButtonMenuPicker.vue.eta +5 -20
  46. package/templates/nuxt/components/ButtonPermissionInfo.vue.eta +5 -7
  47. package/templates/nuxt/components/ButtonProfile.vue.eta +42 -25
  48. package/templates/nuxt/components/CrudSimple.vue.eta +1 -1
  49. package/templates/nuxt/components/EventDecision.vue.eta +115 -0
  50. package/templates/nuxt/components/EventNotification.vue.eta +157 -0
  51. package/templates/nuxt/components/HeaderBar.vue.eta +2 -2
  52. package/templates/nuxt/components/Invitation.vue.eta +3 -3
  53. package/templates/nuxt/components/SelectBranch.vue.eta +5 -2
  54. package/templates/nuxt/components/SimpleAppDatatable.vue.eta +151 -5
  55. package/templates/nuxt/components/TenantPicker.vue.eta +75 -0
  56. package/templates/nuxt/components/UserProfileListItem.vue.eta +65 -0
  57. package/templates/nuxt/components/renderers/BooleanRender.vue.eta +7 -0
  58. package/templates/nuxt/components/renderers/DateRender.vue.eta +6 -0
  59. package/templates/nuxt/components/renderers/ForeignKeyRender.vue.eta +10 -0
  60. package/templates/nuxt/components/renderers/MoneyRender.vue.eta +7 -0
  61. package/templates/nuxt/components/renderers/MultiTextRender.vue.eta +11 -0
  62. package/templates/nuxt/composables/getDocument.generate.ts.eta +4 -0
  63. package/templates/nuxt/composables/getMenus.generate.ts.eta +35 -31
  64. package/templates/nuxt/composables/getUserStore.generate.ts.eta +6 -1
  65. package/templates/nuxt/composables/goTo.generate.ts.eta +15 -0
  66. package/templates/nuxt/composables/notifications.generate.ts.eta +21 -0
  67. package/templates/nuxt/composables/stringHelper.generate.ts.eta +11 -1
  68. package/templates/nuxt/error.vue._eta +20 -5
  69. package/templates/nuxt/layouts/documentlist.vue.eta +166 -0
  70. package/templates/nuxt/middleware/30.acl.global.ts.eta +4 -1
  71. package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +4 -4
  72. package/templates/nuxt/pages/[xorg]/profile.vue.eta +6 -0
  73. package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +6 -0
  74. package/templates/nuxt/pages/[xorg]/user/index.vue.eta +211 -377
  75. package/templates/nuxt/pages/[xorg]/user.vue.eta +197 -0
  76. package/templates/nuxt/pages/index.vue._eta +101 -0
  77. package/templates/nuxt/pages/profile.vue.eta +94 -0
  78. package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +4 -4
  79. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +11 -10
  80. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +69 -17
  81. package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +6 -3
  82. package/templates/nuxt/tailwind.config.ts._eta +10 -0
  83. package/templates/nuxt/types/documentlist.ts.eta +9 -0
  84. package/templates/nuxt/types/events.ts.eta +20 -0
  85. package/templates/nuxt/types/index.ts.eta +6 -79
  86. package/templates/nuxt/types/notifications.ts.eta +16 -0
  87. package/templates/nuxt/types/others.ts.eta +42 -0
  88. package/templates/nuxt/types/user.ts.eta +44 -0
  89. package/tsconfig.tsbuildinfo +1 -1
  90. package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +0 -52
  91. package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +0 -43
  92. package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +0 -56
  93. package/templates/nuxt/components/EventMonitor.vue.eta +0 -85
  94. package/templates/nuxt/pages/[xorg]/tenant/index.vue.eta +0 -89
  95. package/templates/nuxt/pages/index.vue.eta +0 -116
  96. package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +0 -11
@@ -1,89 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * This file was automatically generated by simpleapp everytime regenerate code.
4
- * delete file "delete-me-for-avoid-override" if you want to modify this file and
5
- * prevent regenerate code override it.
6
- * last change 2023-09-09
7
- * author: Ks Tan
8
- */
9
-
10
- import Column from "primevue/column";
11
- const { $TenantDoc } = useNuxtApp();
12
- const doc = $TenantDoc();
13
- const data = doc.getReactiveData();
14
- const columns = [
15
- '_id',
16
- 'tenantId',
17
- "tenantName",
18
- "description",
19
- "owner.label"
20
- /* skip system columns _id*/,
21
- /* skip system columns doctype*/
22
- /* skip system columns created*/
23
- /* skip system columns updated*/
24
- /* skip system columns createdby*/
25
- /* skip system columns updatedby*/
26
- /* skip system columns orgId*/
27
- /* skip system columns branchId*/
28
- ];
29
- //prepare subtable if exists
30
- /*
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- */
46
- //end
47
- </script>
48
- <template>
49
- <div>
50
- <CrudSimple
51
- :document="doc"
52
- title="Tenant"
53
- #default="o"
54
- :path="`/${useRoute().params.xorg}/tenant`"
55
- :listColumns="columns"
56
- >
57
-
58
- <SimpleAppText
59
- autofocus
60
- :setting="o.getField('#/properties/tenantName')"
61
- v-model="data.tenantName"
62
- />
63
-
64
- <SimpleAppCheckbox
65
- autofocus
66
- :setting="o.getField('#/properties/active')"
67
- v-model="data.active"
68
- />
69
-
70
- <SimpleAppText
71
- autofocus
72
- :setting="o.getField('#/properties/description')"
73
- v-model="data.description"
74
- />
75
-
76
- <SimpleAppAutocomplete
77
- :setting="o.getField('#/properties/owner')"
78
- v-model="data.owner"
79
- optionLabel="label"
80
- :remote-src="getAutocomplete('user')"
81
- />
82
- <SimpleAppNumber
83
- :readonly="true"
84
- :setting="o.getField('#/properties/tenantId')"
85
- v-model="data.tenantId"
86
- />
87
- </CrudSimple>
88
- </div>
89
- </template>
@@ -1,116 +0,0 @@
1
- <script lang="ts" setup>
2
- /**
3
- * This file was automatically generated by simpleapp generator. Every
4
- * MODIFICATION OVERRIDE BY GENERATEOR
5
- * last change 2023-10-28
6
- * Author: Ks Tan
7
- */
8
- import _ from "lodash";
9
- import InputText from "primevue/inputtext";
10
- import Dialog from "primevue/dialog";
11
- import { ref, Ref } from "vue";
12
- import { SimpleAppEventType } from "../simpleapp/generate/commons/events";
13
- import { TenantDoc } from "../simpleapp/docs/TenantDoc";
14
- import ProgressSpinner from "primevue/progressspinner";
15
- import Panel from "primevue/panel";
16
- import Card from "primevue/card";
17
- import { AxiosResponse } from "axios";
18
-
19
- const { $event, $listen, $userstore } = useNuxtApp();
20
- const branches = ref([]);
21
- const userprofile = ref();
22
- const orgList = ref();
23
-
24
- const loadProfile = async () => {
25
- await reloadUserStore();
26
- userprofile.value = getUserProfile();
27
- console.log("useprofile", userprofile.value);
28
-
29
- branches.value = userprofile.value.branches;
30
-
31
- orgList.value = _.uniqBy(branches.value, "branch.orgId").map((item) => ({
32
- orgId: item.branch.orgId,
33
- orgName: item.branch.organization.label,
34
- }));
35
- //.map((item)=>{return {orgId: item.organization.orgId,orgName:item.organization.Name}})
36
- console.log("user info.value", branches.value);
37
- console.log("org list .value", orgList.value);
38
- };
39
-
40
- $listen(SimpleAppEventType.InvitationAccepted, async () => {
41
- loadProfile();
42
- });
43
-
44
- onMounted(() => {
45
- loadProfile();
46
- });
47
-
48
- </script>
49
- <template>
50
- <div class="grid grid-cols-2">
51
- <DebugDocumentData v-model="userprofile" label="User"></DebugDocumentData>
52
- <Panel header="Create New Tenant">
53
- <div>
54
- <h1>Create new one?</h1>
55
- <ButtonCreateTenant></ButtonCreateTenant>
56
- </div>
57
- </Panel>
58
- <Panel header="Reserved">
59
- <div>
60
- <h1>reserved fuction</h1>
61
- </div>
62
- </Panel>
63
- <Panel>
64
- <template #header>
65
- <div class="flex flex-row">
66
- <div class="font font-bold">Login To</div>
67
- <Button
68
- class="pi pi-refresh ml-4"
69
- @click="loadProfile"
70
- v-if="useRuntimeConfig().public.DEBUGDATA"
71
- ></Button>
72
- </div>
73
- </template>
74
- <div class="grid grid-cols-2">
75
- <Card v-for="org in orgList" class="m-2">
76
- <template #header>
77
- <div class="font font-bold ml-4">{{ org.orgName }}</div>
78
- </template>
79
- <template #content>
80
- <div v-for="item in branches" class="hover-list-primary">
81
- <NuxtLink
82
- v-if="org.orgId == item.branch.orgId"
83
- :external="true"
84
- :to="item.xOrg"
85
- class="tenant-link"
86
- >
87
- <div
88
- class="grid grid-cols-2 p-2 align-items-center gap-0 w-full"
89
- >
90
- <div class="">
91
- <p>
92
- <span class="font font-semibold">{{
93
- item.branch.branchName
94
- }}</span
95
- ><span class="ml-2 text text-gray-500">
96
- {{ item.group }}</span
97
- >
98
- </p>
99
- <span class="text-xs italic"
100
- >{{ useRuntimeConfig().public.APP_URL }}/{{
101
- item.xOrg
102
- }}</span
103
- >
104
- </div>
105
- <div class="font-bold text-900">
106
- {{ item.branch.branchCode }}
107
- </div>
108
- </div>
109
- </NuxtLink>
110
- </div>
111
- </template>
112
- </Card>
113
- </div>
114
- </Panel>
115
- </div>
116
- </template>
@@ -1,11 +0,0 @@
1
- /**
2
- * This file was automatically generated by simpleapp generator. Every
3
- * MODIFICATION OVERRIDE BY GENERATEOR
4
- * last change 2023-10-28
5
- * Author: Ks Tan
6
- */
7
- export enum SimpleAppEventType {
8
- 'InvitationAccepted' = 'invitationaccepted',
9
- 'InvitationRejected' = 'invitationrejected'
10
-
11
- }