@simitgroup/simpleapp-generator 1.0.59 → 1.0.61

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 (97) 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 +11 -6
  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 +15 -7
  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.[id].vue.eta +2 -2
  30. package/templates/basic/nuxt/pages.crud.vue.eta +79 -40
  31. package/templates/basic/nuxt/pages.landing.vue.eta +82 -0
  32. package/templates/nest/.env._eta +1 -0
  33. package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +1 -1
  34. package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +1 -1
  35. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +127 -22
  36. package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +1 -1
  37. package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +25 -2
  38. package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +20 -2
  39. package/templates/nest/src/simpleapp/services/branch.service.ts.eta +41 -40
  40. package/templates/nest/src/simpleapp/services/user.service.ts.eta +10 -9
  41. package/templates/nuxt/app.vue.eta +2 -1
  42. package/templates/nuxt/assets/css/style.css._eta +3 -12
  43. package/templates/nuxt/assets/primevue/passthrough.ts._eta +24 -20
  44. package/templates/nuxt/components/ButtonCreateTenant.vue.eta +30 -23
  45. package/templates/nuxt/components/ButtonHome.vue.eta +15 -2
  46. package/templates/nuxt/components/ButtonMenuPicker.vue.eta +5 -20
  47. package/templates/nuxt/components/ButtonPermissionInfo.vue.eta +5 -7
  48. package/templates/nuxt/components/ButtonProfile.vue.eta +42 -25
  49. package/templates/nuxt/components/CrudSimple.vue.eta +1 -1
  50. package/templates/nuxt/components/EventDecision.vue.eta +115 -0
  51. package/templates/nuxt/components/EventNotification.vue.eta +157 -0
  52. package/templates/nuxt/components/HeaderBar.vue.eta +2 -2
  53. package/templates/nuxt/components/Invitation.vue.eta +3 -3
  54. package/templates/nuxt/components/SelectBranch.vue.eta +5 -2
  55. package/templates/nuxt/components/SimpleAppDatatable.vue.eta +151 -5
  56. package/templates/nuxt/components/TenantPicker.vue.eta +75 -0
  57. package/templates/nuxt/components/UserProfileListItem.vue.eta +65 -0
  58. package/templates/nuxt/components/renderers/BooleanRender.vue.eta +7 -0
  59. package/templates/nuxt/components/renderers/DateRender.vue.eta +6 -0
  60. package/templates/nuxt/components/renderers/ForeignKeyRender.vue.eta +10 -0
  61. package/templates/nuxt/components/renderers/MoneyRender.vue.eta +7 -0
  62. package/templates/nuxt/components/renderers/MultiTextRender.vue.eta +11 -0
  63. package/templates/nuxt/composables/getDocument.generate.ts.eta +4 -0
  64. package/templates/nuxt/composables/getMenus.generate.ts.eta +35 -31
  65. package/templates/nuxt/composables/getUserStore.generate.ts.eta +6 -1
  66. package/templates/nuxt/composables/goTo.generate.ts.eta +15 -0
  67. package/templates/nuxt/composables/notifications.generate.ts.eta +21 -0
  68. package/templates/nuxt/composables/stringHelper.generate.ts.eta +11 -1
  69. package/templates/nuxt/error.vue._eta +20 -5
  70. package/templates/nuxt/layouts/documentlist.vue.eta +166 -0
  71. package/templates/nuxt/middleware/30.acl.global.ts.eta +4 -1
  72. package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +4 -4
  73. package/templates/nuxt/pages/[xorg]/profile.vue.eta +6 -0
  74. package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +6 -0
  75. package/templates/nuxt/pages/[xorg]/user/index.vue.eta +211 -377
  76. package/templates/nuxt/pages/[xorg]/user.vue.eta +197 -0
  77. package/templates/nuxt/pages/index.vue._eta +101 -0
  78. package/templates/nuxt/pages/profile.vue.eta +94 -0
  79. package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +4 -4
  80. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +11 -10
  81. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +69 -17
  82. package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +6 -3
  83. package/templates/nuxt/tailwind.config.ts._eta +10 -0
  84. package/templates/nuxt/types/documentlist.ts.eta +9 -0
  85. package/templates/nuxt/types/events.ts.eta +20 -0
  86. package/templates/nuxt/types/index.ts.eta +6 -79
  87. package/templates/nuxt/types/notifications.ts.eta +16 -0
  88. package/templates/nuxt/types/others.ts.eta +42 -0
  89. package/templates/nuxt/types/user.ts.eta +44 -0
  90. package/tsconfig.tsbuildinfo +1 -1
  91. package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +0 -52
  92. package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +0 -43
  93. package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +0 -56
  94. package/templates/nuxt/components/EventMonitor.vue.eta +0 -85
  95. package/templates/nuxt/pages/[xorg]/tenant/index.vue.eta +0 -89
  96. package/templates/nuxt/pages/index.vue.eta +0 -116
  97. package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +0 -11
