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