@simitgroup/simpleapp-generator 1.0.47 → 1.0.49

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 (137) hide show
  1. package/README.md +44 -4
  2. package/buildinschemas copy/docnoformat.docno.jsonschema.json +2 -20
  3. package/dist/buildinschemas/autoincreament.js +1 -1
  4. package/dist/buildinschemas/autoincreament.js.map +1 -1
  5. package/dist/buildinschemas/branch.js +1 -1
  6. package/dist/buildinschemas/branch.js.map +1 -1
  7. package/dist/buildinschemas/docnoformat.d.ts.map +1 -1
  8. package/dist/buildinschemas/docnoformat.js +12 -25
  9. package/dist/buildinschemas/docnoformat.js.map +1 -1
  10. package/dist/buildinschemas/user.d.ts.map +1 -1
  11. package/dist/buildinschemas/user.js +1 -0
  12. package/dist/buildinschemas/user.js.map +1 -1
  13. package/dist/framework.d.ts.map +1 -1
  14. package/dist/framework.js +10 -2
  15. package/dist/framework.js.map +1 -1
  16. package/dist/generate.js +24 -13
  17. package/dist/generate.js.map +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/type.d.ts +1 -0
  21. package/dist/type.d.ts.map +1 -1
  22. package/dist/type.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/buildinschemas/autoincreament.ts +1 -1
  25. package/src/buildinschemas/branch.ts +1 -1
  26. package/src/buildinschemas/docnoformat.ts +13 -27
  27. package/src/buildinschemas/user.ts +1 -0
  28. package/src/framework.ts +10 -2
  29. package/src/generate.ts +26 -13
  30. package/src/index.ts +1 -1
  31. package/src/type.ts +1 -0
  32. package/templates/basic/nest/processor.ts.eta +2 -2
  33. package/templates/basic/nest/service.ts.eta +2 -4
  34. package/templates/basic/nuxt/pages.crud.vue.eta +2 -2
  35. package/templates/nest/src/app.controller.ts.eta +6 -0
  36. package/templates/nest/src/app.module.ts.eta +9 -1
  37. package/templates/nest/src/app.service.ts.eta +6 -0
  38. package/templates/nest/src/main.ts.eta +7 -0
  39. package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +6 -2
  40. package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +17 -0
  41. package/templates/nest/src/simpleapp/generate/commons/decorators/appuser.decorator.ts.eta +6 -0
  42. package/templates/nest/src/simpleapp/generate/commons/dicts/documents.ts.eta +14 -0
  43. package/templates/nest/src/simpleapp/generate/commons/dicts/foreignkeys.ts.eta +6 -0
  44. package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +9 -3
  45. package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +23 -3
  46. package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +52 -10
  47. package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +6 -0
  48. package/templates/nest/src/simpleapp/generate/commons/providers/workflow.provider.ts.etax +6 -0
  49. package/templates/nest/src/simpleapp/generate/commons/roles/roles.decorator.ts.eta +6 -1
  50. package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +6 -0
  51. package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +6 -0
  52. package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +6 -1
  53. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +15 -7
  54. package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +6 -0
  55. package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +27 -0
  56. package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +3 -4
  57. package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +3 -5
  58. package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +3 -4
  59. package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +42 -11
  60. package/templates/nest/src/simpleapp/generate/types/apievent.type.ts.eta +22 -0
  61. package/templates/nest/src/simpleapp/generate/types/index.ts.eta +6 -0
  62. package/templates/nest/src/simpleapp/profile/profile.apischema.ts.eta +6 -0
  63. package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +6 -0
  64. package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +6 -0
  65. package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +6 -0
  66. package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +5 -6
  67. package/templates/nest/src/simpleapp/services/branch.service.ts.eta +50 -10
  68. package/templates/nest/src/simpleapp/services/docno.service.ts.eta +5 -7
  69. package/templates/nest/src/simpleapp/services/org.service.ts.eta +4 -6
  70. package/templates/nest/src/simpleapp/services/perm.service.ts.eta +6 -7
  71. package/templates/nest/src/simpleapp/services/tenant.service.ts.eta +5 -6
  72. package/templates/nest/src/simpleapp/services/user.service.ts.eta +5 -6
  73. package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +6 -8
  74. package/templates/nuxt/app.vue.eta +6 -1
  75. package/templates/nuxt/assets/css/style.css._eta +12 -0
  76. package/templates/nuxt/assets/css/tailwind.css._eta +10 -0
  77. package/templates/nuxt/assets/primevue/passthrough.ts._eta +37 -0
  78. package/templates/nuxt/components/ButtonCreateTenant.vue.eta +68 -0
  79. package/templates/nuxt/components/ButtonHome.vue.eta +10 -0
  80. package/templates/nuxt/components/ButtonLogout.vue.eta +9 -0
  81. package/templates/nuxt/components/ButtonMenuPicker.vue.eta +55 -0
  82. package/templates/nuxt/components/ButtonPermissionInfo.vue.eta +113 -0
  83. package/templates/nuxt/components/ButtonProfile.vue.eta +52 -0
  84. package/templates/nuxt/components/CrudNestedDoc.vue.eta +11 -7
  85. package/templates/nuxt/components/CrudSimple.vue.eta +13 -11
  86. package/templates/nuxt/components/DebugDocumentData.vue.eta +1 -1
  87. package/templates/nuxt/components/HeaderBar.vue.eta +39 -0
  88. package/templates/nuxt/components/Invitation.vue.eta +2 -2
  89. package/templates/nuxt/components/Menus.vue.eta +7 -7
  90. package/templates/nuxt/components/SelectBranch.vue.eta +35 -0
  91. package/templates/nuxt/components/SimpleAppAutocomplete.vue.eta +1 -1
  92. package/templates/nuxt/components/SimpleAppDatatable.vue.eta +0 -1
  93. package/templates/nuxt/components/SimpleAppDocumentNo.vue.eta +1 -1
  94. package/templates/nuxt/components/SimpleAppForm.vue.eta +1 -1
  95. package/templates/nuxt/components/SimpleAppInputTable.vue.eta +2 -2
  96. package/templates/nuxt/components/SimpleFieldContainer.vue.eta +18 -12
  97. package/templates/nuxt/components/Spinner.vue.eta +9 -0
  98. package/templates/nuxt/composables/getMenus.generate.ts.eta +5 -4
  99. package/templates/nuxt/layouts/default.vue.eta +3 -12
  100. package/templates/nuxt/middleware/{10.acl.global.ts.eta → 30.acl.global.ts.eta} +6 -0
  101. package/templates/nuxt/nuxt.config.ts.eta +55 -12
  102. package/templates/nuxt/pages/[xorg]/branch/{index.vue.eta → index.vue.etax} +1 -4
  103. package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +83 -113
  104. package/templates/nuxt/pages/[xorg]/index.vue._eta +13 -0
  105. package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +89 -69
  106. package/templates/nuxt/pages/[xorg]/permission/index.vue.eta +7 -7
  107. package/templates/nuxt/pages/[xorg]/tenant/index.vue.eta +0 -4
  108. package/templates/nuxt/pages/[xorg]/user/index.vue.eta +33 -33
  109. package/templates/nuxt/pages/index.vue.eta +10 -85
  110. package/templates/nuxt/pages/login.vue.eta +9 -3
  111. package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +16 -19
  112. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +19 -3
  113. package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +4 -4
  114. package/templates/nuxt/server/api/[xorg]/[...].ts.eta +4 -4
  115. package/templates/nuxt/server/api/auth/[...].ts.eta +6 -0
  116. package/templates/nuxt/server/api/auth/logout.ts.eta +6 -1
  117. package/templates/nuxt/server/api/profile/[...].ts.eta +4 -5
  118. package/templates/nuxt/server/api/profile/index.ts.eta +4 -6
  119. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +9 -2
  120. package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +12 -3
  121. package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +6 -0
  122. package/templates/nuxt/simpleapp/generate/commons/groups.ts.eta +6 -0
  123. package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +6 -0
  124. package/templates/nuxt/tailwind.config.ts._eta +66 -0
  125. package/templates/nuxt/types/index.ts.eta +22 -1
  126. package/templates/project/build.sh.eta +4 -4
  127. package/templates/project/schemas/invoice.ts.eta +1 -0
  128. package/templates/project/schemas/product.ts.eta +1 -1
  129. package/tsconfig.tsbuildinfo +1 -1
  130. package/templates/nuxt/assets/css/tailwind.css.eta +0 -35
  131. package/templates/nuxt/components/PermissionInfo.vue.eta +0 -92
  132. package/templates/nuxt/components/XorgPicker.vue.eta +0 -66
  133. package/templates/nuxt/pages/[xorg]/index.vue.eta +0 -36
  134. package/templates/nuxt/tailwind.config.ts.eta +0 -9
  135. /package/templates/nest/{.env.eta → .env._eta} +0 -0
  136. /package/templates/nuxt/{.env.eta → .env._eta} +0 -0
  137. /package/templates/project/{config.json.eta → config.json._eta} +0 -0
