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

meshdirectory: Add invite forward API to provider links #1000

Merged
merged 4 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/meshdir-add-invite-to-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Enable forwarding of share invites to the provider selected in meshdirectory

Added a share invite forward OCM endpoint to the provider links (generated when a user
picks a target provider in the meshdirectory service web interface), together with an
invitation token and originating provider domain passed to the service via query params.

https://github.com/cs3org/reva/pull/1000
https://github.com/sciencemesh/sciencemesh/issues/139
12 changes: 7 additions & 5 deletions examples/meshdirectory/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ <h5>Service description:</h5>
},
methods: {
providerLink(provider) {
const query = this.queryParams.toString() ? `?${this.queryParams}` : ''
return `${this.ocmService(provider).endpoint.path}${query}`
const query = this.queryParams.toString() ? `?${this.queryParams}` : '';
// TODO(mirekys): sanitize possible double slash
const inviteApi = `${this.ocmService(provider).endpoint.path}/invites/forward`;
mirekys marked this conversation as resolved.
Show resolved Hide resolved
return `${inviteApi}${query}`;
},
ocmService(provider) {
return provider.services.find(s => {
return s.endpoint.type.name === 'OCM'
return s.endpoint.type.name === 'OCM';
})
}
},
Expand All @@ -92,7 +94,7 @@ <h5>Service description:</h5>
})
},
baseUrl: function () {
return `${window.location.href}`
return `${window.location.pathname}`;
},
queryParams: function () {
return new URLSearchParams(window.location.search);
Expand All @@ -105,7 +107,7 @@ <h5>Service description:</h5>
this.providers = response.data;
})
.catch(err => {
console.log(err)
console.log(err);
});
}
});
Expand Down