Skip to content

Pages POC #4396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 164 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
0214308
Working in the new content block editor
jespino Aug 24, 2022
1f33a5e
Moving blocksEditor content block into its own component
jespino Aug 30, 2022
1136a8f
Initial integration with quick development flow
jespino Aug 31, 2022
1396200
More WIP
jespino Sep 6, 2022
c2ee6d0
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Sep 6, 2022
281dac3
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Sep 7, 2022
7674683
Adding drag and drop support with server side help
jespino Sep 7, 2022
1b041c4
Some extra work around the styles
jespino Sep 9, 2022
471f508
Adding image support
jespino Sep 9, 2022
2703ebe
Adding video and attachments, and fixing edit
jespino Sep 10, 2022
a17889c
Putting everything behind a feature flag
jespino Sep 10, 2022
9c36a1a
Adding support for download attachments
jespino Sep 10, 2022
d3bce26
Fixing compilation error
jespino Sep 12, 2022
59d8f92
Fixing linter errors
jespino Sep 12, 2022
85bff3b
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Sep 12, 2022
09a9417
Fixing javascript tests
jespino Sep 12, 2022
1d03835
Fixing a typescript error
jespino Sep 12, 2022
867a450
Moving the move block to an action with undo support
jespino Sep 12, 2022
145f0d2
Fixing ci
jespino Sep 13, 2022
26cef6a
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Sep 13, 2022
56c506e
Fixing post merge errors
jespino Sep 13, 2022
0eab57b
Moving to more specific content-blocks api
jespino Sep 13, 2022
0dd9005
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 4, 2022
ade3553
Apply suggestions from code review
jespino Oct 4, 2022
3530060
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 14, 2022
c97c5bb
Fixing the behavior of certain blocks
jespino Oct 14, 2022
f84ff5d
Fixing linter error
jespino Oct 14, 2022
c78ff62
Fixing javascript linter errors
jespino Oct 14, 2022
7d144dc
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 18, 2022
d231aa7
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 18, 2022
28be952
Adding permission testing for the new move content block api
jespino Oct 18, 2022
23d1670
Adding some unit tests
jespino Oct 18, 2022
22d5f98
Improving a bit the tests
jespino Oct 19, 2022
15ff195
Adding more unit tests to the backend
jespino Oct 20, 2022
930b2e0
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 24, 2022
c72243a
Fixed PR suggestion
jespino Oct 24, 2022
4427c9f
Adding h1, h2 and h3 tests
jespino Oct 24, 2022
ad76827
Adding image tests
jespino Oct 24, 2022
3eae700
Adding video tests
jespino Oct 24, 2022
0a67e5b
Adding attachment tests
jespino Oct 24, 2022
9b9e97c
Adding quote block tests
jespino Oct 24, 2022
68c6b75
Adding divider tests
jespino Oct 24, 2022
d0161eb
Adding checkbox tests
jespino Oct 24, 2022
3bf1ff6
Adding list item block tests
jespino Oct 24, 2022
12a5ab1
Adding text block tests
jespino Oct 24, 2022
71a7789
Reorganizing a bit the code to support deveditor eagain
jespino Oct 24, 2022
fbc8f3d
Fixing dark theme on editor view
jespino Oct 24, 2022
f905d37
Fixing linter errors
jespino Oct 24, 2022
46f44ab
Fixing tests and removing unneeded data-testid
jespino Oct 25, 2022
0c7eb7f
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 26, 2022
03a4a76
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Oct 31, 2022
a19787b
Adding root input tests
jespino Nov 2, 2022
f678d11
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Nov 2, 2022
ac7f460
Fixing some merge problems
jespino Nov 2, 2022
31a2a9e
Fixing text/text.test.tsx test
jespino Nov 3, 2022
196a25e
Adding more unit tests to the blocks editor
jespino Nov 3, 2022
9114cb6
Fix linter error
jespino Nov 3, 2022
53d9172
Adding blocksEditor tests
jespino Nov 3, 2022
254e5ba
Fixing linter errors
jespino Nov 4, 2022
120f436
Adding tests for blockContent
jespino Nov 4, 2022
3f95849
Addigng pages in boards
jespino Nov 7, 2022
762b19b
Improving styles
jespino Nov 8, 2022
2702a51
Adding the concept of pages product
jespino Nov 8, 2022
8fbce54
Simplifying the browser history
jespino Nov 9, 2022
b557bd0
Polishing some things
jespino Nov 9, 2022
145cbf5
Fixing redirections
jespino Nov 9, 2022
be5c54f
WIP
jespino Nov 10, 2022
53b29b5
Adding a lot of improvements on styles and functionality
jespino Nov 11, 2022
985db6b
Improving styles and adding other chunks of the interface
jespino Nov 11, 2022
b0b8ec4
Adding support for pages as boards
jespino Nov 12, 2022
3dd8429
Making changes on copies
jespino Nov 12, 2022
53a9e5b
Initial (not fully) implementation of channel pages links
jespino Nov 12, 2022
34b8903
Adding the subpages concept
jespino Nov 14, 2022
a18ab34
Update webapp/src/components/blocksEditor/blockContent.test.tsx
wiggin77 Nov 14, 2022
64c9c8e
Update webapp/src/components/blocksEditor/blockContent.test.tsx
wiggin77 Nov 14, 2022
1134347
Update webapp/src/components/blocksEditor/blockContent.test.tsx
wiggin77 Nov 14, 2022
4576696
Adding initial support for properties
jespino Nov 15, 2022
d9aa90f
Fixing test
jespino Nov 15, 2022
5b5d236
Merge remote-tracking branch 'origin/main' into new-blocks-editor
jespino Nov 15, 2022
a6dd2f9
Removing unneeded TODO
jespino Nov 15, 2022
ebdf04e
Merge branch 'new-blocks-editor' into pages-product
jespino Nov 15, 2022
0a9935f
Merge remote-tracking branch 'origin/main' into pages-product
jespino Nov 15, 2022
fe05ed0
Add translation for the placeholder
jespino Nov 15, 2022
3c0e992
Adding the i18n translations
jespino Nov 15, 2022
cbf3b94
Fixing the editor load time on first edit
jespino Nov 15, 2022
28692aa
Fix import
jespino Nov 15, 2022
d7d1a33
Fixing empty page creation to not have properties
jespino Nov 15, 2022
cf5c615
Fixing boards menu for pages
jespino Nov 15, 2022
ff9159e
Other small fixes
jespino Nov 15, 2022
4a4cc32
Fixing saving root page properties
jespino Nov 15, 2022
f37b718
Fixing the breadcrumbs
jespino Nov 15, 2022
cebcdc1
Fixing some compilation errors
jespino Nov 15, 2022
6d6a41f
Fixing welcome redirect
jespino Nov 15, 2022
67dda79
Fixing some routing problems
jespino Nov 16, 2022
2ab83c8
Some small fixes
jespino Nov 16, 2022
96e1b92
Fixing drag and drop of blocks in root pages
jespino Nov 16, 2022
320b834
Fixed blocks deletion
jespino Nov 16, 2022
2269dbd
Updating UI
asaadmahmood Nov 16, 2022
5de895c
Updating welcome page for pages
asaadmahmood Nov 17, 2022
a13e581
Adding the noPages page
jespino Nov 17, 2022
99f3c34
Improving app-bar-pages-icon
jespino Nov 17, 2022
9ac80b4
Adding support for readonly in BlocksEditor
jespino Nov 17, 2022
bb75a45
Fixing tiny detail based on permissions
jespino Nov 17, 2022
e8d43ff
Merge remote-tracking branch 'origin/main' into pages-product
jespino Nov 21, 2022
a9790cb
Fixing tests
jespino Nov 21, 2022
4035046
Showing cursor when hover over a breadcrumb
jespino Nov 21, 2022
758c61f
Updating pages UI
asaadmahmood Nov 21, 2022
3d02fe3
Merge branch 'pages-product' of github.com:jespino/focalboard into pa…
asaadmahmood Nov 21, 2022
927a7f9
Fixing some navigation problems
jespino Nov 21, 2022
aff59f1
Updating css
asaadmahmood Nov 21, 2022
8a03f03
Merge branch 'pages-product' of github.com:jespino/focalboard into pa…
asaadmahmood Nov 21, 2022
69b80ab
Updating css
asaadmahmood Nov 21, 2022
bad6075
Updating slash command
asaadmahmood Nov 21, 2022
381a256
Updating slsah command
asaadmahmood Nov 21, 2022
f732da9
Adding the concept of icon to the blocks
jespino Nov 21, 2022
f9b09aa
Splitting centerPanelPages component
jespino Nov 23, 2022
ad4040c
WIP
jespino Nov 24, 2022
e01e114
Merge remote-tracking branch 'origin/main' into pages-product
jespino Nov 28, 2022
2cb464b
Merge remote-tracking branch 'origin/main' into pages-product
jespino Nov 28, 2022
9c1d636
Fixing some compilation errors
jespino Nov 28, 2022
eb1402c
Small code improvement
jespino Nov 28, 2022
1c4d9a2
Moving some components files
jespino Dec 12, 2022
b64babf
Creating a new page per each "Folder" as default page
jespino Dec 12, 2022
5d0c20a
Merge commit '35f681dd75302ce972a12a49d97a68f66aacfa53' into pages-pr…
jespino Dec 12, 2022
75408ca
Adding new is_pages_folder column to boards
jespino Dec 12, 2022
a682bde
Improving navigation
jespino Dec 12, 2022
457df14
Merge remote-tracking branch 'origin/main' into pages-product
jespino Dec 14, 2022
c999a9a
A bit of simplification on changes
jespino Dec 14, 2022
773efab
Improving a bit breadcrumbs.tsx
jespino Dec 14, 2022
6e41555
Improving al little pageHeader.tsx
jespino Dec 14, 2022
e5914d9
Splitting pageProperties and pageProperty
jespino Dec 14, 2022
467a33e
Reorganizing pageTitle.tsx
jespino Dec 14, 2022
ce7fbee
Fixing navigation problem to the root document
jespino Dec 14, 2022
a4b7a95
Removing the concepto of pseudoCard (no longer needed)
jespino Dec 15, 2022
3c25abe
Adding sidebarPageItem tests
jespino Dec 15, 2022
8941438
Merge remote-tracking branch 'origin/main' into pages-product
jespino Dec 16, 2022
6a30096
Removing unneeded css
jespino Dec 16, 2022
185b845
Simplifying a bit the sidebarBoardItem code
jespino Dec 16, 2022
6364b19
Merge remote-tracking branch 'origin/main' into pages-product
jespino Dec 20, 2022
0890ed7
Using the new functions for migrations
jespino Dec 20, 2022
daa3a9e
Fixing some tests
jespino Dec 20, 2022
6cd6747
Fixing some tests
jespino Dec 20, 2022
a47a09b
Fixing linter error
jespino Dec 20, 2022
741468f
Fixing some tests
jespino Dec 20, 2022
c5ca01e
Adding pageTitle tests
jespino Dec 20, 2022
85f22ab
Adding breadcrumbs tests
jespino Dec 20, 2022
9875934
Adding page property tests
jespino Dec 20, 2022
57dce4a
Adding centerPanelPages unit tests
jespino Dec 20, 2022
6f9b6e3
Adding pageBlocks.tsx tests
jespino Dec 21, 2022
ffbf672
Adding formattingMenu tests
jespino Dec 21, 2022
fa0cb20
Adding pageHader tests
jespino Dec 21, 2022
8507b92
Adding pageIconSelector tests
jespino Dec 21, 2022
69904e1
Adding pageProperties tests
jespino Dec 21, 2022
056437b
Merge remote-tracking branch 'origin/main' into pages-product
jespino Dec 21, 2022
7293cf3
Adding noPages tests
jespino Dec 21, 2022
e496318
Adding PageMenu tests
jespino Dec 21, 2022
5a84ded
Creating pages cypress tests
jespino Dec 22, 2022
7af529a
Putting pages behind a feature flag
jespino Dec 23, 2022
51b9ec8
Splitting categories in pages categories and boards categories
jespino Dec 23, 2022
c196ff5
Fixing frontend tests
jespino Dec 23, 2022
2f11852
Fixing server lint errors
jespino Dec 23, 2022
95b2209
Fixing some linter errors
jespino Dec 23, 2022
97ac0eb
Merge remote-tracking branch 'origin/main' into pages-product
jespino Jan 9, 2023
4b2d89e
Merge remote-tracking branch 'origin/main' into pages-product
jespino Jan 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 61 additions & 21 deletions mattermost-plugin/webapp/src/components/rhsChannelBoards.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useEffect} from 'react'
import React, {useEffect, useContext} from 'react'
import {FormattedMessage, IntlProvider, useIntl} from 'react-intl'

import {getMessages} from '../../../../webapp/src/i18n'
Expand All @@ -11,16 +11,19 @@ import {useWebsockets} from '../../../../webapp/src/hooks/websockets'
import {Board, BoardMember} from '../../../../webapp/src/blocks/board'
import {getCurrentTeamId} from '../../../../webapp/src/store/teams'
import {IUser} from '../../../../webapp/src/user'
import isPagesContext from '../../../../webapp/src/isPages'
import {getMe, fetchMe} from '../../../../webapp/src/store/users'
import {loadBoards, loadMyBoardsMemberships} from '../../../../webapp/src/store/initialLoad'
import {getCurrentChannel} from '../../../../webapp/src/store/channels'
import {
getMySortedBoards,
getMySortedPageFolders,
setLinkToChannel,
updateBoards,
updateMembersEnsuringBoardsAndUsers,
addMyBoardMemberships,
} from '../../../../webapp/src/store/boards'

import {useAppSelector, useAppDispatch} from '../../../../webapp/src/store/hooks'
import AddIcon from '../../../../webapp/src/widgets/icons/add'
import Button from '../../../../webapp/src/widgets/buttons/button'
Expand All @@ -36,6 +39,8 @@ import './rhsChannelBoards.scss'

const RHSChannelBoards = () => {
const boards = useAppSelector(getMySortedBoards)
const isPages = useContext(isPagesContext)
const pages = useAppSelector(getMySortedPageFolders)
const teamId = useAppSelector(getCurrentTeamId)
const currentChannel = useAppSelector(getCurrentChannel)
const me = useAppSelector<IUser|null>(getMe)
Expand Down Expand Up @@ -73,7 +78,10 @@ const RHSChannelBoards = () => {
}
}, [me])

