@@ -46,13 +46,10 @@ export const searchDbView = (metaData: any, data: any[]) => {
46
46
} ,
47
47
blocks : [
48
48
{
49
+ type : "input" ,
49
50
block_id : "select_db" ,
50
- type : "section" ,
51
- text : {
52
- type : "mrkdwn" ,
53
- text : "DB選択" ,
54
- } ,
55
- accessory : {
51
+ dispatch_action : true ,
52
+ element : {
56
53
type : "static_select" ,
57
54
placeholder : {
58
55
type : "plain_text" ,
@@ -62,12 +59,17 @@ export const searchDbView = (metaData: any, data: any[]) => {
62
59
options : dbOptions ,
63
60
action_id : "select_db-action" ,
64
61
} ,
62
+ label : {
63
+ type : "plain_text" ,
64
+ text : "DB選択" ,
65
+ } ,
65
66
} ,
66
67
] ,
67
68
}
68
69
}
69
70
70
71
export const searchPagesResultView = ( metaData : any , urls : any [ ] ) => {
72
+ const dbId = metaData . selected_db_id . replace ( / - / g, "" )
71
73
let view = {
72
74
private_metadata : JSON . stringify ( metaData ) ,
73
75
type : "modal" ,
@@ -82,10 +84,20 @@ export const searchPagesResultView = (metaData: any, urls: any[]) => {
82
84
} ,
83
85
blocks : [
84
86
{
85
- type : "header " ,
87
+ type : "section " ,
86
88
text : {
87
- type : "plain_text" ,
88
- text : `DB: ${ metaData . selected_db_name } ` ,
89
+ type : "mrkdwn" ,
90
+ text : `*DB: <https://www.notion.so/${ dbId } |${ metaData . selected_db_name } >*` ,
91
+ } ,
92
+ accessory : {
93
+ type : "button" ,
94
+ text : {
95
+ type : "plain_text" ,
96
+ text : "Change database" ,
97
+ } ,
98
+ style : "primary" ,
99
+ action_id : "change_db-action" ,
100
+ value : "click_change_db" ,
89
101
} ,
90
102
} ,
91
103
{
@@ -106,19 +118,10 @@ export const searchPagesResultView = (metaData: any, urls: any[]) => {
106
118
type : "plain_text" ,
107
119
text : "Clear filter" ,
108
120
} ,
121
+ style : "danger" ,
109
122
action_id : "clear_filter-action" ,
110
123
value : "click_clear_filter" ,
111
124
} ,
112
- {
113
- type : "button" ,
114
- text : {
115
- type : "plain_text" ,
116
- text : "Change database" ,
117
- } ,
118
- style : "primary" ,
119
- action_id : "change_db-action" ,
120
- value : "click_change_db" ,
121
- } ,
122
125
] ,
123
126
} ,
124
127
{
@@ -186,31 +189,31 @@ export const selectFilterPropertyView = (metaData: any, propOptions: any[]) => {
186
189
} ,
187
190
blocks : [
188
191
{
189
- block_id : "selected_db" ,
190
192
type : "section" ,
193
+ block_id : "selected_db" ,
191
194
text : {
192
195
type : "plain_text" ,
193
196
text : `DB: ${ metaData . selected_db_name } ` ,
194
197
emoji : true ,
195
198
} ,
196
199
} ,
197
200
{
201
+ type : "input" ,
198
202
block_id : "select_prop" ,
199
- type : "section" ,
200
- text : {
201
- type : "mrkdwn" ,
202
- text : "フィルター用プロパティ選択" ,
203
- } ,
204
- accessory : {
203
+ dispatch_action : true ,
204
+ element : {
205
205
type : "static_select" ,
206
206
placeholder : {
207
207
type : "plain_text" ,
208
208
text : "Select a property" ,
209
- emoji : true ,
210
209
} ,
211
210
options : propOptions ,
212
211
action_id : "select_prop-action" ,
213
212
} ,
213
+ label : {
214
+ type : "plain_text" ,
215
+ text : "フィルター用プロパティ選択" ,
216
+ } ,
214
217
} ,
215
218
] ,
216
219
}
@@ -235,40 +238,40 @@ export const selectFilterPropertyFieldView = (
235
238
} ,
236
239
blocks : [
237
240
{
238
- block_id : "select_db" ,
239
241
type : "section" ,
242
+ block_id : "select_db" ,
240
243
text : {
241
244
type : "plain_text" ,
242
245
text : `DB: ${ metaData . selected_db_name } ` ,
243
246
emoji : true ,
244
247
} ,
245
248
} ,
246
249
{
247
- block_id : "set_prop" ,
248
250
type : "section" ,
251
+ block_id : "set_prop" ,
249
252
text : {
250
253
type : "plain_text" ,
251
254
text : `Property: ${ selectedPropNameAndType } ` ,
252
255
emoji : true ,
253
256
} ,
254
257
} ,
255
258
{
259
+ type : "input" ,
256
260
block_id : "select_prop_field" ,
257
- type : "section" ,
258
- text : {
259
- type : "mrkdwn" ,
260
- text : "フィルタープロパティのフィールド選択" ,
261
- } ,
262
- accessory : {
261
+ dispatch_action : true ,
262
+ element : {
263
263
type : "static_select" ,
264
264
placeholder : {
265
265
type : "plain_text" ,
266
266
text : "Select a field" ,
267
- emoji : true ,
268
267
} ,
269
268
options : filterFieldOptions ,
270
269
action_id : "select_prop_field-action" ,
271
270
} ,
271
+ label : {
272
+ type : "plain_text" ,
273
+ text : "フィルタープロパティのフィールド選択" ,
274
+ } ,
272
275
} ,
273
276
] ,
274
277
}
@@ -293,35 +296,35 @@ export const selectFilterValueInputView = (
293
296
} ,
294
297
blocks : [
295
298
{
296
- block_id : "select_db" ,
297
299
type : "section" ,
300
+ block_id : "select_db" ,
298
301
text : {
299
302
type : "plain_text" ,
300
303
text : `DB: ${ metaData . selected_db_name } ` ,
301
304
emoji : true ,
302
305
} ,
303
306
} ,
304
307
{
305
- block_id : "set_prop" ,
306
308
type : "section" ,
309
+ block_id : "set_prop" ,
307
310
text : {
308
311
type : "plain_text" ,
309
312
text : `Property: ${ selectedPropName } ` ,
310
313
emoji : true ,
311
314
} ,
312
315
} ,
313
316
{
314
- block_id : "select_prop_field" ,
315
317
type : "section" ,
318
+ block_id : "select_prop_field" ,
316
319
text : {
317
320
type : "plain_text" ,
318
321
text : `field: ${ selectedPropertyField } ` ,
319
322
emoji : true ,
320
323
} ,
321
324
} ,
322
325
{
323
- block_id : "select_prop_value_input" ,
324
326
type : "input" ,
327
+ block_id : "select_prop_value_input" ,
325
328
dispatch_action : true ,
326
329
element : {
327
330
type : "plain_text_input" ,
@@ -369,49 +372,49 @@ export const selectFilterValueView = (
369
372
} ,
370
373
blocks : [
371
374
{
372
- block_id : "select_db" ,
373
375
type : "section" ,
376
+ block_id : "select_db" ,
374
377
text : {
375
378
type : "plain_text" ,
376
379
text : `DB: ${ metaData . selected_db_name } ` ,
377
380
emoji : true ,
378
381
} ,
379
382
} ,
380
383
{
381
- block_id : "set_prop" ,
382
384
type : "section" ,
385
+ block_id : "set_prop" ,
383
386
text : {
384
387
type : "plain_text" ,
385
388
text : `Property: ${ selectedProp . prop_name } ` ,
386
389
emoji : true ,
387
390
} ,
388
391
} ,
389
392
{
390
- block_id : "select_prop_field" ,
391
393
type : "section" ,
394
+ block_id : "select_prop_field" ,
392
395
text : {
393
396
type : "plain_text" ,
394
397
text : `field: ${ selectedProp . prop_field } ` ,
395
398
emoji : true ,
396
399
} ,
397
400
} ,
398
401
{
402
+ type : "input" ,
399
403
block_id : "select_prop_value" ,
400
- type : "section" ,
401
- text : {
402
- type : "mrkdwn" ,
403
- text : "フィルター値選択" ,
404
- } ,
405
- accessory : {
404
+ dispatch_action : true ,
405
+ element : {
406
406
type : selectPropValueType ,
407
407
placeholder : {
408
408
type : "plain_text" ,
409
409
text : "Select a value" ,
410
- emoji : true ,
411
410
} ,
412
411
options : selectDbPropValueOptions ,
413
412
action_id : selectPropValueAction ,
414
413
} ,
414
+ label : {
415
+ type : "plain_text" ,
416
+ text : "フィルター値選択" ,
417
+ } ,
415
418
} ,
416
419
] ,
417
420
}
0 commit comments