@@ -9,19 +9,19 @@ import { Model } from 'mongoose';
9
9
  import { Injectable, InternalServerErrorException } from '@nestjs/common';
10
10
  import { BranchProcessor } from '../generate/processors/branch.processor';
11
11
  import { Branch } from '../generate/types/branch.type';
12
- import {alldocuments} from '../generate/commons/dicts/documents'
12
+ import { alldocuments } from '../generate/commons/dicts/documents';
13
13
  export { Branch } from '../generate/types/branch.type';
14
14
  import { AutoincreamentService } from './autoinc.service';
15
15
  import { UserContext } from '../generate/commons/user.context';
16
- import { Docnoformat,DocnoformatService } from './docno.service';
16
+ import { Docnoformat, DocnoformatService } from './docno.service';
17
17
  // import { Docnoformat } from '../generate/types/docno.type';
18
18
  @Injectable()
19
19
  export class BranchService extends BranchProcessor {
20
20
  protected strictIsolation = false;
21
21
  constructor(
22
22
  @InjectModel('Branch') mydoc: Model<Branch>,
23
- private increament: AutoincreamentService,
24
- private docnoservice:DocnoformatService
23
+ private increament: AutoincreamentService,
24
+ private docnoservice: DocnoformatService,
25
25
  ) {
26
26
  super(mydoc);
27
27
  }
@@ -46,9 +46,9 @@ export class BranchService extends BranchProcessor {
46
46
  );
47
47
  data.branchId = searchresult.nextno;
48
48
  break;
49
- case 'afterCreate':
50
- await this.generateDefaultDocNumbers(appuser,data);
51
- break;
49
+ case 'afterCreate':
50
+ await this.generateDefaultDocNumbers(appuser, data);
51
+ break;
52
52
  // case 'beforeUpdate':
53
53
  // break;
54
54
  // case 'afterUpdate':
@@ -67,40 +67,41 @@ export class BranchService extends BranchProcessor {
67
67
  return true;
68
68
  };
69
69
 
70
- generateDefaultDocNumbers =async (appuser,data) => {
71
- const branchName = data.branchName
72
- const branchCode = data.branchCode
73
- const recordId = data._id
74
- const branchId= data.branchId
75
- const orgId = data.orgId
76
- const tenantId = data.tenantId
77
- const docformats = alldocuments.filter((item)=>item.docNumber)
78
- for(let i=0; i< docformats.length; i++){
79
- const doc = docformats[i]
80
- const pattern = `${doc.docType}-${branchCode}-[00000]`
81
- const formatdata:Docnoformat = {
82
- _id:crypto.randomUUID(),
83
- docNoFormatNo:'Default',
84
- docNoFormatName:'Default',
70
+ generateDefaultDocNumbers = async (appuser, data) => {
71
+ const branchName = data.branchName;
72
+ const branchCode = data.branchCode;
73
+ const recordId = data._id;
74
+ const branchId = data.branchId;
75
+ const orgId = data.orgId;
76
+ const tenantId = data.tenantId;
77
+ const docformats = alldocuments.filter((item) => item.docNumber);
78
+ for (let i = 0; i < docformats.length; i++) {
79
+ const doc = docformats[i];
80
+ const pattern = `${doc.docType}-${branchCode}-[00000]`;
81
+ const formatdata: Docnoformat = {
82
+ _id: crypto.randomUUID(),
83
+ docNoFormatNo: doc.docType,
84
+ docNoFormatName: `Default ${doc.docType}`,
85
85
  docNoType: doc.docType,
86
- docNoPattern: pattern,
87
- branch:{_id:recordId,branchId:branchId,label:branchName},
88
- branchId:branchId,
89
- orgId:orgId,
90
- tenantId:tenantId,
91
- nextNumber:1,
92
- } as Docnoformat
93
- try{
94
- const result = await this.docnoservice.create(appuser,formatdata)
95
- if(!result){
96
- throw new InternalServerErrorException(`Generate default document number for "${branchCode}" failed. Pattern: ${pattern}`,'generateDefaultDocNumbers')
86
+ docNoPattern: pattern,
87
+ branch: { _id: recordId, branchId: branchId, label: branchName },
88
+ branchId: branchId,
89
+ orgId: orgId,
90
+ tenantId: tenantId,
91
+ nextNumber: 1,
92
+ } as Docnoformat;
93
+ try {
94
+ const result = await this.docnoservice.create(appuser, formatdata);
95
+ if (!result) {
96
+ throw new InternalServerErrorException(
97
+ `Generate default document number for "${branchCode}" failed. Pattern: ${pattern}`,
98
+ 'generateDefaultDocNumbers',
99
+ );
97
100
  }
98
-
99
- }catch(err){
100
- this.logger.error(err)
101
- throw new InternalServerErrorException(err)
101
+ } catch (err) {
102
+ this.logger.error(err);
103
+ throw new InternalServerErrorException(err);
102
104
  }
103
-
104
- }
105
- }
105
+ }
106
+ };
106
107
  }
@@ -14,7 +14,6 @@ import { User } from '../generate/types/user.type';
14
14
 
15
15
  export { User } from '../generate/types/user.type';
16
16
 
17
-
18
17
  @Injectable()
19
18
  export class UserService extends UserProcessor {
20
19
  protected strictIsolation = false;
@@ -45,14 +44,16 @@ export class UserService extends UserProcessor {
45
44
  // break;
46
45
  // case 'afterUpdate':
47
46
  // break;
48
- // case 'beforeDelete':
49
- // break;
50
- case 'afterDelete':
51
- const result = await this.permdoc.deleteMany({
52
- user_id: data['data']['_id'], //delete hook data = _id
53
- });
54
- this.logger.log(result, 'user deleteHook');
55
- break;
47
+ case 'beforeDelete':
48
+ console.log("before delete",data)
49
+ const result = await this.permdoc.deleteMany({
50
+ user_id: data['data'], //delete hook data = _id
51
+ });
52
+ this.logger.log(result, 'user deleteHook');
53
+ break;
54
+ // case 'afterDelete':
55
+
56
+ // break;
56
57
  // case 'beforeFetchRecord':
57
58
  // break;
58
59
  // case 'afterFetchRecord':
@@ -9,7 +9,8 @@
9
9
  <template>
10
10
  <div>
11
11
  <NuxtLayout>
12
- <EventMonitor/>
12
+ <EventDecision/>
13
+ <EventNotification/>
13
14
  <NuxtPage />
14
15
  </NuxtLayout>
15
16
  </div>
@@ -1,12 +1,3 @@
1
- .btn {
2
- @apply p-2 border-2 m-1
3
- }
4
- .btn-primary{
5
- @apply bg-primary-600 text-white
6
- }
7
- .btn-danger{
8
- @apply bg-danger-600 text-white
9
- }
10
- .btn-warning{
11
- @apply bg-danger-600 text-white
12
- }
1
+ .router-link-exact-active{
2
+ @apply bg-primary-100 block
3
+ }
@@ -5,29 +5,33 @@ import Tailwind from "primevue/passthrough/tailwind";
5
5
  const CustomTailwind = usePassThrough(
6
6
  Tailwind,
7
7
  {
8
- button:{
9
- root:{
10
- class:['p-2 m-2 border']
11
- }
8
+
9
+ toast:{
10
+ root:{ class:'w-1/3 '},
11
+ message:{},
12
+ container:{class:'w-full ' },
13
+ content:{class:'flex flex-row-reverse w-full'},
14
+ buttonContainer:{class:'hidden'},
12
15
  },
13
- dialog:{
14
- root:{
15
- class:['bg-white border p-2' ]
16
- }
16
+ card:{root:{class:'shadow p-4'}},
17
+ tabpanel:{headerTitle:{class:'m-3 p-3 bg bg-text-300'},},
18
+ selectbutton:{
19
+ root:{class:'flex flex-row gap-1'},
20
+ button: ({ context }) => ({
21
+ class: ['text-center border rounded p-2 cursor-pointer hover:bg-primary-400 hover:text-white', context.active ? 'bg-primary-600 text-white' : '']
22
+ }),
23
+ label:{class: 'text-sm'},
24
+ },
25
+ button:{root:{class: 'focus:outline-none transition duration-150 ease-in-out rounded px-8 py-2 m-1 border'}},
26
+ dialog:{root:{class:['border p-2']}},
27
+ sidebar:{
28
+ root:{class:'w-1/2 bg-white border p-2 h-full'}
17
29
  },
18
30
  panel: {
19
- root:{
20
- class:['border']
21
- },
22
- title: {
23
- class: ['leading-none font-light text-2xl']
24
- },
25
- header:{
26
- class:['bg bg-gray-200 h-10 content-middle']
27
- },
28
- content:{
29
- class:['']
30
- }
31
+ root:{class:['border']},
32
+ title: {class: ['leading-none font-light text-2xl']},
33
+ header:{class:['bg bg-gray-200 h-10 content-middle']},
34
+ content:{class:['']}
31
35
  }
32
36
  },
33
37
  );
@@ -1,31 +1,38 @@
1
1
  <template>
2
2
  <div>
3
- <Button class="btn-primary " @click="visible = true">
4
- <i class="pi pi-sitemap mr-2"></i>Create My Company
5
- </Button>
6
- <Dialog
7
- v-model:visible="visible"
8
- modal
9
- :header="createtitle"
10
- class="crudsimple-dialog"
11
- >
12
- <form @submit.prevent="true" class="flex flex-col text-center">
13
- <div v-if="errCreateTenant" class="text-error">
14
- {{ errCreateTenant }}
15
- </div>
16
- <InputText
17
- v-else
18
- type="text"
19
- autofocus="true"
20
- v-model:model-value="data.tenantName"
21
- placeholder="Organization Name"
22
- />
23
3
 
24
- <Button class=" btn-primary" type="submit" @click="createTenant" :loading="onhold">
25
- Create <span class="pi pi-save"></span>
4
+ <div class="mt-8 md:flex justify-start md:gap-4">
5
+ <!-- <input placeholder="Company Name"
6
+ class="placeholder-gray-600 dark:bg-gray-800 dark:border-transparent dark:placeholder-gray-200 dark:text-white w-full md:w-1/2 p-4 grid place-items-center border rounded-md focus:outline-none"
7
+ v-model:model-value="data.tenantName"
8
+ /> -->
9
+
10
+ <!-- <button class="">Create</button> -->
11
+ <form @submit.prevent="true" class="flex flex-row text-center">
12
+ <div class="flex flex-col">
13
+ <InputText
14
+ type="text"
15
+ autofocus="true"
16
+ v-model:model-value="data.tenantName"
17
+ placeholder="Organization Name"
18
+ />
19
+ <div v-if="errCreateTenant" class="text-error">{{ errCreateTenant }}</div>
20
+ </div>
21
+ <Button class="w-full md:w-auto bg-primary-800 dark:border-transparent text-white px-8 py-4 border rounded-md hover:bg-primary-800 grid place-items-center font-semibold mt-4 md:mt-0 focus:outline-none focus:ring-2 focus:ring-primary-700 focus:ring-primary-50" type="submit" @click="createTenant" :loading="onhold">
22
+ Create
26
23
  </Button>
27
24
  </form>
28
- </Dialog>
25
+ </div>
26
+
27
+
28
+
29
+
30
+
31
+ <!--
32
+ <Button @click="visible = true" v-bind="$attrs">
33
+ <slot>Create Company</slot>
34
+ </Button> -->
35
+
29
36
  </div>
30
37
 
31
38
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <button class="flex flex-row">
2
+ <button class="flex flex-row" @click="goHome">
3
3
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
4
4
  <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
5
5
  </svg>
@@ -7,4 +7,17 @@
7
7
  <span>{{ getUserProfile().orgName }}</span>
8
8
 
9
9
  </button>
10
- </template>
10
+ </template>
11
+ <script setup lang="ts">
12
+
13
+ const goHome = () =>{
14
+
15
+ if(getCurrentXorg()){
16
+ navigateTo(`/${getCurrentXorg()}`)
17
+ }else{
18
+ navigateTo(`/`)
19
+ }
20
+ }
21
+
22
+
23
+ </script>
@@ -21,13 +21,12 @@ const selectMenu = (menu:MenuData) =>{
21
21
  </button>
22
22
 
23
23
  <Dialog v-model:visible="visible" modal header="Pick Document" >
24
- <div class="desktop-shortcut-link">
25
-
26
- <Button v-for="menu in menus[1].items" @click="selectMenu(menu)">
27
- <div v-if="menu.isolationType == 'none'" class="adminmenu">
24
+ <div class="">
25
+ <Button v-for="menu in menus" @click="selectMenu(menu)">
26
+ <div v-if="menu.isolationType == 'none'" class="">
28
27
  * {{ camelCaseToWords(menu.label) }}
29
28
  </div>
30
- <div v-else class="usermenu">{{ camelCaseToWords(menu.label) }}</div>
29
+ <div v-else class="">{{ camelCaseToWords(menu.label) }}</div>
31
30
  </Button>
32
31
  </div>
33
32
  </Dialog>
@@ -37,19 +36,5 @@ const selectMenu = (menu:MenuData) =>{
37
36
  </div>
38
37
  </template>
39
38
  <style scoped>
40
- .desktop-shortcut-link {
41
- @apply m-2 p-2 space-x-2 rounded-sm text-center grid grid-cols-4 gap-4;
42
- }
43
- .desktop-shortcut-link .adminmenu {
44
- @apply bg-red-300 p-2;
45
- }
46
- .desktop-shortcut-link .adminmenu:hover {
47
- @apply bg-red-600 p-2;
48
- }
49
- .desktop-shortcut-link .usermenu {
50
- @apply bg-teal-300 p-2;
51
- }
52
- .desktop-shortcut-link .usermenu:hover {
53
- @apply bg-teal-600 p-2;
54
- }
39
+
55
40
  </style>
@@ -1,20 +1,18 @@
1
1
  <template>
2
2
 
3
3
  <div>
4
- <Button
5
- class="btn-primary pi pi-question"
6
- @click="previewPermission"
7
- >
8
- </Button>
4
+ <button class="" @click="previewPermission">
5
+ <i class="pi pi-question-circle" ></i>
6
+ </button>
9
7
  <Sidebar
10
8
  v-model:visible="showpermissioninfo"
11
- modal
9
+ modal
12
10
  :header="permissiontitle"
13
11
  position="right"
14
12
  >
15
13
  <SelectButton v-model="selectedgroup" @change="selectGroup" :options="grouplist" option-label="label" option-value="value"></SelectButton>
16
14
  <div v-if="selectedgroup">
17
- <div v-if="useRuntimeConfig().public.DEBUGDATA" class="flex flex-row gap-2 p-2">
15
+ <div v-if="useRuntimeConfig().public.DEBUGDATA" class="flex flex-row gap-2 p-2 ">
18
16
  <div class="flex align-items-center">
19
17
  <RadioButton v-model="mode" inputId="modepreview" name="pizza" value="preview" />
20
18
  <label for="modepreview" class="ml-2">Preview</label>
@@ -5,7 +5,21 @@ import {ref} from 'vue'
5
5
 
6
6
  const userprofileoverlay = ref();
7
7
  const toggle = (event:any) => {
8
- userprofileoverlay.value.toggle(event);
8
+ userprofileoverlay.value.toggle(event);
9
+ }
10
+ const toProfile = ()=>{
11
+ userprofileoverlay.value.toggle();
12
+
13
+ if(getCurrentXorg()){
14
+ navigateTo(`/${getCurrentXorg()}/profile`)
15
+ }else{
16
+ navigateTo(`/profile`)
17
+ }
18
+
19
+ }
20
+ const toFrontpage = () =>{
21
+ userprofileoverlay.value.toggle();
22
+ navigateTo('/')
9
23
  }
10
24
 
11
25
  </script>
@@ -16,37 +30,40 @@ const toggle = (event:any) => {
16
30
 
17
31
  <div class="flex flex-row-reverse cursor-pointer border-none w-full" @click="toggle">
18
32
  <p>{{ getUserProfile().fullName }}</p>
19
- <Avatar :image="getUserStore().getAvatarLink(32)" class="" size="normal" shape="circle" />
33
+ <!-- <Avatar :image="getUserStore().getAvatarLink(32)" class="" size="normal" shape="circle" /> -->
34
+ <div class="w-8 h-8 bg-cover bg-center rounded-md">
35
+ <img :src="getAvatarLink(getUserProfile().email,32)" alt="" class="h-full w-full overflow-hidden object-cover rounded-full border-2 border-white dark:border-gray-700 shadow" />
36
+ </div>
20
37
  </div>
21
38
 
22
39
  </div>
23
- <OverlayPanel ref="userprofileoverlay">
24
- <div class="flex flex-col">
25
- <div class="flex flex-row">
26
- <div class="content-center border">
27
- <Avatar :image="getUserStore().getAvatarLink(60)" class="mr-2" size="xlarge" shape="circle" />
28
- </div>
29
- <div>
30
- <div class="text text-center border">
31
- {{getUserProfile().fullName }}
32
- </div>
33
- <div class="text text-center text-sm border" >
34
- {{getUserProfile().group }}
40
+ <OverlayPanel :pt="{root:{class:'w w-80'}}" ref="userprofileoverlay">
41
+ <div>
42
+ <div class="py-2 transition duration-150 ease-in-out z-10 absolute top-0 right-0 bottom-0 left-0" id="modal">
43
+ <div role="alert" class="container mx-auto w-full md:w-full max-w-lg">
44
+ <div class="relative p-4 md:p-8 bg-white dark:bg-gray-800 shadow-md rounded border border-gray-400">
45
+ <div class="w-full flex items-center justify-start text-gray-600 dark:text-gray-400 mb-5 cursor-pointer" @click="toProfile">
46
+ <div class="w-12 h-12 bg-cover bg-center rounded-md">
47
+ <img :src="getAvatarLink(getUserProfile().email,32)" alt="" class="h-full w-full overflow-hidden object-cover rounded-full border-2 border-white dark:border-gray-700 shadow" />
48
+ </div>
49
+ <div class="flex flex-col cursor-pointer" >
50
+ <h1 class="text-left text-gray-800 dark:text-gray-100 font-lg font-bold tracking-normal leading-tight ml-2">{{ getUserProfile().fullName }}</h1>
51
+ <p class="text-gray-400 dark:text-gray-100 font-normal text-base tracking-normal ml-2 mr-4">{{getUserProfile().group }}</p>
52
+ </div>
53
+
54
+ </div>
55
+
56
+ <div class="flex items-center justify-start w-full">
57
+ <button class="focus:outline-none transition duration-150 ease-in-out hover:bg-gray-600 bg-gray-700 rounded text-white px-8 py-2 text-sm" @click="toFrontpage">Tenant</button>
58
+ <!-- <button class="focus:outline-none transition duration-150 ease-in-out bg-gray-600 rounded text-white px-8 py-2 text-sm" @click="toFrontpage">Pick Tenant</button> -->
59
+ <button class="focus:outline-none ml-3 bg-warning-100 dark:bg-warning-700 dark:border-warning-700 dark:hover:bg-warning-600 transition duration-150 text-gray-600 dark:text-gray-400 ease-in-out hover:border-gray-400 hover:bg-gray-300 border rounded px-8 py-2 text-sm" @click="logout()">Logout</button>
60
+ </div>
35
61
  </div>
36
62
  </div>
37
63
  </div>
38
-
39
-
40
- <div class="flex flex-row gap-2 border">
41
- <Button class="border">
42
- <i class="pi pi-user"></i>profile
43
- </Button>
44
- <Button class="border" @click="logout()">
45
- <i class="pi pi-sign-out"></i>logout
46
- </Button>
64
+
47
65
  </div>
48
-
49
- </div>
66
+
50
67
  </OverlayPanel>
51
68
  </div>
52
69
  </template>
@@ -156,7 +156,7 @@ onNuxtReady(()=>{
156
156
  <DebugDocumentData v-model="data"/>
157
157
  </div>
158
158
 
159
- <Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
159
+ <Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :pt="{root:{class:'h-full w-full bg-white'}}">
160
160
  <SimpleAppForm :document="obj" #default="o">
161
161
  <div class="simpleapp-tool-bar col-span-4 text-left gap-4" >
162
162
  <Button class=" btn-default" :disabled="disabled" @click="newData" type="button" v-if="canPerform(resourcename,'create')">New</Button>
@@ -0,0 +1,115 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * This file was automatically generated by simpleapp generator during initialization.
4
+ * DO NOT MODIFY IT BY HAND.
5
+ * last change 2023-09-09
6
+ * author: Ks Tan
7
+ */
8
+ import {Notification, EventType} from '~/types'
9
+ import { useToast, } from 'primevue/usetoast';
10
+ import type { ToastMessageOptions } from 'primevue/toast';
11
+ import Toast from 'primevue/toast';
12
+ import { stringify } from 'ajv';
13
+ import {upperFirst, last } from 'lodash'
14
+
15
+ // const toast = useToast();
16
+ // const { $event,$listen } = useNuxtApp()
17
+ // WildcardHandler<Record<EventType, unknown>>
18
+ // let resmsg:ToastMessageOptions = {} as ToastMessageOptions
19
+
20
+
21
+ // $listen('*',(type:key of EventType,data:any)=>{
22
+ // console.log("Event type",type,'data',data)
23
+ // let arrupdate = type.split(':')
24
+ // let eventdata = data
25
+ // let duration = 3000
26
+ // let severity:typeof resmsg['severity']
27
+ // let isshow=true
28
+ // let toastgroup='default'
29
+ // let eventname = arrupdate[1]
30
+ // let eventtype = arrupdate[0]
31
+ // let title = ''
32
+ // if(type.indexOf('error')>=0){
33
+ // duration = 0
34
+ // severity='error'
35
+ // title=upperFirst(eventname) +' failed'
36
+ // }
37
+ // else if(type.indexOf('warn')>=0){
38
+ // duration = 10000
39
+ // severity='warn'
40
+ // title=upperFirst(eventname) +' with warning'
41
+ // }
42
+ // else if(type.indexOf('info')>=0){
43
+ // duration = 3000
44
+ // severity='info'
45
+ // isshow=false
46
+ // title='Info'
47
+ // }
48
+ // else if(type.indexOf('success')>=0){
49
+ // duration = 3000
50
+ // severity='success'
51
+ // title= upperFirst(eventname) +' successfully'
52
+ // }
53
+ // if(Array.isArray(data)){
54
+ // toastgroup='list'
55
+ // }else if(typeof data == 'object'){
56
+ // // title = camelCaseToWords(useCamelCase(title.replace(":","-")))
57
+ // eventdata = data.message
58
+ // }
59
+
60
+
61
+ // if(isshow && severity){
62
+ // console.log("isshow",isshow,"event:",severity,eventdata)
63
+ // toast.removeAllGroups()
64
+ // resmsg = { severity: severity, summary: title, detail :eventdata, life: duration, group:toastgroup}
65
+ // toast.add(resmsg)
66
+ // }
67
+ // isshow=false
68
+
69
+ // })
70
+
71
+
72
+ // const getFieldName = (path:string)=>{
73
+ // const lastword :string= last<string>(path.split('/'))??''
74
+ // return camelCaseToWords(lastword)
75
+ // // const lastField = path.split
76
+ // }
77
+ </script>
78
+ <template>
79
+ <div></div>
80
+ <!-- <Toast group="default" :pt="{}">
81
+ <template #message="p">
82
+ <div class="bg-gray-200 dark:bg-gray-900 h-full w-full border">
83
+ <div class=" flex content content-end w-full">
84
+ <div role="alert" class="w-full bg-white dark:bg-gray-800 shadow-lg rounded flex flex-row transition duration-150 ease-in-out" id="notification">
85
+ <div class=" flex items-center justify-center bg-primary-500 sm:rounded-tl sm:rounded-bl h-12 sm:h-auto sm:w-auto text-white">
86
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" fill="currentColor">
87
+ <path class="heroicon-ui" d="M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-2.3-8.7l1.3 1.29 3.3-3.3a1 1 0 0 1 1.4 1.42l-4 4a1 1 0 0 1-1.4 0l-2-2a1 1 0 0 1 1.4-1.42z" />
88
+ </svg>
89
+ </div>
90
+ <div class="flex flex-col justify-center pl-4 xl:pl-1 w-96 pt-4 sm:pb-4 pb-2">
91
+ <p class="text-lg text-gray-800 dark:text-gray-100 font-semibold pb-1">{{ p.message.summary }}</p>
92
+ <p class="text-sm text-gray-600 dark:text-gray-400 font-normal"></p>
93
+ </div>
94
+ <div class="flex sm:flex-col sm:justify-center sm:border-l dark:border-gray-700 w w-36 items-center border-gray-300 pl-4">
95
+ <div class="sm:pt-4 pb-4 sm:border-b dark:border-gray-700 border-gray-300 w w-full flex sm:justify-center">
96
+ <span class="sm:text-sm text-xs text-green-400 font-bold mr-4 sm:mr-0 cursor-pointer">View</span>
97
+ </div>
98
+ <div class="sm:pt-4 pb-4 flex sm:justify-center w w-full cursor-pointer" >
99
+ <span class="sm:text-sm text-xs text-gray-600 dark:text-gray-400 cursor-pointer" @click="toast.remove(p.message)">Dismiss</span>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </template>
106
+ </Toast>
107
+ <Toast group="list">
108
+ <template #message="p">
109
+
110
+ <ol>
111
+ <li v-for="(item,index) in p.message.detail" :key="index"><b>{{getFieldName(item.instancePath)}}</b>: {{ item.message }}</li>
112
+ </ol>
113
+ </template>
114
+ </Toast> -->
115
+ </template>