-
Notifications
You must be signed in to change notification settings - Fork 87
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
[issue-234] Hide Toolbar #288
Conversation
Hello @sibasankarnayak, 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. |
Codecov Report
@@ Coverage Diff @@
## master #288 +/- ##
==========================================
- Coverage 28.59% 28.53% -0.06%
==========================================
Files 20 20
Lines 2595 2600 +5
==========================================
Hits 742 742
- Misses 1769 1774 +5
Partials 84 84
Continue to review full report at Codecov.
|
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.
Great work @sibasankarnayak 👍 Just a few requests
server/api.go
Outdated
@@ -70,6 +74,8 @@ func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Req | |||
p.completeConnectUserToGitlab(w, r) | |||
case "/api/v1/connected": | |||
p.getConnected(w, r) | |||
case "/api/v1/getsettings": |
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.
case "/api/v1/getsettings": | |
case "/api/v1/settings": |
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.
@mickmister already a route is present with same
mattermost-plugin-gitlab/server/api.go
Line 89 in 64570f1
case "/api/v1/settings": |
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.
How about client_settings
instead?
@@ -34,6 +34,10 @@ export default class Client { | |||
return this.doPost(`${this.url}/user`, {user_id: userID}); | |||
}; | |||
|
|||
getSettings = async () => { | |||
return this.doGet(`${this.url}/getsettings`); |
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.
return this.doGet(`${this.url}/getsettings`); | |
return this.doGet(`${this.url}/settings`); |
if (settings && settings.left_sidebar_enabled) { | ||
registry.registerLeftSidebarHeaderComponent(SidebarHeader); | ||
registry.registerBottomTeamSidebarComponent(TeamSidebar); | ||
} |
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.
We should have a websocket message that tells the frontend when this value has changed, and register
/unregister
based on the new 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.
@mickmister can you give a reference for this.
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.
Look for usage of gitlab_refresh
in the backend, and how it hooks into the frontend:
mattermost-plugin-gitlab/webapp/src/index.js
Lines 44 to 46 in aec8208
registry.registerWebSocketEventHandler( | |
`custom_${id}_gitlab_refresh`, | |
handleRefresh(store) |
In order to unregister a component, you need to store the id returned from registry.registerLeftSidebarHeaderComponent
etc, and pass the stored id to registry.unregisterComponent
when necessary.
@sibasankarnayak Heads up that you need to merge |
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
add logic to hide/show left gitlab sidebar actions
ticket here
Fixes #234