Merge branch 'main' of github.com:mattermost/mattermost-octo-tasks into main
This commit is contained in:
commit
c333c25bd5
8 changed files with 5 additions and 76 deletions
|
@ -16,10 +16,10 @@ import Menu from '../widgets/menu'
|
|||
import MenuWrapper from '../widgets/menuWrapper'
|
||||
import OptionsIcon from '../widgets/icons/options'
|
||||
import AddIcon from '../widgets/icons/add'
|
||||
import Button from '../widgets/buttons/button'
|
||||
|
||||
import BoardCard from './boardCard'
|
||||
import {BoardColumn} from './boardColumn'
|
||||
import Button from './button'
|
||||
import {CardDialog} from './cardDialog'
|
||||
import {Editable} from './editable'
|
||||
import RootPortal from './rootPortal'
|
||||
|
|
|
@ -14,8 +14,8 @@ import {Utils} from '../utils'
|
|||
import MenuWrapper from '../widgets/menuWrapper'
|
||||
import Menu from '../widgets/menu'
|
||||
import Editable from '../widgets/editable'
|
||||
import Button from '../widgets/buttons/button'
|
||||
|
||||
import Button from './button'
|
||||
import {MarkdownEditor} from './markdownEditor'
|
||||
import ContentBlock from './contentBlock'
|
||||
import CommentsList from './commentsList'
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
import React from 'react'
|
||||
|
||||
import MenuWrapper from '../widgets/menuWrapper'
|
||||
|
||||
import Button from './button'
|
||||
import Button from '../widgets/buttons/button'
|
||||
|
||||
import './dialog.scss'
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ import mutator from '../mutator'
|
|||
import Menu from '../widgets/menu'
|
||||
import MenuWrapper from '../widgets/menuWrapper'
|
||||
import Editable from '../widgets/editable'
|
||||
|
||||
import Button from './button'
|
||||
import Button from '../widgets/buttons/button'
|
||||
|
||||
import './viewTitle.scss'
|
||||
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
import React from 'react'
|
||||
|
||||
import {Archiver} from '../archiver'
|
||||
import {MutableBoard} from '../blocks/board'
|
||||
import Button from '../components/button'
|
||||
import octoClient from '../octoClient'
|
||||
import {IBlock} from '../blocks/block'
|
||||
import {Utils} from '../utils'
|
||||
|
||||
type Props = {}
|
||||
|
||||
type State = {
|
||||
boards: IBlock[]
|
||||
}
|
||||
|
||||
export default class HomePage extends React.Component<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
boards: [],
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.loadBoards()
|
||||
}
|
||||
|
||||
loadBoards = async () => {
|
||||
const boards = await octoClient.getBlocksWithType('board')
|
||||
this.setState({boards})
|
||||
}
|
||||
|
||||
importClicked = async () => {
|
||||
Archiver.importFullArchive(() => {
|
||||
this.loadBoards()
|
||||
})
|
||||
}
|
||||
|
||||
exportClicked = async () => {
|
||||
Archiver.exportFullArchive()
|
||||
}
|
||||
|
||||
addClicked = async () => {
|
||||
const board = new MutableBoard()
|
||||
await octoClient.insertBlock(board)
|
||||
}
|
||||
|
||||
render(): React.ReactNode {
|
||||
return (
|
||||
<div>
|
||||
<Button onClick={this.addClicked}>+ Add Board</Button>
|
||||
<br/>
|
||||
<Button onClick={this.addClicked}>Import Archive</Button>
|
||||
<br/>
|
||||
<Button onClick={this.addClicked}>Export Archive</Button>
|
||||
{this.state.boards.map((board) => (
|
||||
<p>
|
||||
<a href={`/board/${board.id}`}>
|
||||
<span>{board.title}</span>
|
||||
<span>{Utils.displayDate(new Date(board.updateAt))}</span>
|
||||
</a>
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ import React from 'react'
|
|||
|
||||
import {Utils} from '../utils'
|
||||
|
||||
import Button from '../components/button'
|
||||
import Button from '../widgets/buttons/button'
|
||||
|
||||
import './loginPage.scss'
|
||||
|
||||
|
|
Loading…
Reference in a new issue