File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 123
123
// Reactive statements
124
124
$ : collections = collectionList ?.collections ?.filter ((n ) => n .$id !== $collection .$id ) ?? [];
125
125
126
- $ : if (editing ) {
126
+ $ : if (editing && data . twoWay !== undefined ) {
127
127
way = data .twoWay ? ' two' : ' one' ;
128
- } else {
129
- if (way === ' two' ) {
130
- data .twoWay = true ;
131
- if (! data .twoWayKey ) {
132
- data .twoWayKey = camelize ($collection .name );
133
- }
134
- } else {
135
- data .twoWay = false ;
128
+ }
129
+ $ : if (! editing && way ) {
130
+ data .twoWay = way === ' two' ;
131
+ if (way === ' two' && ! data .twoWayKey ) {
132
+ data .twoWayKey = camelize ($collection .name );
136
133
}
137
134
}
138
135
158
155
bind:group ={way }
159
156
name =" one"
160
157
value =" one"
158
+ disabled ={editing }
161
159
icon ={IconArrowSmRight }>
162
160
One Relation attribute within this collection
163
161
</Card .Selector >
166
164
bind:group ={way }
167
165
name =" two"
168
166
value =" two"
167
+ disabled ={editing }
169
168
icon ={IconSwitchHorizontal }>
170
169
One Relation attribute within this collection and another within the related collection
171
170
</Card .Selector >
178
177
placeholder =" Select a collection"
179
178
bind:value ={data .relatedCollection }
180
179
on:change ={updateKeyName }
180
+ disabled ={editing }
181
181
options ={collections ?.map ((n ) => ({ value: n .$id , label: ` ${n .name } (${n .$id }) ` })) ?? []} />
182
182
183
183
{#if data ?.relatedCollection }
You can’t perform that action at this time.
0 commit comments