mirror of
https://github.com/mattermost/focalboard.git
synced 2025-03-06 15:36:17 +02:00
utils.BlockType2IDType (#1715)
This commit is contained in:
parent
1b10890f72
commit
c3a08c3418
@ -4,6 +4,8 @@ import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/focalboard/server/model"
|
||||
|
||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
||||
)
|
||||
|
||||
@ -29,6 +31,21 @@ func NewID(idType IDType) string {
|
||||
return string(idType) + mm_model.NewId()
|
||||
}
|
||||
|
||||
// BlockType2IDType returns an appropriate IDType for the specified BlockType.
|
||||
func BlockType2IDType(blockType model.BlockType) IDType {
|
||||
switch blockType {
|
||||
case model.TypeBoard:
|
||||
return IDTypeBoard
|
||||
case model.TypeCard:
|
||||
return IDTypeCard
|
||||
case model.TypeView:
|
||||
return IDTypeView
|
||||
case model.TypeText, model.TypeComment:
|
||||
return IDTypeBlock
|
||||
}
|
||||
return IDTypeNone
|
||||
}
|
||||
|
||||
// GetMillis is a convenience method to get milliseconds since epoch.
|
||||
func GetMillis() int64 {
|
||||
return mm_model.GetMillis()
|
||||
|
Loading…
x
Reference in New Issue
Block a user