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

Fix "Create issue modal crashes when assignee is selected before switching projects" #834

Closed
wants to merge 12 commits into from

Conversation

sanjaydemansol
Copy link

@sanjaydemansol sanjaydemansol commented Feb 8, 2022

Summary

Ticket Link

Fixes #819

@mattermod
Copy link
Contributor

Hello @sanjaydemansol,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@hanzei hanzei added the Work In Progress Not yet ready for review label Feb 8, 2022
@hanzei hanzei removed the request for review from mickmister February 8, 2022 13:31
@hanzei
Copy link
Collaborator

hanzei commented Feb 8, 2022

@sanjaydemansol
Copy link
Author

@hanzei yes. checking it

@mickmister mickmister changed the title - fix #819 Fix "Create issue modal crashes when assignee is selected before switching projects" Feb 8, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #834 (404b23c) into master (b62a305) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 404b23c differs from pull request most recent head cc69d97. Consider uploading reports for the commit cc69d97 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #834      +/-   ##
==========================================
- Coverage   34.84%   34.81%   -0.04%     
==========================================
  Files          52       52              
  Lines        5949     5949              
==========================================
- Hits         2073     2071       -2     
- Misses       3664     3666       +2     
  Partials      212      212              
Impacted Files Coverage Δ
server/subscribe.go 66.85% <0.00%> (-0.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b62a305...cc69d97. Read the comment docs.

@hanzei hanzei requested a review from levb February 8, 2022 14:25
@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester and removed Work In Progress Not yet ready for review labels Feb 8, 2022
@hanzei hanzei added this to the v3.2.0 milestone Feb 8, 2022
@hanzei hanzei removed their request for review February 9, 2022 12:07
Copy link

@dipak-demansol dipak-demansol left a comment

Choose a reason for hiding this comment

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

LGTM
Note :- Non Blocking note that, this PR binary file is not working (crash when i enable it) in the demansol-sandbox server 6.3 but the same binary is working on My stagingTK server 6.3

@dipak-demansol dipak-demansol added Do Not Merge Should not be merged until this label is removed QA Review Done PR has been approved by QA and removed Do Not Merge Should not be merged until this label is removed 3: QA Review Requires review by a QA tester labels Feb 9, 2022
@maisnamrajusingh
Copy link
Contributor

maisnamrajusingh commented Feb 10, 2022

@mickmister over to you and @levb

Comment on lines 163 to 171
label: (
<span>
<img
src={v.avatarUrls[AvatarSize.SMALL]}
style={{width: '24px', marginRight: '10px'}}
/>
<span>{v.displayName}</span>
</span>
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @sanjaydemansol, I'm not sure how this fixes the issue, mainly because I don't know what the problem originally was that was causing the crash. Do you mind explaining what the problem is, and how this PR solves it?

Copy link
Contributor

Choose a reason for hiding this comment

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

This component backend_selector.tsx is meant for general purpose autocomplete functionality, so we shouldn't have anything to do with users or avatars in this file. Why are you thinking this fix needs to go here?

Copy link
Author

@sanjaydemansol sanjaydemansol Feb 10, 2022

Choose a reason for hiding this comment

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

@mickmister There was v assigned to label and that was an object, because of that it was not able to render it properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sanjaydemansol I'm thinking the assignee-specific change needs to be applied to https://github.com/mattermost/mattermost-plugin-jira/blob/master/webapp/src/components/data_selectors/jira_user_selector/jira_user_selector.tsx. It makes sense if there's also a small change needed in backend_selector.tsx, but we shouldn't be referencing anything to do with avatars in this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if you accidentally leave out a mention in your comment, can you please create a new comment, rather than editing the comment to include the mention? I didn't get a notification because of this, and I just happened to have the tab open and saw your comment here 🙂

Copy link
Author

Choose a reason for hiding this comment

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

@mickmister I'll remove avatar, as you've suggested here (#834 (comment)).
I'll check and put specific and which won't generate error at label.

Copy link
Author

Choose a reason for hiding this comment

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

@mickmister code updated, removed avatar and code is not generating any errors.

Copy link
Contributor

Choose a reason for hiding this comment

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

code is not generating any errors.

@sanjaydemansol To be clear: Before your fix, the webapp was crashing correct? And after your fix, it is not crashing.

@@ -8,7 +8,7 @@ import AsyncSelect from 'react-select/async';

import {Theme} from 'mattermost-redux/types/preferences';

import {IssueMetadata, ReactSelectOption, JiraIssue, SearchIssueParams, APIResponse} from 'types/model';
import {IssueMetadata, ReactSelectOption, JiraIssue, SearchIssueParams, APIResponse, AvatarSize} from 'types/model';
Copy link
Contributor

Choose a reason for hiding this comment

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

This import should be removed

Comment on lines 162 to 165
return {
label: v,
label: v.displayName,
value: v,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

@sanjaydemansol Can you please explain this fix? All other types of selectors (non-user) seem to be working correctly. Do they actually need to have this change (which they do receive the change if it is applied in this file)? It seems the problem is specific to users, so I would expect the fix to go into jira_user_selector.tsx.

Can you please describe how you discovered the root cause, and how this fixes it? What is the error printed to the console during the crash, and what line does it occur on?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mickmister this is unrelated to the issue. I'm not sure why it is here. I have updated the code to remove this. The crash is caused by the assignee property not being reset. I am awaiting dipak to finish the qa on this one.

@hanzei hanzei added the Awaiting Submitter Action Blocked on the author label Feb 22, 2022
@DHaussermann DHaussermann added 3: QA Review Requires review by a QA tester and removed QA Review Done PR has been approved by QA labels Feb 22, 2022
@DHaussermann
Copy link

@hanzei Do you know if someone else able to implement the feedback suggested above instead of @sanjaydemansol?

@hanzei
Copy link
Collaborator

hanzei commented Feb 23, 2022

@maisnamrajusingh Who is taking ownership of this PR?

* wip - first wizard works

* wip

* wip

* wip

* first steps cloud + new flow

* Cloud working, complete sans copy, images

* cleanup

* more cleanup

* go.mod

* Updates to flow lib

* Added delegation

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* PR feedback: copy

* go mod tidy

* Added Jira Server flow

* adjusted IsJiraAccessible test

* Update server/setup_flow.go

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

* Update server/setup_flow.go

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

* PR feeback

* cloud subtype text, not url

* PR feedback, fixed public key encoding

* go.mod point at the latest plugin-api

* PR feeback and fixes

* Removed skip button

* Removed SKIP button

* Added telemetry

* fixed a crash in telemetry

* copy consistency

* fixed delegate complete notification, connect was not working, now done

* Fixed webhook URL display escaping

* Finished draft copy

* Added announcement to channel steps

* Fixed capitalization in titles

* Update server/command_test.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/command_test.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/command_test.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/command_test.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/command_test.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/command_test.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/utils/utils.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/utils/utils.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* copy/test fixups

* PR Feedback: delegate step, copy, style

* Copy changes (mattermost#838)

* Update text

Some small text changes

* Jira update text

* Updates commit

up to line 267

* Additonal text changes.

* lint

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update server/setup_flow.go

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* PR feedback: copy

Co-authored-by: Aaron Rothschild <aaron.rothschild@gmail.com>
Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* PR feedback: cancel and done

* PR feedback: webhook copy

* PR feedback: removed 'Confirmed' title as redundant

* Removed stats, added daily telemetry (mattermost#836)

* Removed stats, added daily telemetry

* lint

* Fixed webhook URL display escaping

* Finished draft copy

* go.mod like github

* added the hooks

* PR feedback: copy

* PR feedback: go.mod clean comment

* Flow Step.WithImage changes, gofmt

* Updated configure webhook screenshot

Co-authored-by: Lev Brouk <levbrouk@levs-mbp.lan>
Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Aaron Rothschild <aaron.rothschild@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
@maisnamrajusingh
Copy link
Contributor

@maisnamrajusingh Who is taking ownership of this PR?

im taking over @hanzei

@hanzei hanzei modified the milestones: v3.2.0, v3.3.0 Mar 1, 2022
levb and others added 3 commits March 1, 2022 09:05
Co-authored-by: Lev Brouk <lev@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
@maisnamrajusingh
Copy link
Contributor

@DHaussermann I'm sending out a pr that fixes this. right now @dipak-demansol is doing qa on it.

@maisnamrajusingh
Copy link
Contributor

@mickmister closing this one and opening another one as there are lots of unrelated changes

@mattermod mattermod removed the Awaiting Submitter Action Blocked on the author label Mar 8, 2022
@hanzei hanzei added Invalid This doesn't seem right and removed 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Mar 8, 2022
@hanzei hanzei removed this from the v3.3.0 milestone Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create issue modal crashes when assignee is selected before switching projects
9 participants