adminforth 1.1.3 → 1.1.4
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/package.json
CHANGED
|
@@ -30,7 +30,7 @@ const loading = ref(true);
|
|
|
30
30
|
const page = ref(1);
|
|
31
31
|
const sort = ref([]);
|
|
32
32
|
const checkboxes = ref([]);
|
|
33
|
-
const pageSize = computed(() => props.meta.
|
|
33
|
+
const pageSize = computed(() => props.meta.tablePageSize || 10);
|
|
34
34
|
|
|
35
35
|
const rows = ref(null);
|
|
36
36
|
const totalRows = ref(0);
|
|
@@ -41,7 +41,6 @@ const filters = computed(() => {
|
|
|
41
41
|
if (!listResource.value) {
|
|
42
42
|
return [];
|
|
43
43
|
}
|
|
44
|
-
console.log('listResource', listResource.value)
|
|
45
44
|
// get name of the column that is foreign key
|
|
46
45
|
const refColumn = listResource.value.columns.find(c => c.foreignResource?.resourceId === props.resource.resourceId);
|
|
47
46
|
|
|
@@ -49,8 +48,8 @@ const filters = computed(() => {
|
|
|
49
48
|
|
|
50
49
|
if (!refColumn) {
|
|
51
50
|
window.adminforth.alert({
|
|
52
|
-
message: `Column with foreignResource.resourceId which is equal to ${props.resource.resourceId} not found in resource which is specified as foreighResourceId
|
|
53
|
-
variant: '
|
|
51
|
+
message: `Column with foreignResource.resourceId which is equal to '${props.resource.resourceId}' not found in resource which is specified as foreighResourceId '${listResource.value.resourceId}'`,
|
|
52
|
+
variant: 'danger',
|
|
54
53
|
});
|
|
55
54
|
return [];
|
|
56
55
|
}
|
|
@@ -104,7 +103,7 @@ onMounted( async () => {
|
|
|
104
103
|
method: 'POST',
|
|
105
104
|
body: {
|
|
106
105
|
resourceId: foreighResourceId,
|
|
107
|
-
}
|
|
106
|
+
},
|
|
108
107
|
})).resource;
|
|
109
108
|
loading.value = false;
|
|
110
109
|
await getList();
|
|
@@ -4,6 +4,8 @@ import AdminForth from "../../index.js";
|
|
|
4
4
|
|
|
5
5
|
type PluginOptions = {
|
|
6
6
|
foreignResourceId: string;
|
|
7
|
+
tablePageSize: number;
|
|
8
|
+
modifyTableResourceConfig?: (resourceConfig: AdminForthResource) => void;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export default class ForeignInlineListPlugin extends AdminForthPlugin {
|
|
@@ -12,9 +14,7 @@ export default class ForeignInlineListPlugin extends AdminForthPlugin {
|
|
|
12
14
|
|
|
13
15
|
constructor(options: PluginOptions) {
|
|
14
16
|
super(options, import.meta.url);
|
|
15
|
-
|
|
16
17
|
this.options = options;
|
|
17
|
-
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
modifyResourceConfig(adminforth: AdminForth, resourceConfig: AdminForthResource) {
|