Skip to content
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

MM-59373: Respecting name display preference in boards #22

Merged
merged 10 commits into from
Nov 8, 2024

Conversation

Rajat-Dabade
Copy link
Contributor

Summary

Added support to respect name display preference from channel to boards.

Ticket Link

https://mattermost.atlassian.net/browse/MM-59373

@Rajat-Dabade Rajat-Dabade self-assigned this Oct 8, 2024
@Rajat-Dabade Rajat-Dabade added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Oct 8, 2024
Copy link
Member

@jespino jespino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

className='comment-text'
dangerouslySetInnerHTML={{__html: html}}
/>
<Provider store={(window as any).store}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share why do we need to create a store provider here? It does't look right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Provider is necessary in this context because the function messageHtmlToComponent depends on certain state and actions that are part of the mmStore which is exposed on window object.

@@ -87,3 +93,19 @@ export const getCurrentTeamId = (state: RootState): string => state.teams.curren
export const getCurrentTeam = (state: RootState): Team|null => state.teams.current
export const getFirstTeam = (state: RootState): Team|null => state.teams.allTeams[0]
export const getAllTeams = (state: RootState): Team[] => state.teams.allTeams


export const getChannelsNameMapInTeam: (state: GlobalState, teamId: string) => Record<string, Channel> = createSelector(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as its not being used. We're using the selector directly from MM redux package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

export const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@hmhealey hmhealey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'm going to take a look at how to better ship the web app's Markdown code for the hackathon later this week, so I'm looking forward to building off this and hopefully making this much easier next time it happens

import Comment from './comment'

jest.mock('../../mutator')
const mockedMutator = mocked(mutator, true)
jest.mock('../../webapp_globals', () => ({
...jest.requireActual('../../webapp_globals'),
messageHtmlToComponent: jest.fn(() => <div className="mocked-message-html">Test Comment</div>),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't part of this PR, but when I saw this, I realized that whenever we get to shipping a plugin API package from the web app, it should include mock versions of all the APIs to make writing tests that use them easier.

In the mean time, you could add this to the Jest setup script to avoid having to redefine it in multiple test files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmhealey Looking at the repo now, I realize that jest.config.js isn’t configured in the board/focalboard repo. I’m planning to set up the proper Jest configuration in a follow-up PR, which will include the changes mentioned above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually configured as part of the package.json currently, but moving it out to it's own file and setting it up a bit better makes sense to me. While it's nice to use fewer files sometimes, I prefer having it spread out since the package.json already does so much stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it. Done.

@marianunez
Copy link
Member

@yasserfaraazkhan gentle ping on this one so we can include this last PR in the boards release.

@hmhealey hmhealey removed the 2: Dev Review Requires review by a core committer label Nov 7, 2024
Copy link

@yasserfaraazkhan yasserfaraazkhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

able to see users's firsname and last name when mentioned on the cards and in boards bot messages.

image image

@Rajat-Dabade Rajat-Dabade merged commit 957a8f2 into main Nov 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants