Skip to content

Commit 2172c9c

Browse files
committed
Merge branch 'release-2025-winter' into release-2025-spring
2 parents 07a3f0b + 980282c commit 2172c9c

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

src/components/inspector/collection-display-mode.vue

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,37 @@ export default {
4141
data() {
4242
return {
4343
mode: "",
44-
submitCollectionCheck: null
44+
submitCollectionCheck: null,
45+
defaultMode: 'Edit',
4546
};
4647
},
4748
computed: {
4849
showCollectionCheck() {
49-
return this.mode === "Edit";
50+
return this.mode === this.defaultMode;
51+
}
52+
},
53+
watch: {
54+
value: {
55+
handler(newValue) {
56+
this.updateModeAndCollectionCheck(newValue);
57+
},
58+
deep: true,
5059
}
5160
},
5261
mounted() {
53-
// Set the defaulta data
54-
this.mode = this.value.modeId || "Edit";
55-
this.submitCollectionCheck =
56-
this.value.submitCollectionCheck !== undefined
57-
? this.value.submitCollectionCheck
58-
: true;
62+
// Set the default data
63+
this.updateModeAndCollectionCheck(this.value);
5964
},
6065
methods: {
66+
/**
67+
* Update the mode and collection check value
68+
*
69+
* @param {Object} value
70+
*/
71+
updateModeAndCollectionCheck(value) {
72+
this.mode = value.modeId || this.defaultMode;
73+
this.submitCollectionCheck = value.submitCollectionCheck ?? true;
74+
},
6175
saveFields() {
6276
this.$emit("input", {
6377
modeId: this.mode,

src/components/inspector/collection-records-list.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
data-cy="inspector-collection"
1111
/>
1212
<b-form-text class="mt-2">
13-
{{ $t("Collection Record Control is not available for Anonymous Web Entry") }}
13+
{{ $t("Collection Record Control is not available for Anonymous Web Entry") }}
1414
</b-form-text>
1515
</b-form-group>
1616
</div>
1717
<div v-if="collectionId > 0" class="screen-link mt-2">
18-
<a
18+
<a
1919
:href="`/designer/screen-builder/${
2020
screenMode === 'display' ? idCollectionScreenView : idCollectionScreenEdit
21-
}/edit`"
21+
}/edit`"
2222
target="_blank">
2323
{{ $t(screenMode === 'display' ? "Open View Screen" : "Open Edit Screen") }}
2424
<i class="ml-1 fas fa-external-link-alt" />
@@ -67,11 +67,15 @@ export default {
6767
},
6868
watch: {
6969
value: {
70-
handler(value) {
71-
if (!value) {
70+
handler(newValue) {
71+
if (!newValue) {
72+
// Clear collection id
73+
this.collectionId = null;
74+
7275
return;
7376
}
74-
CONFIG_FIELDS.forEach((field) => (this[field] = value[field]));
77+
78+
CONFIG_FIELDS.forEach((field) => (this[field] = newValue[field]));
7579
},
7680
immediate: true
7781
},

src/components/renderer/form-collection-record-control.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export default {
6363
flagDraft: {},
6464
taskDraft: {},
6565
enableDraft: true,
66-
defaultColumnsRecordId: 1
66+
defaultColumnsRecordId: 1,
67+
defaultCollectionMode: 'Edit',
6768
};
6869
},
6970
computed: {
@@ -148,13 +149,17 @@ export default {
148149
const recordId = this.isMustache(this.record)
149150
? this.defaultColumnsRecordId
150151
: this.record;
152+
151153
if (this.isMustache(this.record)) {
152154
this.hasMustache = true;
153155
}
156+
157+
const collectionMode = this.collectionmode?.modeId ?? this.defaultCollectionMode;
158+
154159
this.loadRecordCollection(
155160
this.collection.collectionId,
156161
recordId,
157-
this.collectionmode.modeId
162+
collectionMode,
158163
);
159164
}
160165
},

0 commit comments

Comments
 (0)