-
Notifications
You must be signed in to change notification settings - Fork 127
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-17061] Support multiple projects for a channel subscription #232
[MM-17061] Support multiple projects for a channel subscription #232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questions:
- Can you help share a screenshot, just so I see what it looks like? (I assume it's just a multi-select dropdown like the other two fields)
- Confirming we de-duplicate values in the other two fields (events and issue types)
- Do we have a limit of how many projects can be subscribed?
@jasonblais
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One non-blocking nit.
webapp/src/components/modals/channel_settings/channel_settings_internal.jsx
Outdated
Show resolved
Hide resolved
@DHaussermann test server has latest push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor possible changes, I'll approve for now. You decide on whether to make the changes.
Nice work Michael!
@@ -65,7 +65,7 @@ func handleHTTPRequest(p *Plugin, w http.ResponseWriter, r *http.Request) (int, | |||
case routeAPICreateIssue: | |||
return withInstance(p.currentInstanceStore, w, r, httpAPICreateIssue) | |||
case routeAPIGetCreateIssueMetadata: | |||
return withInstance(p.currentInstanceStore, w, r, httpAPIGetCreateIssueMetadataForProject) | |||
return withInstance(p.currentInstanceStore, w, r, httpAPIGetCreateIssueMetadataForProjects) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -113,21 +115,54 @@ export default class ChannelSettingsModalInner extends PureComponent { | |||
}; | |||
|
|||
handleProjectChange = (id, value) => { | |||
const projectKey = value; | |||
let projects = value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe refactor into ensureArray (reuse for both handle fns)? or maybe not worth it. up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not introduce a library for this PR, I think that's what you mean. However, it does sound like a nice way to remove that ugly type checking code 😜
}); | ||
|
||
const selectedEventTypes = this.state.filters.events.filter((eventType) => { | ||
if (eventType.includes('customfield')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget -- does it always start with 'customfield' or it's always somewhere inside the type name? If it starts with, should use startsWith
just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event is event_updated_${fieldId}
where fieldId
would be something like customfield_10001
here.
issueTypeHash[issueType.value] = issueType; | ||
}); | ||
|
||
return Object.values(issueTypeHash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. I am assuming waiting for @DHaussermann to test, before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is working. Multiple project subscriptions are functional.
After the merge I will do more testing around the subscribe modal on jira server as there is an unrelated issue reported by Chris P about this.
LGTM
Also confirmed with @jasonblais we're still okay to include this change in 5.14. |
Summary
This PR allows the user to choose multiple projects for a channel subscription.
Ticket Link
https://mattermost.atlassian.net/browse/MM-17061
https://mattermost-plugin-jira-test.test.spinmint.com/test/channels/town-square