Skip to content

Commit

Permalink
Feature to show hidden card count (mattermost-community#3094)
Browse files Browse the repository at this point in the history
* Shows "(Deleted User)" instead of UUID when user not found (mattermost-community#2354) (mattermost-community#2465)

* Shows "(Deleted User)" instead of long, unreadable UUID in case the user is not found

In case a user is not found, at present unreadable and long UUIDs are shown which kill the look and feel of the application. This patch replaces the UUID with a more explanatory string.

* Update server/services/store/mattermostauthlayer/mattermostauthlayer.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
(cherry picked from commit 6881918)

Co-authored-by: Akshay Vasudeva Rao <51395864+akkivasu@users.noreply.github.com>

* Update CHANGELOG.md for v0.15

Added one more merged PR to the list

* mattermost-communityGH-2212 - Update global link on board (mattermost-community#2492) (mattermost-community#2495)

(cherry picked from commit 49df41f)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* mattermost-communityGH-2387 - Fixing link in comments (mattermost-community#2480) (mattermost-community#2498)

(cherry picked from commit 5e2cf0b)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* Addead feature to start product tour on using the welcome template (mattermost-community#2468)

* Fixed a bug where images of the welcome board were not copied over. (mattermost-community#2453)

* Fixed a buig where images of welcome board were not copied over

* Lint fixes

* Fixed test

* Fixed test

* mattermost-communityGH-2496 - Updating board title truncation issue (mattermost-community#2497) (mattermost-community#2503)

(cherry picked from commit f9cef8e)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* set min-height on empty date to allow click (mattermost-community#2466) (mattermost-community#2504)

(cherry picked from commit 20fe19a)

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Fix problem with viewId 0 in the URL (mattermost-community#2474) (mattermost-community#2510)

(cherry picked from commit 4cb3a0f)

Co-authored-by: Jesús Espino <jespinog@gmail.com>

* don't display temlate page if readonly and access revoked (mattermost-community#2499) (mattermost-community#2515)

(cherry picked from commit 61f1a3c)

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* mattermost-communityGH-2447 - Updating label overflow (mattermost-community#2479) (mattermost-community#2517)

* mattermost-communityGH-2447 - Updating label overflow

* Updating labels css

(cherry picked from commit 923437c)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* mattermost-communityGh-2437 - Updating share board modal (mattermost-community#2511) (mattermost-community#2522)

* mattermost-communityGh-2437 - Updating share board modal

* Updating test

* Updating card dialog and test

* Updating comment list

(cherry picked from commit 50ded69)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* updated/synced prior PR (mattermost-community#2509) (mattermost-community#2523)

* updated/synced prior PR

* add title back for cypress tests

* update unit test for cypress fix

* move to function

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
(cherry picked from commit 5b309e8)

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* modify error page redirects (mattermost-community#2518) (mattermost-community#2532)

(cherry picked from commit 84a3f8f)

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Dismiss tour from overlay (mattermost-community#2525) (mattermost-community#2531)

* Shows "(Deleted User)" instead of UUID when user not found (mattermost-community#2354) (mattermost-community#2465)

* Shows "(Deleted User)" instead of long, unreadable UUID in case the user is not found

In case a user is not found, at present unreadable and long UUIDs are shown which kill the look and feel of the application. This patch replaces the UUID with a more explanatory string.

* Update server/services/store/mattermostauthlayer/mattermostauthlayer.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
(cherry picked from commit 6881918)

Co-authored-by: Akshay Vasudeva Rao <51395864+akkivasu@users.noreply.github.com>

* Update CHANGELOG.md for v0.15

Added one more merged PR to the list

* Added ability to dismiss tour from overlay

* mattermost-communityGH-2212 - Update global link on board (mattermost-community#2492) (mattermost-community#2495)

(cherry picked from commit 49df41f)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* mattermost-communityGH-2387 - Fixing link in comments (mattermost-community#2480) (mattermost-community#2498)

(cherry picked from commit 5e2cf0b)

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>

* Addead feature to start product tour on using the welcome template (mattermost-community#2468)

* Fixed a bug where images of the welcome board were not copied over. (mattermost-community#2453)

* Fixed a buig where images of welcome board were not copied over

* Lint fixes

* Fixed test

* Fixed test

* Fixed intended behavio

* lint fixes

* Fixed tests

* Fixed tests

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Akshay Vasudeva Rao <51395864+akkivasu@users.noreply.github.com>
Co-authored-by: Winson Wu <93531870+wuwinson@users.noreply.github.com>
Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
(cherry picked from commit a53e947)

Co-authored-by: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com>

* Updated Mac what's new for v0.15

* Done with the frontend for limited card count

* Updated the code and done with the unit test case

* Updated the code according to the review comment and fixed the test cases and ES lints issue

* Fixed the import for css file

* Changes made according to review comments, Reverted back whatsnew.txt

* Minor changes

* Updated the code considering review comments

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Akshay Vasudeva Rao <51395864+akkivasu@users.noreply.github.com>
Co-authored-by: Winson Wu <93531870+wuwinson@users.noreply.github.com>
Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>
Co-authored-by: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Chen-I Lim <chenilim@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
  • Loading branch information
11 people committed Jun 9, 2022
1 parent 6edcfdb commit b73ccb6
Show file tree
Hide file tree
Showing 28 changed files with 777 additions and 68 deletions.
7 changes: 7 additions & 0 deletions webapp/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,16 @@
"error.page.title": "Sorry, something went wrong",
"generic.previous": "Previous",
"imagePaste.upload-failed": "Some files not uploaded. File size limit reached",
"limitedCard.title": "Cards Hidden",
"login.log-in-button": "Log in",
"login.log-in-title": "Log in",
"login.register-button": "or create an account if you don't have one",
"notification-box-card-limit-reached.close-tooltip": "Snooze for 10 days",
"notification-box-card-limit-reached.link": "upgrade to a paid plan",
"notification-box-card-limit-reached.title": "{cards} cards hidden from board",
"notification-box-cards-hidden.title": "Your action hidden another card",
"notification-box.card-limit-reached.not-admin.text": "To access archived cards, contact your admin to upgrade to a paid plan.",
"notification-box.card-limit-reached.text": "Card limit reached, to view older cards, {link}",
"register.login-button": "or log in if you already have an account",
"register.signup-title": "Sign up for your account",
"share-board.publish": "Publish",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe('components/boardTemplateSelector/boardTemplateSelectorItem', () => {
icon: '🚴🏻‍♂️',
cardProperties: [groupProperty],
properties: {},
limited: false,
}

const globalTemplate: Board = {
Expand All @@ -93,6 +94,7 @@ describe('components/boardTemplateSelector/boardTemplateSelectorItem', () => {
isTemplate: true,
templateVersion: 2,
properties: {},
limited: false,
}

const me: IUser = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jest.mock('../../octoClient', () => {
'group-prop-id': 'test',
},
},
limited: false,
},
])),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const BoardTemplateSelectorPreview = (props: Props) => {
onCardClicked={() => null}
addCard={() => Promise.resolve()}
showCard={() => null}
hiddenCardsCount={0}
/>}
{activeView?.fields.viewType === 'table' &&
<Table
Expand All @@ -120,6 +121,7 @@ const BoardTemplateSelectorPreview = (props: Props) => {
onCardClicked={() => null}
addCard={() => Promise.resolve()}
showCard={() => null}
hiddenCardsCount={0}
/>}
{activeView?.fields.viewType === 'gallery' &&
<Gallery
Expand All @@ -130,6 +132,7 @@ const BoardTemplateSelectorPreview = (props: Props) => {
selectedCardIds={[]}
onCardClicked={() => null}
addCard={() => Promise.resolve()}
hiddenCardsCount={0}
/>}
{activeView?.fields.viewType === 'calendar' &&
<CalendarFullView
Expand Down
131 changes: 73 additions & 58 deletions webapp/src/components/centerPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -166,6 +167,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -184,6 +186,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -202,6 +205,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -221,6 +225,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand Down Expand Up @@ -251,6 +256,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -273,6 +279,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand Down Expand Up @@ -301,6 +308,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand Down Expand Up @@ -338,6 +346,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand Down Expand Up @@ -365,6 +374,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand Down Expand Up @@ -393,6 +403,7 @@ describe('components/centerPanel', () => {
showCard={mockedShowCard}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -417,6 +428,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -438,6 +450,7 @@ describe('components/centerPanel', () => {
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
Expand All @@ -449,63 +462,65 @@ describe('components/centerPanel', () => {
expect(mockedMutator.insertBlock).toBeCalledTimes(1)
})

// TODO: Fix this
// test('click on new card to add card from template', () => {
// activeView.fields.viewType = 'table'
// activeView.fields.defaultTemplateId = '1'
// const {container} = render(wrapDNDIntl(
// <ReduxProvider store={store}>
// <CenterPanel
// cards={[card1, card2]}
// views={[activeView]}
// board={board}
// activeView={activeView}
// readonly={false}
// showCard={jest.fn()}
// showShared={true}
// groupByProperty={groupProperty}
// shownCardId={card1.id}
// />
// </ReduxProvider>,
// ))
// const elementMenuWrapper = container.querySelector('.ButtonWithMenu > div.MenuWrapper')
// expect(elementMenuWrapper).not.toBeNull()
// userEvent.click(elementMenuWrapper!)
// const elementCard1 = within(elementMenuWrapper!.parentElement!).getByRole('button', {name: 'card1'})
// expect(elementCard1).not.toBeNull()
// userEvent.click(elementCard1)
// expect(mockedMutator.performAsUndoGroup).toBeCalledTimes(1)
// })
// test('click on new card to edit template', () => {
// activeView.fields.viewType = 'table'
// activeView.fields.defaultTemplateId = '1'
// const {container} = render(wrapDNDIntl(
// <ReduxProvider store={store}>
// <CenterPanel
// cards={[card1, card2]}
// views={[activeView]}
// board={board}
// activeView={activeView}
// readonly={false}
// showCard={jest.fn()}
// showShared={true}
// groupByProperty={groupProperty}
// shownCardId={card1.id}
// />
// </ReduxProvider>,
// ))
// const elementMenuWrapper = container.querySelector('.ButtonWithMenu > div.MenuWrapper')
// expect(elementMenuWrapper).not.toBeNull()
// userEvent.click(elementMenuWrapper!)
// const elementCard1 = within(elementMenuWrapper!.parentElement!).getByRole('button', {name: 'card1'})
// expect(elementCard1).not.toBeNull()
// const elementMenuWrapperCard1 = within(elementCard1).getByRole('button', {name: 'menuwrapper'})
// expect(elementMenuWrapperCard1).not.toBeNull()
// userEvent.click(elementMenuWrapperCard1)
// const elementEditMenuTemplate = within(elementMenuWrapperCard1).getByRole('button', {name: 'Edit'})
// expect(elementMenuWrapperCard1).not.toBeNull()
// userEvent.click(elementEditMenuTemplate)
// expect(container).toMatchSnapshot()
// })
test('click on new card to add card from template', () => {
activeView.fields.viewType = 'table'
activeView.fields.defaultTemplateId = '1'
const {container} = render(wrapDNDIntl(
<ReduxProvider store={store}>
<CenterPanel
cards={[card1, card2]}
views={[activeView]}
board={board}
activeView={activeView}
readonly={false}
showCard={jest.fn()}
showShared={true}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
const elementMenuWrapper = container.querySelector('.ButtonWithMenu > div.MenuWrapper')
expect(elementMenuWrapper).not.toBeNull()
userEvent.click(elementMenuWrapper!)
const elementCard1 = within(elementMenuWrapper!.parentElement!).getByRole('button', {name: 'card1'})
expect(elementCard1).not.toBeNull()
userEvent.click(elementCard1)
expect(mockedMutator.performAsUndoGroup).toBeCalledTimes(1)
})

test('click on new card to edit template', () => {
activeView.fields.viewType = 'table'
activeView.fields.defaultTemplateId = '1'
const {container} = render(wrapDNDIntl(
<ReduxProvider store={store}>
<CenterPanel
cards={[card1, card2]}
views={[activeView]}
board={board}
activeView={activeView}
readonly={false}
showCard={jest.fn()}
showShared={true}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={0}
/>
</ReduxProvider>,
))
const elementMenuWrapper = container.querySelector('.ButtonWithMenu > div.MenuWrapper')
expect(elementMenuWrapper).not.toBeNull()
userEvent.click(elementMenuWrapper!)
const elementCard1 = within(elementMenuWrapper!.parentElement!).getByRole('button', {name: 'card1'})
expect(elementCard1).not.toBeNull()
const elementMenuWrapperCard1 = within(elementCard1).getByRole('button', {name: 'menuwrapper'})
expect(elementMenuWrapperCard1).not.toBeNull()
userEvent.click(elementMenuWrapperCard1)
const elementEditMenuTemplate = within(elementMenuWrapperCard1).getByRole('button', {name: 'Edit'})
expect(elementMenuWrapperCard1).not.toBeNull()
userEvent.click(elementEditMenuTemplate)
expect(container).toMatchSnapshot()
})
})
})
5 changes: 5 additions & 0 deletions webapp/src/components/centerPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type Props = {
readonly: boolean
shownCardId?: string
showCard: (cardId?: string) => void
hiddenCardsCount: number
}

const CenterPanel = (props: Props) => {
Expand Down Expand Up @@ -418,6 +419,7 @@ const CenterPanel = (props: Props) => {
onCardClicked={cardClicked}
addCard={addCard}
showCard={showCard}
hiddenCardsCount={props.hiddenCardsCount}
/>}
{activeView.fields.viewType === 'table' &&
<Table
Expand All @@ -433,6 +435,7 @@ const CenterPanel = (props: Props) => {
showCard={showCard}
addCard={addCard}
onCardClicked={cardClicked}
hiddenCardsCount={props.hiddenCardsCount}
/>}
{activeView.fields.viewType === 'calendar' &&
<CalendarFullView
Expand All @@ -445,6 +448,7 @@ const CenterPanel = (props: Props) => {
addCard={(properties: Record<string, string>) => {
addCard('', true, properties)
}}
hiddenCardsCount={props.hiddenCardsCount}
/>}

{activeView.fields.viewType === 'gallery' &&
Expand All @@ -456,6 +460,7 @@ const CenterPanel = (props: Props) => {
onCardClicked={cardClicked}
selectedCardIds={selectedCardIds}
addCard={(show) => addCard('', show)}
hiddenCardsCount={props.hiddenCardsCount}
/>}
</div>
)
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/content/checkboxElement.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const checkboxBlock: ContentBlock = {
createAt: 0,
updateAt: 0,
deleteAt: 0,
limited: false,
}

const cardDetailContextValue = (autoAdded: boolean): CardDetailContextType => ({
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/content/contentElement.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const contentBlock: ContentBlock = {
createAt: 0,
updateAt: 0,
deleteAt: 0,
limited: false,
}

const wrap = (child: ReactNode): ReactElement => (
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/content/imageElement.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('components/content/ImageElement', () => {
createAt: 0,
updateAt: 0,
deleteAt: 0,
limited: false,
}

test('should match snapshot', async () => {
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/content/textElement.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const defaultBlock: TextBlock = {
createAt: 0,
updateAt: 0,
deleteAt: 0,
limited: false,
}
describe('components/content/TextElement', () => {
beforeAll(() => {
Expand Down
Loading

0 comments on commit b73ccb6

Please sign in to comment.