Skip to content

Commit

Permalink
meshdirectory: Add invite forward API to provider links (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirekys authored Jul 24, 2020
1 parent d5d81ac commit 014c93a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
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`;
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

0 comments on commit 014c93a

Please sign in to comment.