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

Use SiteURL for all calls from the webapp #61

Closed
Tracked by #91 ...
mickmister opened this issue Jul 21, 2020 · 1 comment · Fixed by #93
Closed
Tracked by #91 ...

Use SiteURL for all calls from the webapp #61

mickmister opened this issue Jul 21, 2020 · 1 comment · Fixed by #93
Labels
Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Hacktoberfest Help Wanted Community help wanted Tech/ReactJS Type/Enhancement New feature or improvement of existing feature
Milestone

Comments

@mickmister
Copy link
Contributor

mickmister commented Jul 21, 2020

If the server's SiteURL is configured with a subpath, the webapp's API calls do not work. The task here is to make this plugin's client to prefix its URLs with the SiteURL. This also includes any calls to /plugins/*

Only API calls to the Mattermost server should use the SiteURL. Any calls to Microsoft servers should not use the SiteURL.

Here's an example of how the SiteURL may be computed:
https://github.com/mattermost/mattermost-plugin-jira/blob/19a9c2442817132b4eee5c77e259b80a40188a6a/webapp/src/selectors/index.js#L13-L26

@mickmister mickmister added Help Wanted Community help wanted Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Tech/ReactJS Up For Grabs Ready for help from the community. Removed when someone volunteers Type/Enhancement New feature or improvement of existing feature labels Jul 21, 2020
@mickmister
Copy link
Contributor Author

mickmister commented Oct 8, 2020

By default, requests from the frontend to the server are not prefixed with any host. For example, a fetch request like fetch('/api4/users') will be sent to /api4/users. One problem this has is if the server is being hosted on a subpath, or for some reason the server's SiteURL happens to be a different host than the domain that the frontend is connected to, we need to prefix the API calls with the SiteURL.

An example before the fix:

fetch('/api4/users');

But we want

const siteURL = getSiteURL(state);
fetch(siteURL + '/api4/users');

The link in this issue's description is to a different project, just to show how to get the SiteURL. This fix needs to be applied to other plugin projects as well, such as the skype4business plugin here. The SiteURL is currently not being used in the frontend portion of the skype4business plugin.

@hanzei hanzei added this to To do in Plugin Sprint Planning via automation May 27, 2021
@deepakdemiwal deepakdemiwal moved this from To do to In progress in Plugin Sprint Planning Jun 14, 2021
@deepakdemiwal deepakdemiwal moved this from In Progress to Dev QA in Plugin Sprint Planning Jun 17, 2021
@deepakdemiwal deepakdemiwal moved this from Dev QA to In Progress in Plugin Sprint Planning Jun 24, 2021
@deepakdemiwal deepakdemiwal moved this from In Progress to To do in Plugin Sprint Planning Jun 28, 2021
@deepakdemiwal deepakdemiwal moved this from To do to Dev QA in Plugin Sprint Planning Jun 30, 2021
@deepakdemiwal deepakdemiwal moved this from Dev QA to Submitted in Plugin Sprint Planning Jul 12, 2021
@mickmister mickmister removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label Jul 13, 2021
@deepakdemiwal deepakdemiwal moved this from Submitted to Dev QA in Plugin Sprint Planning Jul 15, 2021
@deepakdemiwal deepakdemiwal moved this from Dev QA to To Review By Mattermost in Plugin Sprint Planning Aug 2, 2021
@hanzei hanzei moved this from To Review By Mattermost to Submitted in Plugin Sprint Planning Aug 3, 2021
@hanzei hanzei added this to the v1.0.0 milestone Sep 2, 2021
@hanzei hanzei linked a pull request Sep 21, 2021 that will close this issue
@hanzei hanzei removed this from Submitted in Plugin Sprint Planning Mar 15, 2022
@hanzei hanzei mentioned this issue Dec 15, 2022
2 tasks
Kshitij-Katiyar added a commit to Brightscout/mattermost-plugin-skype4business that referenced this issue Dec 29, 2022
Kshitij-Katiyar added a commit to Brightscout/mattermost-plugin-skype4business that referenced this issue Dec 30, 2022
* add domain in client js file

* add url

* fixed lint issues

* updated lint issues

* updated style changes

* resolved comments , removed unwanted changes

* resolved comments

* resolved comments

* resolved comments

* resolved comments

* resolved comments

* resolved comments

* resolved comments

* [MI-2506]:Fixed issue mattermost-community#61 of skype4business

Co-authored-by: sanjay12345 <sanjaymj824@gmail.com>
Co-authored-by: Maisnam Raju Singh <85172229+maisnamrajusingh@users.noreply.github.com>
Co-authored-by: maisnamrajusingh <raju.s@demansol.com>
@hanzei hanzei linked a pull request Jan 31, 2023 that will close this issue
@hanzei hanzei mentioned this issue Feb 15, 2023
1 task
hanzei pushed a commit that referenced this issue Mar 21, 2023
Co-authored-by: sanjay12345 <sanjaymj824@gmail.com>
Co-authored-by: Maisnam Raju Singh <85172229+maisnamrajusingh@users.noreply.github.com>
Co-authored-by: maisnamrajusingh <raju.s@demansol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Hacktoberfest Help Wanted Community help wanted Tech/ReactJS Type/Enhancement New feature or improvement of existing feature
Projects
None yet
4 participants