Skip to content

Commit dc4df67

Browse files
authored
Merge branch '2024.9.x-combined-branch' into 2024.9.x-feature-group-blocks
Signed-off-by: Toocky - APIpie.ai <115723035+Toocky@users.noreply.github.com>
2 parents 362f68b + 669f351 commit dc4df67

27 files changed

Lines changed: 3430 additions & 1232 deletions

File tree

client/web/compose/src/components/Common/FieldPicker.vue

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
<template
2222
v-if="field.label"
2323
>
24-
{{ field.label }} ({{ field.name }})
24+
{{ field.label }}
25+
<template v-if="field.originalName">
26+
({{ field.originalName }})
27+
</template>
2528
</template>
2629
<template
2730
v-else
2831
>
29-
{{ field.name }}
32+
{{ field.originalName || field.name }}
3033
</template>
3134
<template
3235
v-if="field.isRequired"
@@ -40,6 +43,12 @@
4043
>
4144
{{ $t('selector.systemField') }}
4245
</small>
46+
<small
47+
v-if="field.isParentField"
48+
class="cursor-default ml-1 text-truncate text-primary"
49+
>
50+
{{ field.parentModuleName }}
51+
</small>
4352
</template>
4453
</c-item-picker>
4554
</div>
@@ -95,6 +104,18 @@ export default {
95104
type: Array,
96105
default: null,
97106
},
107+
108+
// NEW: optional parent module object
109+
extraModule: {
110+
type: Object,
111+
default: null,
112+
},
113+
114+
// NEW: array of field objects from the parent module
115+
extraModuleFields: {
116+
type: Array,
117+
default: () => [],
118+
},
98119
},
99120
100121
computed: {
@@ -153,8 +174,10 @@ export default {
153174
mFields.sort((a, b) => a.label.localeCompare(b.label))
154175
}
155176
177+
// Build base options from child module fields
178+
let baseOptions = []
156179
if (mFields && sysFields) {
157-
return [
180+
baseOptions = [
158181
...[...mFields],
159182
...sysFields,
160183
].map(field => ({
@@ -169,7 +192,7 @@ export default {
169192
field,
170193
}))
171194
} else {
172-
return Object.keys(this.module).map(key => {
195+
baseOptions = Object.keys(this.module).map(key => {
173196
return this.module[key]
174197
}).map(f => ({
175198
...f,
@@ -178,6 +201,32 @@ export default {
178201
},
179202
}))
180203
}
204+
205+
// Build parent module field options (if extraModule and extraModuleFields are provided)
206+
const extraFieldOptions = (this.extraModule && this.extraModuleFields.length > 0)
207+
? this.extraModuleFields.map(field => {
208+
// Use moduleID::fieldName as the unique key to avoid name collisions
209+
const uniqueName = `${this.extraModule.moduleID}::${field.name}`
210+
return {
211+
value: uniqueName,
212+
text: [field.name, field.label, field.kind, this.extraModule.name].join(' '),
213+
field: {
214+
...field,
215+
// Override name with the namespaced version for storage/lookup
216+
name: uniqueName,
217+
label: field.label || field.name,
218+
// Flags and metadata for downstream use
219+
isParentField: true,
220+
parentModuleID: this.extraModule.moduleID,
221+
parentModuleName: this.extraModule.name,
222+
originalName: field.name,
223+
},
224+
}
225+
})
226+
: []
227+
228+
// Concat extra options after the base options
229+
return [...baseOptions, ...extraFieldOptions]
181230
},
182231
},
183232
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<template>
2+
<div>
3+
<b-form-checkbox
4+
v-model="f.options.dynamicMode"
5+
v-b-tooltip.noninteractive.hover="{ title: $t('kind.link.dynamicModeTooltip'), boundary: 'viewport' }"
6+
>
7+
{{ $t('kind.link.dynamicMode') }}
8+
</b-form-checkbox>
9+
10+
<div
11+
v-if="!f.options.dynamicMode"
12+
class="ml-4 mb-3"
13+
>
14+
<div>
15+
<label>{{ $t('kind.link.protocol') }}</label>
16+
<b-form-select
17+
v-model="f.options.tempProtocol"
18+
:options="protocolOptions"
19+
@change="onProtocolChange"
20+
/>
21+
</div>
22+
23+
<div
24+
v-if="f.options.tempProtocol === '__CUSTOM__'"
25+
class="mt-2"
26+
>
27+
<div>
28+
<label>{{ $t('kind.link.customProtocol') }}</label>
29+
<b-form-input
30+
v-model="f.options.customProtocol"
31+
placeholder="e.g., skype:"
32+
/>
33+
</div>
34+
</div>
35+
</div>
36+
37+
<div v-if="showURLOptions">
38+
<div>
39+
<b-form-checkbox v-model="f.options.trimPath">
40+
{{ $t('kind.url.label') }}
41+
</b-form-checkbox>
42+
</div>
43+
<div>
44+
<b-form-checkbox v-model="f.options.trimFragment">
45+
{{ $t('kind.url.trimHash') }}
46+
</b-form-checkbox>
47+
</div>
48+
<div>
49+
<b-form-checkbox v-model="f.options.trimQuery">
50+
{{ $t('kind.url.trimQuestionMark') }}
51+
</b-form-checkbox>
52+
</div>
53+
<div>
54+
<b-form-checkbox v-model="f.options.onlySecure">
55+
{{ $t('kind.url.sshOnly') }}
56+
</b-form-checkbox>
57+
</div>
58+
</div>
59+
60+
<div>
61+
<b-form-checkbox v-model="f.options.outputPlain">
62+
{{ $t('kind.link.preventToLink') }}
63+
</b-form-checkbox>
64+
</div>
65+
</div>
66+
</template>
67+
68+
<script>
69+
import base from './base'
70+
71+
export default {
72+
i18nOptions: {
73+
namespaces: 'field',
74+
},
75+
76+
extends: base,
77+
78+
data () {
79+
return {
80+
tempProtocol: '',
81+
}
82+
},
83+
84+
computed: {
85+
isStaticURL () {
86+
return !this.f.options.dynamicMode && this.f.options.tempProtocol === 'https://'
87+
},
88+
89+
showURLOptions () {
90+
return this.f.options.dynamicMode || this.isStaticURL
91+
},
92+
93+
protocolOptions () {
94+
return [
95+
{ text: this.$t('kind.link.protocolOptions.none'), value: '' },
96+
{ text: this.$t('kind.link.protocolOptions.mailto'), value: 'mailto:' },
97+
{ text: this.$t('kind.link.protocolOptions.tel'), value: 'tel:' },
98+
{ text: this.$t('kind.link.protocolOptions.url'), value: 'https://' },
99+
{ text: this.$t('kind.link.protocolOptions.skype'), value: 'skype:' },
100+
{ text: this.$t('kind.link.protocolOptions.msteams'), value: 'msteams:' },
101+
{ text: this.$t('kind.link.protocolOptions.slack'), value: 'slack://' },
102+
{ text: this.$t('kind.link.protocolOptions.sms'), value: 'sms:' },
103+
{ text: this.$t('kind.link.protocolOptions.facetime'), value: 'facetime:' },
104+
{ text: this.$t('kind.link.protocolOptions.zoommtg'), value: 'zoommtg://' },
105+
{ text: this.$t('kind.link.protocolOptions.whatsapp'), value: 'whatsapp://' },
106+
{ text: this.$t('kind.link.protocolOptions.signal'), value: 'sgnl:' },
107+
{ text: this.$t('kind.link.protocolOptions.fb'), value: 'fb://' },
108+
{ text: this.$t('kind.link.protocolOptions.fbmessenger'), value: 'fb-messenger://' },
109+
{ text: this.$t('kind.link.protocolOptions.instagram'), value: 'instagram://' },
110+
{ text: this.$t('kind.link.protocolOptions.twitter'), value: 'twitter://' },
111+
{ text: this.$t('kind.link.protocolOptions.youtube'), value: 'youtube://' },
112+
{ text: this.$t('kind.link.protocolOptions.spotify'), value: 'spotify://' },
113+
{ text: this.$t('kind.link.protocolOptions.tiktok'), value: 'tiktok://' },
114+
{ text: this.$t('kind.link.protocolOptions.discord'), value: 'discord://' },
115+
{ text: this.$t('kind.link.protocolOptions.custom'), value: '__CUSTOM__' },
116+
]
117+
},
118+
},
119+
120+
watch: {
121+
'f.options.customProtocol': {
122+
handler (val) {
123+
if (val && val !== '__CUSTOM__') {
124+
this.tempProtocol = val
125+
}
126+
},
127+
},
128+
129+
'f.options.dynamicMode': {
130+
handler (val) {
131+
if (!val && this.f.options.customProtocol) {
132+
this.tempProtocol = this.f.options.customProtocol
133+
}
134+
},
135+
},
136+
},
137+
138+
mounted () {
139+
if (!this.f.options.tempProtocol) {
140+
if (this.f.options.customProtocol) {
141+
this.f.options.tempProtocol = this.f.options.customProtocol
142+
} else {
143+
this.f.options.tempProtocol = ''
144+
}
145+
} else {
146+
this.tempProtocol = this.f.options.tempProtocol
147+
}
148+
},
149+
150+
methods: {
151+
onProtocolChange () {
152+
if (this.tempProtocol !== '__CUSTOM__') {
153+
this.$set(this.field.options, 'customProtocol', this.tempProtocol)
154+
}
155+
},
156+
},
157+
}
158+
</script>

client/web/compose/src/components/ModuleFields/Configurator/loader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export { default as Email } from './Email'
99
export { default as User } from './User'
1010
export { default as File } from './File'
1111
export { default as Geometry } from './Geometry'
12+
export { default as Link } from './Link'

0 commit comments

Comments
 (0)