@@ -7,73 +7,69 @@
7
7
  * author: Ks Tan
8
8
  */
9
9
 
10
- import {
11
- InputTableColumnType,
12
- InputTableColumn,
13
- } from "@simitgroup/simpleapp-vue-component/src/type";
14
10
  import Column from "primevue/column";
15
- const { $OrganizationDoc,$BranchDoc, $listen } = useNuxtApp();
11
+ const { $OrganizationDoc, $BranchDoc, $listen } = useNuxtApp();
16
12
  //organization
17
13
  const doc = $OrganizationDoc();
18
14
  const data = doc.getReactiveData();
19
15
  const columns = ["orgCode", "orgName", "description", "tenantId", "orgId"];
20
- const branchlist = ref()
21
- const branchdoc = $BranchDoc()
22
- const branchdata = branchdoc.getReactiveData()
23
- const currentOrgId=ref()
24
- const debugdata= ref()
25
- const showbranchfrom = ref(false)
16
+ const branchlist = ref();
17
+ const branchdoc = $BranchDoc();
18
+ const branchdata = branchdoc.getReactiveData();
19
+ const currentOrgId = ref();
20
+ const debugdata = ref();
21
+ const showbranchfrom = ref(false);
26
22
  //branch
27
23
 
28
24
  const getBranchList = () => {
29
-
30
- branchdoc.getApi().runSearch({orgId:data.value.orgId}).then((res)=>{
31
- branchlist.value =res.data
32
- })
33
- }
34
- $listen('editRecord',async (editOrgid)=>{
35
- //console.log('editRecord',editOrgid)
36
- debugdata.value=data.value
37
- if(editOrgid){
38
-
39
- currentOrgId.value=editOrgid
40
- getBranchList()
41
- }
42
- })
25
+ branchdoc
26
+ .getApi()
27
+ .runSearch({ orgId: data.value.orgId })
28
+ .then((res) => {
29
+ branchlist.value = res.data;
30
+ });
31
+ };
32
+ $listen("editRecord", async (editOrgid) => {
33
+ //console.log('editRecord',editOrgid)
34
+ debugdata.value = data.value;
35
+ if (editOrgid) {
36
+ currentOrgId.value = editOrgid;
37
+ getBranchList();
38
+ }
39
+ });
43
40
 
