Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 27c2097

Browse files
sortable card viewlets (#10160)
1 parent b18812b commit 27c2097

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

‎common/scripts/version.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"0.7.278"
1+
"0.7.292"

‎models/card/src/index.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ export function createSystemType (
307307
attachTo: type,
308308
descriptor: view.viewlet.Table,
309309
configOptions: {
310-
hiddenKeys: ['content', 'title']
310+
hiddenKeys: ['content', 'title'],
311+
sortable: true
311312
},
312313
config: [
313314
{ key: '', props: { shrink: true } },
@@ -398,7 +399,8 @@ export function createModel (builder: Builder): void {
398399
attachTo: card.class.CardSpace,
399400
descriptor: view.viewlet.Table,
400401
configOptions: {
401-
hiddenKeys: ['name', 'description']
402+
hiddenKeys: ['name', 'description'],
403+
sortable: true
402404
},
403405
config: ['', 'members', 'private', 'archived'],
404406
viewOptions: {
@@ -511,7 +513,8 @@ export function createModel (builder: Builder): void {
511513
attachTo: card.class.Card,
512514
descriptor: view.viewlet.Table,
513515
configOptions: {
514-
hiddenKeys: ['content', 'title']
516+
hiddenKeys: ['content', 'title'],
517+
sortable: true
515518
},
516519
config: [
517520
'',

‎models/card/src/migration.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ export const cardOperation: MigrateOperation = {
7777
state: 'fill-parent-info',
7878
mode: 'upgrade',
7979
func: fillParentInfo
80+
},
81+
{
82+
state: 'make-config-sortable',
83+
mode: 'upgrade',
84+
func: makeConfigSortable
8085
}
8186
])
8287
}
@@ -328,3 +333,13 @@ async function updateCustomFieldsDisplayProps (client: MigrationClient): Promise
328333
}
329334
}
330335
}
336+
337+
async function makeConfigSortable (client: Client): Promise<void> {
338+
const txOp = new TxOperations(client, core.account.System)
339+
const masterTags = await client.findAll(card.class.MasterTag, {})
340+
const currentViewlets = await client.findAll(view.class.Viewlet, { attachTo: { $in: masterTags.map((p) => p._id) } })
341+
for (const currentViewlet of currentViewlets) {
342+
const configOptions = { ...currentViewlet.configOptions, sortable: true }
343+
await txOp.update(currentViewlet, { configOptions })
344+
}
345+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /