From 3e2347ac307da34a8f168489ab584b19fb545c70 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Fri, 24 Jul 2020 11:45:24 +0200 Subject: [PATCH 1/3] add invite api to provider links, fix baseUrl --- examples/meshdirectory/static/index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/meshdirectory/static/index.html b/examples/meshdirectory/static/index.html index 10de5d71e9..2afd4a37fa 100644 --- a/examples/meshdirectory/static/index.html +++ b/examples/meshdirectory/static/index.html @@ -76,12 +76,13 @@
Service description:
}, methods: { providerLink(provider) { - const query = this.queryParams.toString() ? `?${this.queryParams}` : '' - return `${this.ocmService(provider).endpoint.path}${query}` + const query = this.queryParams.toString() ? `?${this.queryParams}` : ''; + 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'; }) } }, @@ -92,7 +93,7 @@
Service description:
}) }, baseUrl: function () { - return `${window.location.href}` + return `${window.location.pathname}`; }, queryParams: function () { return new URLSearchParams(window.location.search); @@ -105,10 +106,10 @@
Service description:
this.providers = response.data; }) .catch(err => { - console.log(err) + console.log(err); }); } }); - + \ No newline at end of file From 0276793228dd333949bf33c1606b8a808bc16244 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Fri, 24 Jul 2020 11:58:29 +0200 Subject: [PATCH 2/3] add newline --- examples/meshdirectory/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/meshdirectory/static/index.html b/examples/meshdirectory/static/index.html index 2afd4a37fa..6d5d3b3d3b 100644 --- a/examples/meshdirectory/static/index.html +++ b/examples/meshdirectory/static/index.html @@ -112,4 +112,4 @@
Service description:
}); - \ No newline at end of file + From 6251a7641884f5132d277de4ac3208ddf05ee7a8 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Fri, 24 Jul 2020 15:15:31 +0200 Subject: [PATCH 3/3] add changelog --- changelog/unreleased/meshdir-add-invite-to-links.md | 8 ++++++++ examples/meshdirectory/static/index.html | 1 + 2 files changed, 9 insertions(+) create mode 100644 changelog/unreleased/meshdir-add-invite-to-links.md diff --git a/changelog/unreleased/meshdir-add-invite-to-links.md b/changelog/unreleased/meshdir-add-invite-to-links.md new file mode 100644 index 0000000000..6fdc7da9a3 --- /dev/null +++ b/changelog/unreleased/meshdir-add-invite-to-links.md @@ -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 diff --git a/examples/meshdirectory/static/index.html b/examples/meshdirectory/static/index.html index 2afd4a37fa..fa553a65af 100644 --- a/examples/meshdirectory/static/index.html +++ b/examples/meshdirectory/static/index.html @@ -77,6 +77,7 @@
Service description:
methods: { providerLink(provider) { 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}`; },