44
- const editBranch=(recordId:string)=>{
45
- console.log("edit nested",currentOrgId,recordId)
46
- showbranchfrom.value=true
47
- debugdata.value=branchdata.value
48
- if(!recordId){
49
- branchdoc.setNew()
50
- }else{
51
- branchdoc.getById(recordId)
41
+ const editBranch = (recordId: string) => {
42
+ console.log("edit nested", currentOrgId, recordId);
43
+ showbranchfrom.value = true;
44
+ debugdata.value = branchdata.value;
45
+ if (!recordId) {
46
+ branchdoc.setNew();
47
+ } else {
48
+ branchdoc.getById(recordId);
52
49
  }
53
- }
54
- const saveBranch= async()=>{
55
- branchdata.value.orgId=data.value.orgId
50
+ };
51
+ const saveBranch = async () => {
52
+ branchdata.value.orgId = data.value.orgId;
56
53
  branchdata.value.organization = {
57
54
  _id: data.value._id,
58
55
  orgId: data.value.orgId,
59
- label: data.value.orgName
60
- }
61
- if(branchdata.value._id==''){
62
- console.log("Create")
63
- await branchdoc.create()
64
- }else{
65
- console.log("update")
66
- await branchdoc.update()
56
+ label: data.value.orgName,
57
+ };
58
+ if (branchdoc.isNew()) {
59
+ console.log("Create");
60
+ await branchdoc.create();
61
+ } else {
62
+ console.log("update");
63
+ await branchdoc.update();
67
64
  }
68
- getBranchList()
69
-
70
- }
65
+ getBranchList();
66
+ };
71
67
 
72
68
  //end
73
69
  </script>
74
70
  <template>
75
71
  <div>
76
- <DebugDocumentData v-model="debugdata"/>
72
+ <DebugDocumentData v-model="debugdata" />
77
73
  <CrudNestedDoc
78
74
  :document="doc"
79
75
  title="Organization"
@@ -116,33 +112,57 @@ const saveBranch= async()=>{
116
112
  </div>
117
113
  <div class="grid grid-cols-4 gap-4 w-full">
118
114
  <div class="col-span-2">
119
-
120
- <SimpleAppDatatable v-model="branchlist" :columns="['branchId','branchCode','branchName','active']">
115
+ <SimpleAppDatatable
116
+ v-model="branchlist"
117
+ :columns="['branchId', 'branchCode', 'branchName', 'active']"
118
+ >
121
119
  <template #header>
122
- <button class="btn-primary" @click="editBranch('')" type="button" ><span class="pi pi-plus "> </span></button>
123
- </template>
124
- <Column header="Action" >
125
- <template #body="{index,data}">
126
- <button type="button" class="btn-primary" @click="editBranch(data._id)">Edit</button>
127
- </template>
128
- </Column>
129
-
120
+ <Button class=" btn-primary" @click="editBranch('')" type="button">
121
+ <span class="font font-normal">Add Branch</span>
122
+ </Button>
123
+ </template>
124
+ <Column header="Action">
125
+ <template #body="{ index, data }">
126
+ <Button
127
+ type="button"
128
+ class=" btn-primary"
129
+ @click="editBranch(data._id)"
130
+ >
131
+ Edit
132
+ </Button>
133
+ </template>
134
+ </Column>
130
135
  </SimpleAppDatatable>
131
136
  </div>
132
- <div class="col-span-2" >
133
- <SimpleAppForm :document="branchdoc" #default="o" v-if="showbranchfrom">
134
- <SimpleAppText v-model="branchdata.branchCode" :setting="o.getField('#/properties/branchCode')"/>
135
- <SimpleAppText v-model="branchdata.branchName" :setting="o.getField('#/properties/branchName')"/>
136
- <SimpleAppCheckbox v-model="branchdata.active" :setting="o.getField('#/properties/active')"/>
137
- <SimpleAppTextarea v-model="branchdata.description" :setting="o.getField('#/properties/description')"/>
138
- <!-- <SimpleAppNumber :readonly="true" v-model="branchdata.orgId" :setting="o.getField('#/properties/orgId')"/> -->
139
- <button class="btn-primary" type="button" @click="saveBranch">Save</button>
140
-
137
+ <div class="col-span-2">
138
+ <SimpleAppForm
139
+ :document="branchdoc"
140
+ #default="o"
141
+ v-if="showbranchfrom"
142
+ >
143
+ <SimpleAppText
144
+ v-model="branchdata.branchCode"
145
+ :setting="o.getField('#/properties/branchCode')"
146
+ />
147
+ <SimpleAppText
148
+ v-model="branchdata.branchName"
149
+ :setting="o.getField('#/properties/branchName')"
150
+ />
151
+ <SimpleAppCheckbox
152
+ v-model="branchdata.active"
153
+ :setting="o.getField('#/properties/active')"
154
+ />
155
+ <SimpleAppTextarea
156
+ v-model="branchdata.description"
157
+ :setting="o.getField('#/properties/description')"
158
+ />
159
+ <!-- <SimpleAppNumber :readonly="true" v-model="branchdata.orgId" :setting="o.getField('#/properties/orgId')"/> -->
160
+ <Button class=" btn-primary" type="button" @click="saveBranch">
161
+ Save
162
+ </Button>
141
163
  </SimpleAppForm>
142
164
  </div>
143
-
144
165
  </div>
145
166
  </CrudNestedDoc>
146
-
147
167
  </div>
148
168
  </template>
@@ -156,7 +156,7 @@ onMounted(() => {
156
156
  });
157
157
  </script>
158
158
  <template>
159
- <button @click="refreshList()" class="pi pi-refresh"></button>
159
+ <Button @click="refreshList()" class="pi pi-refresh"></Button>
160
160
  <Dialog
161
161
  v-model:visible="showpermissioninfo"
162
162
  modal
@@ -204,8 +204,8 @@ onMounted(() => {
204
204
  placeholder="email"
205
205
  v-model="inviteemail"
206
206
  />
207
- <button label="Search" class="btn btn-primary" @click="invite"
208
- >Invite</button
207
+ <Button label="Search" class=" btn-primary" @click="invite"
208
+ >Invite</Button
209
209
  >
210
210
 
211
211
  </div>
@@ -221,10 +221,10 @@ onMounted(() => {
221
221
  {{ invitation.email }}
222
222
  </div>
223
223
  <div>
224
- <button
224
+ <Button
225
225
  class="btn-danger pi pi-times"
226
226
  @click="deleteInvitation(invitation._id)"
227
- ></button>
227
+ ></Button>
228
228
  </div>
229
229
  </div>
230
230
  </div>
@@ -235,10 +235,10 @@ onMounted(() => {
235
235
  <div class="flex flex-row w w-full">
236
236
  <div class="text text-xl p p-2 text-left flex-1">{{ activeuser }}</div>
237
237
  <div class="text-right m mr-2">
238
- <button
238
+ <Button
239
239
  class="btn-primary pi pi-question"
240
240
  @click="previewPermission"
241
- ></button>
241
+ ></Button>
242
242
  </div>
243
243
  </div>
244
244
 
@@ -7,10 +7,6 @@
7
7
  * author: Ks Tan
8
8
  */
9
9
 
10
- import {
11
- InputTableColumnType,
12
- InputTableColumn,
13
- } from "@simitgroup/simpleapp-vue-component/src/type";
14
10
  import Column from "primevue/column";
15
11
  const { $TenantDoc } = useNuxtApp();
16
12
  const doc = $TenantDoc();
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import Menu from "primevue/menu";
9
9
  import Dialog from "primevue/dialog";
10
- import {SearchBody} from '~/types'
10
+ import { SearchBody } from "~/types";
11
11
  import _ from "lodash";
12
12
  import Panel from "primevue/panel";
13
13
  import { ref } from "vue";
@@ -67,7 +67,9 @@ const permissiontitle = "Permission Information";
67
67
  */
68
68
  const refreshList = async (resetpage: boolean = true) => {
69
69
  const items: any[] = [];
70
- const searchbody: SearchBody = {fields:['uid','email','created','fullname','active']}
70
+ const searchbody: SearchBody = {
71
+ fields: ["uid", "email", "created", "fullname", "active"],
72
+ };
71
73
  userlist.value = await userdoc.search(searchbody);
72
74
  //listUser();
73
75
  // userlist.value = _.uniqBy(permlist.value, "uid");
@@ -90,13 +92,25 @@ const refreshList = async (resetpage: boolean = true) => {
90
92
  */
91
93
  const onSelectUser = async (menuitem: any) => {
92
94
  const user: UserListItem = { ...menuitem };
93
- const orgsearchbody: SearchBody = {fields:['orgId','orgCode','orgName','active']}
94
- const branchsearchbody: SearchBody = {fields:['orgId','branchId','branchCode','branchName','active']}
95
+ const orgsearchbody: SearchBody = {
96
+ fields: ["orgId", "orgCode", "orgName", "active"],
97
+ };
98
+ const branchsearchbody: SearchBody = {
99
+ fields: ["orgId", "branchId", "branchCode", "branchName", "active"],
100
+ };
95
101
  const permsearchbody: SearchBody = {
96
- filter:{$or: [{ uid: user.uid }, { user_id: user._id }],},
97
- fields:['uid','branchId','tenantId','orgId','active','group','created']
98
- }
99
-
102
+ filter: { $or: [{ uid: user.uid }, { user_id: user._id }] },
103
+ fields: [
104
+ "uid",
105
+ "branchId",
106
+ "tenantId",
107
+ "orgId",
108
+ "active",
109
+ "group",
110
+ "created",
111
+ ],
112
+ };
113
+
100
114
  orglist.value = await orgdoc.search(orgsearchbody);
101
115
  branchlist.value = await branchdoc.search(branchsearchbody);
102
116
  permlist.value = await permdoc.search(permsearchbody);
@@ -238,21 +252,11 @@ onMounted(() => {
238
252
  });
239
253
  </script>
240
254
  <template>
241
- <button
255
+ <Button
242
256
  @click="refreshList()"
243
257
  v-if="useRuntimeConfig().public.DEBUGDATA"
244
258
  class="pi pi-refresh"
245
- ></button>
246
- <Dialog
247
- v-model:visible="showpermissioninfo"
248
- modal
249
- :header="permissiontitle"
250
- :autoZIndex="false"
251
- :style="{ zIndex: 100, width: '80vw' }"
252
- >
253
- <PermissionInfo></PermissionInfo>
254
- </Dialog>
255
-
259
+ ></Button>
256
260
  <div class="grid grid-cols-4">
257
261
  <div v-if="userlist">
258
262
  <TabView>
@@ -281,11 +285,11 @@ onMounted(() => {
281
285
  </div>
282
286
  <div class="basis-1/6 m-2">
283
287
  <!-- only debug mode can delete user -->
284
- <button
288
+ <Button
285
289
  v-if="useRuntimeConfig().public.DEBUGDATA"
286
290
  class="pi pi-times btn-danger"
287
291
  @click="deleteUser(item)"
288
- ></button>
292
+ ></Button>
289
293
  </div>
290
294
  </a>
291
295
  </template>
@@ -316,11 +320,11 @@ onMounted(() => {
316
320
  </div>
317
321
  <div class="basis-1/6 m-2">
318
322
  <!-- only debug mode can delete user -->
319
- <button
323
+ <Button
320
324
  v-if="useRuntimeConfig().public.DEBUGDATA"
321
325
  class="pi pi-times btn-danger"
322
326
  @click="deleteUser(item)"
323
- ></button>
327
+ ></Button>
324
328
  </div>
325
329
  </a>
326
330
  </template>
@@ -335,9 +339,9 @@ onMounted(() => {
335
339
  placeholder="email"
336
340
  v-model="inviteemail"
337
341
  />
338
- <button label="Search" class="btn btn-primary" @click="invite">
342
+ <Button label="Search" class="btn btn-primary" @click="invite">
339
343
  Invite
340
- </button>
344
+ </Button>
341
345
  </div>
342
346
  </form>
343
347
  </div>
@@ -364,10 +368,10 @@ onMounted(() => {
364
368
  <div class="text text-sm text-right">{{ item.email }}</div>
365
369
  </div>
366
370
  <div class="basis-1/6 m-2">
367
- <button
371
+ <Button
368
372
  class="pi pi-times btn-danger"
369
373
  @click="deleteUser(item)"
370
- ></button>
374
+ ></Button>
371
375
  </div>
372
376
  </a>
373
377
  </template>
@@ -415,17 +419,13 @@ onMounted(() => {
415
419
  >
416
420
  <BlockUI :blocked="blockscreen">
417
421
  <div class="text-right m mr-2">
418
- <button
419
- class="btn-primary pi pi-question"
420
- @click="previewPermission"
421
- ></button>
422
+ <ButtonPermissionInfo></ButtonPermissionInfo>
422
423
  </div>
423
424
 
424
425
  <div class="grid grid-cols-2">
425
426
  <Card v-for="o in orglist" class="m-2">
426
427
  <template #title>{{ o.orgName }}</template>
427
428
  <template #content>
428
-
429
429
  <table class="w w-full">
430
430
  <thead class="">
431
431
  <tr>
@@ -1,9 +1,9 @@
1
1
  <script lang="ts" setup>
2
2
  /**
3
- * This file was automatically generated by simpleapp generator during initialization.
4
- * You may modify it for your need
5
- * last change 2023-09-09
6
- * author: Ks Tan
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
7
  */
8
8
  import _ from "lodash";
9
9
  import InputText from "primevue/inputtext";
@@ -11,28 +11,21 @@ import Dialog from "primevue/dialog";
11
11
  import { ref, Ref } from "vue";
12
12
  import { SimpleAppEventType } from "../simpleapp/generate/commons/events";
13
13
  import { TenantDoc } from "../simpleapp/docs/TenantDoc";
14
- import ProgressSpinner from 'primevue/progressspinner';
14
+ import ProgressSpinner from "primevue/progressspinner";
15
15
  import Panel from "primevue/panel";
16
16
  import Card from "primevue/card";
17
17
  import { AxiosResponse } from "axios";
18
18
 
19
19
  const { $event, $listen, $userstore } = useNuxtApp();
20
- const errCreateTenant = ref();
21
20
  const branches = ref([]);
22
- const data = ref();
23
- const visible = ref(false);
24
21
  const userprofile = ref();
25
- const createtitle = ref("Create My Company");
26
22
  const orgList = ref();
27
- const onhold = ref(false)
23
+
28
24
  const loadProfile = async () => {
29
25
  await reloadUserStore();
30
26
  userprofile.value = getUserProfile();
31
27
  console.log("useprofile", userprofile.value);
32
- data.value = {
33
- tenantName: "",
34
- };
35
-
28
+
36
29
  branches.value = userprofile.value.branches;
37
30
 
38
31
  orgList.value = _.uniqBy(branches.value, "branch.orgId").map((item) => ({
@@ -52,34 +45,6 @@ onMounted(() => {
52
45
  loadProfile();
53
46
  });
54
47
 
55
- const createTenant = async () => {
56
-
57
- onhold.value=true
58
- const { $axios, $listen } = useNuxtApp();
59
-
60
- const openapi = getApi();
61
- const apipath = `${useRuntimeConfig().public.API_URL}`;
62
- let profileapi = new openapi.PROFILEApi(undefined, apipath, $axios);
63
-
64
- profileapi
65
- .createTenant(data.value)
66
- .then((res) => {
67
- if (res && res.status && res.status == 201) {
68
- if (res.data && res.data["xOrg"]) {
69
- const xorg = res.data["xOrg"];
70
- navigateTo("/" + xorg, { external: true });
71
- }
72
- }
73
-
74
- })
75
- .catch((err) => {
76
- errCreateTenant.value = err["message"];
77
- console.error("errCreateTenant", err);
78
-
79
- }).finally(()=>{
80
- onhold.value=false
81
- });
82
- };
83
48
  </script>
84
49
  <template>
85
50
  <div class="grid grid-cols-2">
@@ -87,38 +52,7 @@ const createTenant = async () => {
87
52
  <Panel header="Create New Tenant">
88
53
  <div>
89
54
  <h1>Create new one?</h1>
90
- <DebugDocumentData
91
- v-model="data"
92
- label="CreateTenant"
93
- ></DebugDocumentData>
94
- <button class="btn-primary" @click="visible = true">
95
- Create My Company
96
- </button>
97
-
98
- <Dialog
99
- v-model:visible="visible"
100
- modal
101
- :header="createtitle"
102
- class="crudsimple-dialog"
103
- >
104
- <form @submit.prevent="true" class="flex flex-col text-center">
105
-
106
- <div v-if="errCreateTenant" class="text-error">
107
- {{ errCreateTenant }}
108
- </div>
109
- <ProgressSpinner v-if="onhold"></ProgressSpinner>
110
- <InputText v-else
111
- type="text"
112
- autofocus="true"
113
- v-model:model-value="data.tenantName"
114
- placeholder="Organization Name"
115
- />
116
-
117
- <button class="btn-primary" type="submit" @click="createTenant">
118
- Create
119
- </button>
120
- </form>
121
- </Dialog>
55
+ <ButtonCreateTenant></ButtonCreateTenant>
122
56
  </div>
123
57
  </Panel>
124
58
  <Panel header="Reserved">
@@ -130,11 +64,11 @@ const createTenant = async () => {
130
64
  <template #header>
131
65
  <div class="flex flex-row">
132
66
  <div class="font font-bold">Login To</div>
133
- <button
67
+ <Button
134
68
  class="pi pi-refresh ml-4"
135
69
  @click="loadProfile"
136
70
  v-if="useRuntimeConfig().public.DEBUGDATA"
137
- ></button>
71
+ ></Button>
138
72
  </div>
139
73
  </template>
140
74
  <div class="grid grid-cols-2">
@@ -180,12 +114,3 @@ const createTenant = async () => {
180
114
  </Panel>
181
115
  </div>
182
116
  </template>
183
-
184
- <style scoped>
185
- .p-panel {
186
- @apply m-2;
187
- }
188
- /* .tenant-link:hover div {
189
- @apply bg-gray-300;
190
- } */
191
- </style>
@@ -1,7 +1,10 @@
1
- <template>
2
- <NuxtPage />
3
- </template>
4
1
  <script setup lang="ts">
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
+ */
5
8
  definePageMeta({
6
9
  name: "Login",
7
10
  auth: false,
@@ -19,3 +22,6 @@ onMounted(async () => {
19
22
  await signIn("keycloak", { callbackUrl: callbackUrl });
20
23
  });
21
24
  </script>
25
+ <template>
26
+ <NuxtPage />
27
+ </template>
@@ -1,21 +1,16 @@
1
- // import { Tailwind } from 'primevue/passthrough/tailwind';
2
- import Tailwind from "primevue/passthrough/tailwind";
3
-
4
- // const Base64URL = require('@darkwolf/base64url');
5
-
6
1
  /**
7
- * This file was automatically generated by simpleapp generator during initialization.
8
- * DO NOT MODIFY IT BY HAND.
9
- * last change 2023-09-09
10
- * author: Ks Tan
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
11
6
  */
12
7
  import { defineNuxtPlugin } from "#app";
13
8
  import axios, { Axios, AxiosResponse } from 'axios'
14
- import PrimeVue from "primevue/config";
9
+ // import PrimeVue from "primevue/config";
15
10
  import mitt from 'mitt'
16
- import ToastService from 'primevue/toastservice';
17
- import ConfirmationService from 'primevue/confirmationservice';
18
- import Tooltip from 'primevue/tooltip';
11
+ // import ToastService from 'primevue/toastservice';
12
+ // import ConfirmationService from 'primevue/confirmationservice';
13
+ // import Tooltip from 'primevue/tooltip';
19
14
  const emitter = mitt()
20
15
 
21
16
  export default defineNuxtPlugin( async(nuxtApp) => {
@@ -34,12 +29,14 @@ export default defineNuxtPlugin( async(nuxtApp) => {
34
29
  return Promise.reject(error)
35
30
  }
36
31
  });
37
- nuxtApp.vueApp.use(PrimeVue, { ripple: true,Tailwind:true, pt: Tailwind});
38
- nuxtApp.vueApp
39
- .use(ToastService)
40
- .use(ConfirmationService)
41
- .directive('tooltip', Tooltip)
42
- ;
32
+
33
+ // nuxtApp.vueApp.use(PrimeVue, { ripple: true,Tailwind:true, pt: Tailwind});
34
+ // nuxtApp.vueApp.use(PrimeVue, { unstyled: true, pt: {} });
35
+ // nuxtApp.vueApp
36
+ // .use(ToastService)
37
+ // .use(ConfirmationService)
38
+ // .directive('tooltip', Tooltip)
39
+ // ;
43
40
 
44
41
 
45
42
  return {