-
Notifications
You must be signed in to change notification settings - Fork 71
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
GH-154: Created the settings command to change the preferences for meeting creation #284
GH-154: Created the settings command to change the preferences for meeting creation #284
Conversation
…olve merge conflicts (#1) * add "/zoom setting usePMI" command * update from 'master' branch * save usePMI as user preference * fix error handling in /zoom usePMI setting command * update from upstream * create meeting without PMI * finish feature * fix lint * tidy go module * update tests, optimize code * tidy the go module * [MI-1996]: Resolved the bug in use PMI feature of zoom plugin 1. Resolved the problem of 500 internal server error which we were getting on clicking create new meeting when our use PMI was set to ask 2. Added c.apiURL in URL 3. Added auto suggestion for use PMI * [MI-1996]: Resolved merge conflicts * [MI-1996]: Resolved the error of make: *** No rule to make target 'webapp/node_modules'. Stop * [MI-1996]: Removed error of check-style * [MI-1996]: Resolved the error faced in golangci-lint * [MI-1996]: Review fixes done 1. Added constants at various places * [MI-1996]:Review fixes done 1. Added EOF 2. Added Proper comments * [MI-1996]:Resolved the panic that we were getting on running slash command of zoom plugin * [MI-1996]: Work in Progress * [MI-1996]:Added properly with and without PMI feature of zoom plugin * [MI-1996]: Improved code quality * [MI-1996]: Fixed CI errors * [MI-1996]:Review fixes done 1.Improved code quality 2.Added various constants * [MI-1996]: Review fixes done 1. Improved code quality 2. Changed few names * [MI-1996]:Review fixes done 1. Improved code quality 2. Improved code readability 3. Resolved gramatical mistakes * [MI-1996]: Review fixes done 1. Changed few names * [MI-1996]: Review fixes done 1. Improved code readability 2. Removed indirect dependencies 3. Changed few names * [MI-1996]: Review fixes done 1. Improved code quality 2. Returned json instead of text * Fixed CI errors * [MI-1996]:Review fixes done 1. Improved code quality Co-authored-by: lantrungseo <[email protected]>
* add "/zoom setting usePMI" command * update from 'master' branch * save usePMI as user preference * fix error handling in /zoom usePMI setting command * update from upstream * create meeting without PMI * finish feature * fix lint * tidy go module * update tests, optimize code * tidy the go module * [MI-1996]: Resolved the bug in use PMI feature of zoom plugin 1. Resolved the problem of 500 internal server error which we were getting on clicking create new meeting when our use PMI was set to ask 2. Added c.apiURL in URL 3. Added auto suggestion for use PMI * [MI-1996]: Resolved merge conflicts * [MI-1996]: Resolved the error of make: *** No rule to make target 'webapp/node_modules'. Stop * [MI-1996]: Removed error of check-style * [MI-1996]: Resolved the error faced in golangci-lint * [MI-1996]: Review fixes done 1. Added constants at various places * [MI-1996]:Review fixes done 1. Added EOF 2. Added Proper comments * [MI-1996]:Resolved the panic that we were getting on running slash command of zoom plugin * [MI-1996]: Work in Progress * [MI-1996]:Added properly with and without PMI feature of zoom plugin * [MI-1996]: Improved code quality * [MI-1996]: Fixed CI errors * [MI-1996]:Review fixes done 1.Improved code quality 2.Added various constants * [MI-1996]: Review fixes done 1. Improved code quality 2. Changed few names * [MI-1996]:Review fixes done 1. Improved code quality 2. Improved code readability 3. Resolved gramatical mistakes * [MI-1996]: Review fixes done 1. Changed few names * [MI-1996]: Review fixes done 1. Improved code readability 2. Removed indirect dependencies 3. Changed few names * [MI-1996]: Review fixes done 1. Improved code quality 2. Returned json instead of text * Fixed CI errors * [MI-1996]:Review fixes done 1. Improved code quality * [MI-1996]: Improved code quality Co-authored-by: lantrungseo <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #284 +/- ##
==========================================
- Coverage 23.51% 19.92% -3.60%
==========================================
Files 9 9
Lines 1212 1511 +299
==========================================
+ Hits 285 301 +16
- Misses 874 1155 +281
- Partials 53 55 +2
☔ View full report in Codecov by Sentry. |
4c4a8c8
to
0aadfd9
Compare
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
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 for this improvement @Nityanand13 👍 I have some requests and some questions on the code. Please let me know what you think 👍
api.On("GetPreferencesForUser", mock.AnythingOfType("string")).Return([]model.Preference{ | ||
{ | ||
UserId: "test-userid", | ||
Category: zoomPreferenceCategory, | ||
Name: zoomPMISettingName, | ||
Value: trueString, | ||
}, | ||
}, nil) |
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.
Plugins don't usually use the Preferences
API to store plugin-level preferences. It's not necessarily a problem, but I want to be consistent with other plugins. I'm really not sure if this is an issue though, @hanzei do you have thoughts on this?
server/http.go
Outdated
} | ||
http.Error(w, err.Error(), http.StatusInternalServerError) |
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.
Why do we assume err
is not nil
here?
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.
It will never be nil
here, as we are already returning earlier if this err
is nil
.
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 code was a bit different when I originally commented on this. The check for the error was inside of a nested if statement, which seemed decoupled from this line.
The control flow is not easy to follow in this function. I think part of the reason for that is we are using several variable names for errors. Are we able to use just one?
Also can we make it so the above block returns when this is an error? Then we can avoid the large if block. I think that would make this easier to read.
Removing myself as a reviewer until the conversation with @mickmister is wrapped up |
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.
A few minor questions apart of the changes already proposed.
1. Improved code quality 2. Changed the names of few constants
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
* add "/zoom setting usePMI" command * update from 'master' branch * save usePMI as user preference * fix error handling in /zoom usePMI setting command * update from upstream * create meeting without PMI * finish feature * fix lint * tidy go module * update tests, optimize code * tidy the go module * [MI-1996]: Resolved the bug in use PMI feature of zoom plugin 1. Resolved the problem of 500 internal server error which we were getting on clicking create new meeting when our use PMI was set to ask 2. Added c.apiURL in URL 3. Added auto suggestion for use PMI * [MI-1996]: Resolved merge conflicts * [MI-1996]: Resolved the error of make: *** No rule to make target 'webapp/node_modules'. Stop * [MI-1996]: Removed error of check-style * [MI-1996]: Resolved the error faced in golangci-lint * [MI-1996]: Review fixes done 1. Added constants at various places * [MI-1996]:Review fixes done 1. Added EOF 2. Added Proper comments * [MI-1996]:Resolved the panic that we were getting on running slash command of zoom plugin * [MI-1996]: Work in Progress * [MI-1996]:Added properly with and without PMI feature of zoom plugin * [MI-1996]: Improved code quality * [MI-1996]: Fixed CI errors * [MI-1996]:Review fixes done 1.Improved code quality 2.Added various constants * [MI-1996]: Review fixes done 1. Improved code quality 2. Changed few names * [MI-1996]:Review fixes done 1. Improved code quality 2. Improved code readability 3. Resolved gramatical mistakes * [MI-1996]: Review fixes done 1. Changed few names * [MI-1996]: Review fixes done 1. Improved code readability 2. Removed indirect dependencies 3. Changed few names * [MI-1996]: Review fixes done 1. Improved code quality 2. Returned json instead of text * Fixed CI errors * [MI-1996]:Review fixes done 1. Improved code quality * [MI-1996]: Improved code quality * [MI-1996]:Done the review fixes of a PR mattermost#284 1. Improved code quality 2. Changed the names of few constants * [MI-1996]: Review fixes done 1. Changed few names * [MI-1996]: Review fixes done 1. Modified error * [MI-1996]: Review fixes done 1. Changed default topic to topic * [MI-1996]: Review fixes done 1. Improved code quality Co-authored-by: lantrungseo <[email protected]>
1.Improved code readability
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.
@Nityanand13 Thanks for addressing the feedback 👍 I have a few more questions and requests
server/http.go
Outdated
} | ||
http.Error(w, err.Error(), http.StatusInternalServerError) |
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 code was a bit different when I originally commented on this. The check for the error was inside of a nested if statement, which seemed decoupled from this line.
The control flow is not easy to follow in this function. I think part of the reason for that is we are using several variable names for errors. Are we able to use just one?
Also can we make it so the above block returns when this is an error? Then we can avoid the large if block. I think that would make this easier to read.
webapp/src/client/client.js
Outdated
return response; | ||
} | ||
} catch (err) { | ||
return {err}; |
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.
Do we ever check this err
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.
Now I have removed this try catch as we are checking the error here: https://github.com/Brightscout/mattermost-plugin-zoom/blob/2537671471cc8720efdf4cb1b16cf1c6ab2247e7/webapp/src/actions/index.js#L24
* [MI-2571]: Review fixes done 1. Improved code quality and readability * [MI-2571]: Review fixes done 1.Improved code quality * [MI-2571]: Review fixes done 1. Changed status code * [MI-2571]: Review fixes done 1. Improved code quality 2. Changed few names of variables and functions * [MI-2571]: Review fixes done 1. Improved code quality
@Nityanand13 Is this ready for re-review? |
yes @mickmister |
@Nityanand13 Can you please merge |
…m into mattermostGH-154-PMI-setting-command
I have tested this PR, but it was found that the response of the question asked in the custom post can be changed at any time, even after the meeting is started. For example, in the screenshot below, the latest custom post generated has the response as "Ask", whereas the post generated earlier has the updated response as "Yes". So according to the latest post, the Zoom bot should ask the user which mail ID to use, but instead it started the meeting as the latest response stored was "Yes". Also, this being a ephermal post, the response can not be updated on refreshing the page. Kindly look into this if we can handle this case also. @mickmister @Kshitij-Katiyar @avas27JTG In addition, I am also experiencing some UI issues regarding the icons on starting a meet, which needs to be fixed. |
@asaadmahmood Would you happen to know why the camera icon is so big the screenshot above? I know you were working with the buttons here recently and I think it's unlikely that it affected that but just wojndering if you have any ideas |
…user has selected an option for PMI setting.
@mickmister @asaadmahmood I have fixed it, the issue was due to the change in SVG |
@AayushChaudhary0001 both the PMI setting's post issue and zoom video icon have been fixed now. |
@avas27JTG Can you make sure the zoom button still appears like this? |
Cool, 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.
Tested and approved
Working fine for the edge case, which was figured out earlier also, LGTM!
Summary
This PR support
/zoom settings
command, so user can choose their preferences for creating a meeting. For now, the user will get an ephemeral post on running this command with 3 buttonsYes
,No
, andAsk
.Yes
: Allow the user to use his personal meeting id to start a meeting.No
: Allow the user to use a unique meeting id to start a meeting.Ask
: Ask the user whether he wants to use his personal meeting id or a unique meeting id to start a meeting.Ticket Link
Issue #154