@escalated-dev/escalated 0.11.7 → 0.11.8
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/LICENSE +1 -1
- package/README.md +3 -1
- package/package.json +1 -1
- package/pages.json +1 -1
- package/src/pages/Admin/CustomObjects/Records.vue +18 -11
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
<div align="center">
|
|
24
24
|
|
|
25
25
|
[](https://github.com/escalated-dev/escalated/actions/workflows/run-tests.yml)[](https://www.npmjs.com/package/@escalated-dev/escalated)
|
|
26
|
+
[](https://www.npmjs.com/package/@escalated-dev/escalated)
|
|
26
27
|
[](https://vuejs.org/)
|
|
27
28
|
[](https://opensource.org/licenses/MIT)
|
|
29
|
+
[](https://hits.sh/github.com/escalated-dev/escalated/)
|
|
28
30
|
|
|
29
31
|
</div>
|
|
30
32
|
|
|
@@ -385,4 +387,4 @@ This is the shared frontend for the Escalated support ticket system. Host framew
|
|
|
385
387
|
|
|
386
388
|
## License
|
|
387
389
|
|
|
388
|
-
MIT
|
|
390
|
+
MIT - Copyright (c) Escalated.dev. See [LICENSE](LICENSE).
|
package/package.json
CHANGED
package/pages.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "Generated by scripts/generate-page-manifest.js from src/pages. Every name here resolves to a component; a name a backend renders that is not here is a blank screen. `props` is what each component reads -- a backend sending something else renders the screen with no content in it.",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
4
4
|
"pages": [
|
|
5
5
|
"Escalated/Admin/ApiTokens/Index",
|
|
6
6
|
"Escalated/Admin/AuditLog/Index",
|
|
@@ -12,20 +12,27 @@ const fields = computed(() => props.object.fields_schema || []);
|
|
|
12
12
|
const editingId = ref(null);
|
|
13
13
|
const showAddForm = ref(false);
|
|
14
14
|
|
|
15
|
+
// The record's field values travel as `data`, which is what every backend
|
|
16
|
+
// validates. They cannot live under that name on the form itself: `data()` is
|
|
17
|
+
// one of useForm's own methods, Inertia refuses the field (and logs an error),
|
|
18
|
+
// and assigning to it replaced the method the form submits with. They are kept
|
|
19
|
+
// as `values` and renamed on the way out.
|
|
20
|
+
const toRecordBody = (form) => ({ data: form.values });
|
|
21
|
+
|
|
15
22
|
const newRecordForm = useForm({
|
|
16
|
-
|
|
17
|
-
});
|
|
23
|
+
values: {},
|
|
24
|
+
}).transform(toRecordBody);
|
|
18
25
|
|
|
19
26
|
const editForm = useForm({
|
|
20
|
-
|
|
21
|
-
});
|
|
27
|
+
values: {},
|
|
28
|
+
}).transform(toRecordBody);
|
|
22
29
|
|
|
23
30
|
function startAdd() {
|
|
24
31
|
const data = {};
|
|
25
32
|
fields.value.forEach((f) => {
|
|
26
33
|
data[f.name] = '';
|
|
27
34
|
});
|
|
28
|
-
newRecordForm.
|
|
35
|
+
newRecordForm.values = data;
|
|
29
36
|
showAddForm.value = true;
|
|
30
37
|
}
|
|
31
38
|
|
|
@@ -41,7 +48,7 @@ function addRecord() {
|
|
|
41
48
|
|
|
42
49
|
function startEdit(record) {
|
|
43
50
|
editingId.value = record.id;
|
|
44
|
-
editForm.
|
|
51
|
+
editForm.values = { ...(record.data || {}) };
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
function saveEdit(record) {
|
|
@@ -96,7 +103,7 @@ function deleteRecord(record) {
|
|
|
96
103
|
</label>
|
|
97
104
|
<select
|
|
98
105
|
v-if="field.type === 'select'"
|
|
99
|
-
v-model="newRecordForm.
|
|
106
|
+
v-model="newRecordForm.values[field.name]"
|
|
100
107
|
class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
|
|
101
108
|
>
|
|
102
109
|
<option value="">Select...</option>
|
|
@@ -104,19 +111,19 @@ function deleteRecord(record) {
|
|
|
104
111
|
</select>
|
|
105
112
|
<input
|
|
106
113
|
v-else-if="field.type === 'date'"
|
|
107
|
-
v-model="newRecordForm.
|
|
114
|
+
v-model="newRecordForm.values[field.name]"
|
|
108
115
|
type="date"
|
|
109
116
|
class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
|
|
110
117
|
/>
|
|
111
118
|
<input
|
|
112
119
|
v-else-if="field.type === 'number'"
|
|
113
|
-
v-model="newRecordForm.
|
|
120
|
+
v-model="newRecordForm.values[field.name]"
|
|
114
121
|
type="number"
|
|
115
122
|
class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
|
|
116
123
|
/>
|
|
117
124
|
<input
|
|
118
125
|
v-else
|
|
119
|
-
v-model="newRecordForm.
|
|
126
|
+
v-model="newRecordForm.values[field.name]"
|
|
120
127
|
type="text"
|
|
121
128
|
class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
|
|
122
129
|
/>
|
|
@@ -171,7 +178,7 @@ function deleteRecord(record) {
|
|
|
171
178
|
<!-- Edit mode -->
|
|
172
179
|
<template v-if="editingId === record.id">
|
|
173
180
|
<input
|
|
174
|
-
v-model="editForm.
|
|
181
|
+
v-model="editForm.values[field.name]"
|
|
175
182
|
:type="field.type === 'number' ? 'number' : field.type === 'date' ? 'date' : 'text'"
|
|
176
183
|
class="w-full rounded border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] px-2 py-1 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none"
|
|
177
184
|
/>
|