if (!boards) {
if (!isPages && !boards) {
return null
}
if (isPages && !pages) {
return null
}
if (!teamId) {
Expand All @@ -86,7 +94,13 @@ const RHSChannelBoards = () => {
return null
}

const channelBoards = boards.filter((b) => b.channelId === currentChannel.id)
let channelBoards
if (isPages) {
channelBoards = pages.filter((b) => b.channelId === currentChannel.id)
} else {
channelBoards = boards.filter((b) => b.channelId === currentChannel.id)
}


let channelName = currentChannel.display_name
let headerChannelName = currentChannel.display_name
Expand All @@ -104,29 +118,49 @@ const RHSChannelBoards = () => {
<div className='focalboard-body'>
<div className='RHSChannelBoards empty'>
<h2>
<FormattedMessage
id='rhs-boards.no-boards-linked-to-channel'
defaultMessage='No boards are linked to {channelName} yet'
values={{channelName: headerChannelName}}
/>
{isPages &&
<FormattedMessage
id='rhs-boards.no-pages-linked-to-channel'
defaultMessage='No pages are linked to {channelName} yet'
values={{channelName: headerChannelName}}
/>}
{!isPages &&
<FormattedMessage
id='rhs-boards.no-boards-linked-to-channel'
defaultMessage='No boards are linked to {channelName} yet'
values={{channelName: headerChannelName}}
/>}
</h2>
<div className='empty-paragraph'>
<FormattedMessage
id='rhs-boards.no-boards-linked-to-channel-description'
defaultMessage='Boards is a project management tool that helps define, organize, track and manage work across teams, using a familiar kanban board view.'
/>
{isPages &&
<FormattedMessage
id='rhs-boards.no-pages-linked-to-channel-description'
defaultMessage='Pages is a documentation tool that helps define, organize, track and manage documentation across teams, using a familiar wiki format.'
/>}
{!isPages &&
<FormattedMessage
id='rhs-boards.no-boards-linked-to-channel-description'
defaultMessage='Boards is a project management tool that helps define, organize, track and manage work across teams, using a familiar kanban board view.'
/>}
</div>
<div className='boards-screenshots'><img src={Utils.buildURL(boardsScreenshots, true)}/></div>
<Button
onClick={() => dispatch(setLinkToChannel(currentChannel.id))}
emphasis='primary'
size='medium'
>
<FormattedMessage
id='rhs-boards.link-boards-to-channel'
defaultMessage='Link boards to {channelName}'
values={{channelName: channelName}}
/>
{isPages &&
<FormattedMessage
id='rhs-boards.link-pages-to-channel'
defaultMessage='Link pages to {channelName}'
values={{channelName: channelName}}
/>}
{!isPages &&
<FormattedMessage
id='rhs-boards.link-boards-to-channel'
defaultMessage='Link boards to {channelName}'
values={{channelName: channelName}}
/>}
</Button>
</div>
</div>
Expand All @@ -138,10 +172,16 @@ const RHSChannelBoards = () => {
<div className='RHSChannelBoards'>
<div className='rhs-boards-header'>
<span className='linked-boards'>
<FormattedMessage
id='rhs-boards.linked-boards'
defaultMessage='Linked boards'
/>
{isPages &&
<FormattedMessage
id='rhs-boards.linked-pages'
defaultMessage='Linked pages'
/>}
{!isPages &&
<FormattedMessage
id='rhs-boards.linked-boards'
defaultMessage='Linked boards'
/>}
</span>
<Button
onClick={() => dispatch(setLinkToChannel(currentChannel.id))}
Expand Down
39 changes: 28 additions & 11 deletions mattermost-plugin/webapp/src/components/rhsChannelBoardsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
import React, {useContext} from 'react'
import {FormattedMessage, IntlProvider} from 'react-intl'

import isPagesContext from '../../../../webapp/src/isPages'
import {getMessages} from '../../../../webapp/src/i18n'
import {getLanguage} from '../../../../webapp/src/store/language'
import {getCurrentChannel} from '../../../../webapp/src/store/channels'
import {useAppSelector} from '../../../../webapp/src/store/hooks'
import {Utils} from '../../../../webapp/src/utils'

import appBarIcon from '../../../../webapp/static/app-bar-icon.png'
import appBarIconPages from '../../../../webapp/static/app-bar-pages-icon.png'

const RHSChannelBoardsHeader = () => {
const currentChannel = useAppSelector(getCurrentChannel)
const language = useAppSelector<string>(getLanguage)
const isPages = useContext(isPagesContext)

if (!currentChannel) {
return null
Expand All @@ -25,16 +28,30 @@ const RHSChannelBoardsHeader = () => {
messages={getMessages(language)}
>
<div>
<img
className='boards-rhs-header-logo'
src={Utils.buildURL(appBarIcon, true)}
/>
<span>
<FormattedMessage
id='rhs-channel-boards-header.title'
defaultMessage='Boards'
/>
</span>
{isPages &&
<img
className='boards-rhs-header-logo'
src={Utils.buildURL(appBarIconPages, true)}
/>}
{!isPages &&
<img
className='boards-rhs-header-logo'
src={Utils.buildURL(appBarIcon, true)}
/>}
{isPages &&
<span>
<FormattedMessage
id='rhs-channel-boards-header.pages-title'
defaultMessage='Pages'
/>
</span>}
{!isPages &&
<span>
<FormattedMessage
id='rhs-channel-boards-header.title'
defaultMessage='Boards'
/>
</span>}
<span className='style--none sidebar--right__title__subtitle'>{currentChannel.display_name}</span>
</div>
</IntlProvider>
Expand Down
Loading