focalboard/webapp/src/blocks/card.ts

29 lines
699 B
TypeScript
Raw Normal View History

2020-10-20 21:50:53 +02:00
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
2020-10-20 21:52:56 +02:00
import {Block} from './block'
2020-10-15 02:35:15 +02:00
class Card extends Block {
2020-10-20 21:50:53 +02:00
get icon(): string {
return this.fields.icon as string
}
set icon(value: string) {
this.fields.icon = value
}
2020-10-15 02:35:15 +02:00
2020-10-20 21:50:53 +02:00
get properties(): Record<string, string> {
return this.fields.properties as Record<string, string>
}
set properties(value: Record<string, string>) {
this.fields.properties = value
}
2020-10-15 02:35:15 +02:00
2020-10-20 21:50:53 +02:00
constructor(block: any = {}) {
super(block)
2020-10-20 21:52:56 +02:00
this.type = 'card'
2020-10-15 02:35:15 +02:00
2020-10-20 21:50:53 +02:00
this.properties = {...(block.fields?.properties || {})}
}
2020-10-15 02:35:15 +02:00
}
2020-10-20 21:50:53 +02:00
export {Card}