mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
Create board view with new boards
This commit is contained in:
parent
d405f46114
commit
a463f6e1be
@ -6,7 +6,6 @@
|
|||||||
"BoardComponent.delete": "Delete",
|
"BoardComponent.delete": "Delete",
|
||||||
"BoardComponent.hidden-columns": "Hidden Columns",
|
"BoardComponent.hidden-columns": "Hidden Columns",
|
||||||
"BoardComponent.hide": "Hide",
|
"BoardComponent.hide": "Hide",
|
||||||
"BoardComponent.loading": "Loading...",
|
|
||||||
"BoardComponent.neww": "+ New",
|
"BoardComponent.neww": "+ New",
|
||||||
"BoardComponent.no-property": "No {property}",
|
"BoardComponent.no-property": "No {property}",
|
||||||
"BoardComponent.no-property-title": "Items with an empty {property} property will go here. This column cannot be removed.",
|
"BoardComponent.no-property-title": "Items with an empty {property} property will go here. This column cannot be removed.",
|
||||||
@ -16,10 +15,8 @@
|
|||||||
"CardDetail.add-property": "+ Add a property",
|
"CardDetail.add-property": "+ Add a property",
|
||||||
"CardDetail.image": "Image",
|
"CardDetail.image": "Image",
|
||||||
"CardDetail.new-comment-placeholder": "Add a comment...",
|
"CardDetail.new-comment-placeholder": "Add a comment...",
|
||||||
"CardDetail.pick-icon": "Pick Icon",
|
|
||||||
"CardDetail.random-icon": "Random",
|
|
||||||
"CardDetail.remove-icon": "Remove Icon",
|
|
||||||
"CardDetail.text": "Text",
|
"CardDetail.text": "Text",
|
||||||
|
"CardDialog.editing-template": "You're editing a template",
|
||||||
"Comment.delete": "Delete",
|
"Comment.delete": "Delete",
|
||||||
"CommentsList.send": "Send",
|
"CommentsList.send": "Send",
|
||||||
"Filter.includes": "includes",
|
"Filter.includes": "includes",
|
||||||
@ -31,6 +28,7 @@
|
|||||||
"Sidebar.add-board": "+ Add Board",
|
"Sidebar.add-board": "+ Add Board",
|
||||||
"Sidebar.dark-theme": "Dark Theme",
|
"Sidebar.dark-theme": "Dark Theme",
|
||||||
"Sidebar.delete-board": "Delete Board",
|
"Sidebar.delete-board": "Delete Board",
|
||||||
|
"Sidebar.duplicate-board": "Duplicate Board",
|
||||||
"Sidebar.english": "English",
|
"Sidebar.english": "English",
|
||||||
"Sidebar.export-archive": "Export Archive",
|
"Sidebar.export-archive": "Export Archive",
|
||||||
"Sidebar.import-archive": "Import Archive",
|
"Sidebar.import-archive": "Import Archive",
|
||||||
@ -44,7 +42,6 @@
|
|||||||
"Sidebar.untitled-board": "(Untitled Board)",
|
"Sidebar.untitled-board": "(Untitled Board)",
|
||||||
"Sidebar.untitled-view": "(Untitled View)",
|
"Sidebar.untitled-view": "(Untitled View)",
|
||||||
"TableComponent.add-icon": "Add Icon",
|
"TableComponent.add-icon": "Add Icon",
|
||||||
"TableComponent.loading": "Loading...",
|
|
||||||
"TableComponent.name": "Name",
|
"TableComponent.name": "Name",
|
||||||
"TableComponent.plus-new": "+ New",
|
"TableComponent.plus-new": "+ New",
|
||||||
"TableHeaderMenu.delete": "Delete",
|
"TableHeaderMenu.delete": "Delete",
|
||||||
@ -55,6 +52,12 @@
|
|||||||
"TableHeaderMenu.sort-ascending": "Sort ascending",
|
"TableHeaderMenu.sort-ascending": "Sort ascending",
|
||||||
"TableHeaderMenu.sort-descending": "Sort descending",
|
"TableHeaderMenu.sort-descending": "Sort descending",
|
||||||
"TableRow.open": "Open",
|
"TableRow.open": "Open",
|
||||||
|
"View.NewBoardTitle": "Board View",
|
||||||
|
"View.NewTableTitle": "Table View",
|
||||||
|
"ViewHeader.add-template": "+ New template",
|
||||||
|
"ViewHeader.delete-template": "Delete",
|
||||||
|
"ViewHeader.edit-template": "Edit",
|
||||||
|
"ViewHeader.empty-card": "Empty card",
|
||||||
"ViewHeader.export-board-archive": "Export Board Archive",
|
"ViewHeader.export-board-archive": "Export Board Archive",
|
||||||
"ViewHeader.export-csv": "Export to CSV",
|
"ViewHeader.export-csv": "Export to CSV",
|
||||||
"ViewHeader.filter": "Filter",
|
"ViewHeader.filter": "Filter",
|
||||||
@ -63,10 +66,13 @@
|
|||||||
"ViewHeader.properties": "Properties",
|
"ViewHeader.properties": "Properties",
|
||||||
"ViewHeader.search": "Search",
|
"ViewHeader.search": "Search",
|
||||||
"ViewHeader.search-text": "Search text",
|
"ViewHeader.search-text": "Search text",
|
||||||
|
"ViewHeader.select-a-template": "Select a template",
|
||||||
"ViewHeader.sort": "Sort",
|
"ViewHeader.sort": "Sort",
|
||||||
"ViewHeader.test-add-100-cards": "TEST: Add 100 cards",
|
"ViewHeader.test-add-100-cards": "TEST: Add 100 cards",
|
||||||
"ViewHeader.test-add-1000-cards": "TEST: Add 1,000 cards",
|
"ViewHeader.test-add-1000-cards": "TEST: Add 1,000 cards",
|
||||||
|
"ViewHeader.test-distribute-cards": "TEST: Distribute cards",
|
||||||
"ViewHeader.test-randomize-icons": "TEST: Randomize icons",
|
"ViewHeader.test-randomize-icons": "TEST: Randomize icons",
|
||||||
|
"ViewHeader.untitled": "Untitled",
|
||||||
"ViewTitle.pick-icon": "Pick Icon",
|
"ViewTitle.pick-icon": "Pick Icon",
|
||||||
"ViewTitle.random-icon": "Random",
|
"ViewTitle.random-icon": "Random",
|
||||||
"ViewTitle.remove-icon": "Remove Icon",
|
"ViewTitle.remove-icon": "Remove Icon",
|
||||||
|
@ -19,7 +19,7 @@ import DotIcon from '../widgets/icons/dot'
|
|||||||
import IconButton from '../widgets/buttons/iconButton'
|
import IconButton from '../widgets/buttons/iconButton'
|
||||||
import Button from '../widgets/buttons/button'
|
import Button from '../widgets/buttons/button'
|
||||||
import {WorkspaceTree} from '../viewModel/workspaceTree'
|
import {WorkspaceTree} from '../viewModel/workspaceTree'
|
||||||
import {BoardView} from '../blocks/boardView'
|
import {BoardView, MutableBoardView} from '../blocks/boardView'
|
||||||
|
|
||||||
import './sidebar.scss'
|
import './sidebar.scss'
|
||||||
|
|
||||||
@ -272,12 +272,17 @@ class Sidebar extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private addBoardClicked = async () => {
|
private addBoardClicked = async () => {
|
||||||
const {showBoard} = this.props
|
const {showBoard, intl} = this.props
|
||||||
|
|
||||||
const oldBoardId = this.props.activeBoardId
|
const oldBoardId = this.props.activeBoardId
|
||||||
const board = new MutableBoard()
|
const board = new MutableBoard()
|
||||||
await mutator.insertBlock(
|
const view = new MutableBoardView()
|
||||||
board,
|
view.viewType = 'board'
|
||||||
|
view.parentId = board.id
|
||||||
|
view.title = intl.formatMessage({id: 'View.NewBoardTitle', defaultMessage: 'Board View'})
|
||||||
|
|
||||||
|
await mutator.insertBlocks(
|
||||||
|
[board, view],
|
||||||
'add board',
|
'add board',
|
||||||
async () => {
|
async () => {
|
||||||
showBoard(board.id)
|
showBoard(board.id)
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
import {injectIntl, IntlShape} from 'react-intl'
|
||||||
|
|
||||||
import {Board} from '../blocks/board'
|
import {Board} from '../blocks/board'
|
||||||
import {MutableBoardView} from '../blocks/boardView'
|
import {MutableBoardView} from '../blocks/boardView'
|
||||||
import {BoardTree} from '../viewModel/boardTree'
|
import {BoardTree} from '../viewModel/boardTree'
|
||||||
@ -14,9 +16,10 @@ type Props = {
|
|||||||
boardTree: BoardTree
|
boardTree: BoardTree
|
||||||
board: Board,
|
board: Board,
|
||||||
showView: (id: string) => void
|
showView: (id: string) => void
|
||||||
|
intl: IntlShape
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ViewMenu extends React.Component<Props> {
|
export class ViewMenu extends React.Component<Props> {
|
||||||
handleDeleteView = async () => {
|
handleDeleteView = async () => {
|
||||||
const {boardTree, showView} = this.props
|
const {boardTree, showView} = this.props
|
||||||
Utils.log('deleteView')
|
Utils.log('deleteView')
|
||||||
@ -34,10 +37,10 @@ export default class ViewMenu extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleAddViewBoard = async () => {
|
handleAddViewBoard = async () => {
|
||||||
const {board, boardTree, showView} = this.props
|
const {board, boardTree, showView, intl} = this.props
|
||||||
Utils.log('addview-board')
|
Utils.log('addview-board')
|
||||||
const view = new MutableBoardView()
|
const view = new MutableBoardView()
|
||||||
view.title = 'Board View'
|
view.title = intl.formatMessage({id: 'View.NewBoardTitle', defaultMessage: 'Board View'})
|
||||||
view.viewType = 'board'
|
view.viewType = 'board'
|
||||||
view.parentId = board.id
|
view.parentId = board.id
|
||||||
|
|
||||||
@ -55,11 +58,11 @@ export default class ViewMenu extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleAddViewTable = async () => {
|
handleAddViewTable = async () => {
|
||||||
const {board, boardTree, showView} = this.props
|
const {board, boardTree, showView, intl} = this.props
|
||||||
|
|
||||||
Utils.log('addview-table')
|
Utils.log('addview-table')
|
||||||
const view = new MutableBoardView()
|
const view = new MutableBoardView()
|
||||||
view.title = 'Table View'
|
view.title = intl.formatMessage({id: 'View.NewTableTitle', defaultMessage: 'Table View'})
|
||||||
view.viewType = 'table'
|
view.viewType = 'table'
|
||||||
view.parentId = board.id
|
view.parentId = board.id
|
||||||
view.visiblePropertyIds = board.cardProperties.map((o) => o.id)
|
view.visiblePropertyIds = board.cardProperties.map((o) => o.id)
|
||||||
@ -115,3 +118,5 @@ export default class ViewMenu extends React.Component<Props> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default injectIntl(ViewMenu)
|
||||||
|
Loading…
Reference in New Issue
Block a user