44 <component
55 v-for =" c in coreStore?.resourceOptions?.pageInjections?.create?.beforeBreadcrumbs || []"
66 :is =" getCustomComponent(c)"
7- :meta =" c .meta"
7+ :meta =" (c as AdminForthComponentDeclarationFull) .meta"
88 :record =" coreStore.record"
99 :resource =" coreStore.resource"
1010 :adminUser =" coreStore.adminUser"
3131 </button >
3232
3333 <ThreeDotsMenu
34- :threeDotsDropdownItems =" coreStore.resourceOptions?.pageInjections?.create?.threeDotsDropdownItems"
34+ :threeDotsDropdownItems =" Array.isArray(coreStore.resourceOptions?.pageInjections?.create?.threeDotsDropdownItems)
35+ ? coreStore.resourceOptions?.pageInjections?.create?.threeDotsDropdownItems
36+ : coreStore.resourceOptions?.pageInjections?.create?.threeDotsDropdownItems
37+ ? [coreStore.resourceOptions?.pageInjections?.create?.threeDotsDropdownItems]
38+ : []"
3539 ></ThreeDotsMenu >
3640
3741 </BreadcrumbsWithButtons >
3842
3943 <component
4044 v-for =" c in coreStore?.resourceOptions?.pageInjections?.create?.afterBreadcrumbs || []"
4145 :is =" getCustomComponent(c)"
42- :meta =" c .meta"
46+ :meta =" (c as AdminForthComponentDeclarationFull) .meta"
4347 :record =" coreStore.record"
4448 :resource =" coreStore.resource"
4549 :adminUser =" coreStore.adminUser"
5155 <ResourceForm
5256 v-else
5357 :record =" record"
54- :resource =" coreStore.resource"
58+ :resource =" coreStore.resource! "
5559 @update:record =" onUpdateRecord"
5660 @update:isValid =" isValid = $event"
5761 :validating =" validating"
6367 <component
6468 v-for =" c in coreStore?.resourceOptions?.pageInjections?.create?.bottom || []"
6569 :is =" getCustomComponent(c)"
66- :meta =" c .meta"
70+ :meta =" (c as AdminForthComponentDeclarationFull) .meta"
6771 :record =" coreStore.record"
6872 :resource =" coreStore.resource"
6973 :adminUser =" coreStore.adminUser"
@@ -88,6 +92,7 @@ import { showErrorTost } from '@/composables/useFrontendApi';
8892import ThreeDotsMenu from ' @/components/ThreeDotsMenu.vue' ;
8993import adminforth from ' @/adminforth' ;
9094import { useI18n } from ' vue-i18n' ;
95+ import { type AdminForthComponentDeclarationFull } from ' @/types/Common.js' ;
9196
9297const isValid = ref (false );
9398const validating = ref (false );
@@ -109,31 +114,31 @@ const initialValues = ref({});
109114const readonlyColumns = ref ([]);
110115
111116
112- async function onUpdateRecord(newRecord ) {
117+ async function onUpdateRecord(newRecord : any ) {
113118 console .log (' newRecord' , newRecord );
114119 record .value = newRecord ;
115120}
116121
117122onMounted (async () => {
118123 loading .value = true ;
119124 await coreStore .fetchResourceFull ({
120- resourceId: route .params .resourceId
125+ resourceId: route .params .resourceId as string // POTENTIONAL PROBLEM: resourceId can requires only <sting> type, but inside params.resourceId can be string[]
121126 });
122- initialValues .value = (coreStore .resource ?.columns || []).reduce ((acc , column ) => {
127+ initialValues .value = (coreStore .resource ?.columns || []).reduce < Record < string , unknown >> ((acc , column ) => {
123128 if (column .suggestOnCreate !== undefined ) {
124129 acc [column .name ] = column .suggestOnCreate ;
125130 }
126131 return acc ;
127132 }, {});
128133 if (route .query .values ) {
129- initialValues .value = { ... initialValues .value , ... JSON .parse (decodeURIComponent (route .query .values )) };
134+ initialValues .value = { ... initialValues .value , ... JSON .parse (decodeURIComponent (route .query .values as string )) };
130135 }
131136 if (route .query .readonlyColumns ) {
132- readonlyColumns .value = JSON .parse (decodeURIComponent (route .query .readonlyColumns ));
137+ readonlyColumns .value = JSON .parse (decodeURIComponent (route .query .readonlyColumns as string ));
133138 }
134139 record .value = initialValues .value ;
135140 loading .value = false ;
136- checkAcessByAllowedActions (coreStore .resourceOptions .allowedActions ,' create' );
141+ checkAcessByAllowedActions (coreStore .resourceOptions ! .allowedActions ,' create' );
137142 initThreeDotsDropdown ();
138143});
139144
@@ -159,7 +164,7 @@ async function saveRecord() {
159164 }
160165 saving .value = false ;
161166 if (route .query .returnTo ) {
162- router .push (route .query .returnTo );
167+ router .push (< string > route .query .returnTo );
163168 } else {
164169 router .push ({
165170 name: ' resource-show' ,
0 commit comments