adminforth 1.1.38 → 1.1.40
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/dist/index.js
CHANGED
|
@@ -991,7 +991,7 @@ class AdminForth {
|
|
|
991
991
|
return { error: `Record with ${primaryKeyColumn.name} ${recordId} not found` };
|
|
992
992
|
}
|
|
993
993
|
const record = body['record'];
|
|
994
|
-
const { allowedActions } = yield interpretResource(adminUser, resource, { requestBody: body, record, oldRecord }, ActionCheckSource.EditRequest);
|
|
994
|
+
const { allowedActions } = yield interpretResource(adminUser, resource, { requestBody: body, newRecord: record, oldRecord }, ActionCheckSource.EditRequest);
|
|
995
995
|
const { allowed, error } = checkAccess(AllowedActionsEnum.edit, allowedActions);
|
|
996
996
|
if (!allowed) {
|
|
997
997
|
return { error };
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<th scope="col" class="p-4">
|
|
30
30
|
<div v-if="rows && rows.length" class="flex items-center">
|
|
31
31
|
<input id="checkbox-all-search" type="checkbox" :checked="allFromThisPageChecked" @change="selectAll()"
|
|
32
|
-
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
32
|
+
class="w-4 h-4 cursor-pointer text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
33
33
|
<label for="checkbox-all-search" class="sr-only">checkbox</label>
|
|
34
34
|
</div>
|
|
35
35
|
</th>
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
|
|
121
121
|
<tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
|
|
122
122
|
class="bg-list-view-table-bg border-b dark:bg-gray-800 border-list-view-border-color dark:border-gray-700 hover:bg-list-view-table-row-hover dark:hover:bg-gray-600 cursor-pointer">
|
|
123
|
-
<td class="w-4 p-4">
|
|
124
|
-
<div class="flex items center">
|
|
123
|
+
<td class="w-4 p-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
|
|
124
|
+
<div class="flex items center ">
|
|
125
125
|
<input
|
|
126
126
|
@click="(e)=>{e.stopPropagation()}"
|
|
127
127
|
id="checkbox-table-search-1"
|
|
128
128
|
type="checkbox"
|
|
129
129
|
:checked="checkboxesInternal.includes(row.id)"
|
|
130
130
|
@change="(e)=>{addToCheckedValues(row.id)}"
|
|
131
|
-
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
131
|
+
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 cursor-pointer">
|
|
132
132
|
<label for="checkbox-table-search-1" class="sr-only">checkbox</label>
|
|
133
133
|
</div>
|
|
134
134
|
</td>
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
:resource="resource"
|
|
144
144
|
/>
|
|
145
145
|
</td>
|
|
146
|
-
<td class=" items-center px-6 py-4" @click="(e)=>{e.stopPropagation()}">
|
|
146
|
+
<td class=" items-center px-6 py-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
|
|
147
147
|
<div class="flex">
|
|
148
148
|
<RouterLink
|
|
149
149
|
v-if="resource.options?.allowedActions.show"
|
|
@@ -390,10 +390,9 @@ function onSortButtonClick(field) {
|
|
|
390
390
|
|
|
391
391
|
const clickTarget = ref(null);
|
|
392
392
|
async function onClick(e,row) {
|
|
393
|
-
console.log(e,row)
|
|
394
393
|
if(clickTarget.value === e.target) return;
|
|
395
394
|
clickTarget.value = e.target;
|
|
396
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
395
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
397
396
|
if (window.getSelection().toString()) return;
|
|
398
397
|
else {router.push({
|
|
399
398
|
name: 'resource-show',
|
package/index.ts
CHANGED
|
@@ -1132,7 +1132,7 @@ class AdminForth implements AdminForthClass {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
const record = body['record'];
|
|
1134
1134
|
|
|
1135
|
-
const { allowedActions } = await interpretResource(adminUser, resource, { requestBody: body, record, oldRecord}, ActionCheckSource.EditRequest);
|
|
1135
|
+
const { allowedActions } = await interpretResource(adminUser, resource, { requestBody: body, newRecord: record, oldRecord}, ActionCheckSource.EditRequest);
|
|
1136
1136
|
|
|
1137
1137
|
const { allowed, error } = checkAccess(AllowedActionsEnum.edit, allowedActions);
|
|
1138
1138
|
if (!allowed) {
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<th scope="col" class="p-4">
|
|
30
30
|
<div v-if="rows && rows.length" class="flex items-center">
|
|
31
31
|
<input id="checkbox-all-search" type="checkbox" :checked="allFromThisPageChecked" @change="selectAll()"
|
|
32
|
-
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
32
|
+
class="w-4 h-4 cursor-pointer text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
33
33
|
<label for="checkbox-all-search" class="sr-only">checkbox</label>
|
|
34
34
|
</div>
|
|
35
35
|
</th>
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
|
|
121
121
|
<tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
|
|
122
122
|
class="bg-list-view-table-bg border-b dark:bg-gray-800 border-list-view-border-color dark:border-gray-700 hover:bg-list-view-table-row-hover dark:hover:bg-gray-600 cursor-pointer">
|
|
123
|
-
<td class="w-4 p-4">
|
|
124
|
-
<div class="flex items center">
|
|
123
|
+
<td class="w-4 p-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
|
|
124
|
+
<div class="flex items center ">
|
|
125
125
|
<input
|
|
126
126
|
@click="(e)=>{e.stopPropagation()}"
|
|
127
127
|
id="checkbox-table-search-1"
|
|
128
128
|
type="checkbox"
|
|
129
129
|
:checked="checkboxesInternal.includes(row.id)"
|
|
130
130
|
@change="(e)=>{addToCheckedValues(row.id)}"
|
|
131
|
-
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
131
|
+
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 cursor-pointer">
|
|
132
132
|
<label for="checkbox-table-search-1" class="sr-only">checkbox</label>
|
|
133
133
|
</div>
|
|
134
134
|
</td>
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
:resource="resource"
|
|
144
144
|
/>
|
|
145
145
|
</td>
|
|
146
|
-
<td class=" items-center px-6 py-4" @click="(e)=>{e.stopPropagation()}">
|
|
146
|
+
<td class=" items-center px-6 py-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
|
|
147
147
|
<div class="flex">
|
|
148
148
|
<RouterLink
|
|
149
149
|
v-if="resource.options?.allowedActions.show"
|
|
@@ -390,10 +390,9 @@ function onSortButtonClick(field) {
|
|
|
390
390
|
|
|
391
391
|
const clickTarget = ref(null);
|
|
392
392
|
async function onClick(e,row) {
|
|
393
|
-
console.log(e,row)
|
|
394
393
|
if(clickTarget.value === e.target) return;
|
|
395
394
|
clickTarget.value = e.target;
|
|
396
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
395
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
397
396
|
if (window.getSelection().toString()) return;
|
|
398
397
|
else {router.push({
|
|
399
398
|
name: 'resource-show',
|