Skip to content

Commit

Permalink
Change withdraw invitation to remove invitation.
Browse files Browse the repository at this point in the history
Add confirmation dialogs to remove, decline, revoke invitation.
  • Loading branch information
redblom committed May 13, 2024
1 parent ccdda06 commit 5cd927e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 10 deletions.
39 changes: 33 additions & 6 deletions js/invitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@
event.preventDefault();
event.stopPropagation();
$('div#invitation-index-message span.message').empty();
_updateInvite(token, 'declined');
OC.dialogs.confirm(
t('invitation', 'decline-invitation-confirmation-title'),
t('invitation', 'decline-invitation-confirmation-message'),
function (declined) {
if (declined == true) {
_updateInvite(token, 'declined');
}
},
true
);
}
);
return declineButton;
Expand All @@ -93,22 +102,40 @@
event.preventDefault();
event.stopPropagation();
$('div#invitation-index-message span.message').empty();
_updateInvite(token, 'revoked');
OC.dialogs.confirm(
t('invitation', 'revoke-invitation-confirmation-title'),
t('invitation', 'revoke-invitation-confirmation-message'),
function (revoked) {
if (revoked == true) {
_updateInvite(token, 'revoked');
}
},
true
);
}
);
return revokeButton;
}
if (status === 'withdrawn') {
var revokeButton = $('<a class="pure-button" href="#">' + t('invitation', 'withdraw') + '</a>');
revokeButton.on(
var withdrawButton = $('<a class="pure-button" href="#">' + t('invitation', 'withdraw') + '</a>');
withdrawButton.on(
"click", function (event) {
event.preventDefault();
event.stopPropagation();
$('div#invitation-index-message span.message').empty();
_updateInvite(token, 'withdrawn');
OC.dialogs.confirm(
t('invitation', 'withdraw-invitation-confirmation-title'),
t('invitation', 'withdraw-invitation-confirmation-message'),
function (withdraw) {
if (withdraw == true) {
_updateInvite(token, 'withdrawn');
}
},
true
);
}
);
return revokeButton;
return withdrawButton;
}
};

Expand Down
9 changes: 8 additions & 1 deletion l10n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ OC.L10N.register(
"OCM_INVITE_ACCEPTED_NOT_FOUND": "The sender informs us that the invitation does not exist (anymore).",
"OCM_INVITE_ACCEPTED_EXISTS": "The sender informs us that an accepted invitation already exists.",
"Your invitation has been sent to": "Your invitation has been send to {recipientName} ({recipientEmail}). When the receiver accepts the invitation it will appear in the list of accepted invitations.",
"withdraw": "remove",
"confirmation-header": "Please note that the following information will be shared with the receiver of the invitation:",
"confirmation": "<p>Your cloud ID: {cloudId}<br>Your email: {email}<br>Your name: {name}<br><br></p>",
"sent": "Sent to",
Expand All @@ -30,6 +31,12 @@ OC.L10N.register(
"SETTINGS_ADD_PROVIDER_IS_NOT_REMOTE_ERROR": "Only remote providers can be added.",
"MESH_REGISTRY_GET_SERVICE_PROVIDERS_ERROR": "An error has occurred. Could not retrieve service providers.",
"MESH_REGISTRY_DELETE_SERVICE_PROVIDER_ERROR": "An error has occurred. Could not delete service provider.",
"MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR": "This is a required field."
"MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR": "This is a required field.",
"withdraw-invitation-confirmation-title": "If you remove this accepted invitation you will not be able to search for the remote user anymore when creating shares. Are you sure?",
"withdraw-invitation-confirmation-message": "Remove accepted invitation?",
"decline-invitation-confirmation-title": "Are you sure?",
"decline-invitation-confirmation-message": "Decline this invitation",
"revoke-invitation-confirmation-title": "Are you sure?",
"revoke-invitation-confirmation-message": "Revoke this invitation"
},
"nplurals=2; plural=(n != 1);");
12 changes: 9 additions & 3 deletions l10n/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@ OC.L10N.register(
"accept": "accepteer",
"accepted": "geaccepteerde",
"received": "Ontvangen van",
"withdraw": "intrekken",
"withdraw": "verwijder",
"decline": "afwijzen",
"revoke": "intrekken",
"confirmation-header": "Let op, the volgende informatie zal worden gedeeld met de ontvanger van de uitnodiging:",
"confirmation": "<p>Uw cloud ID: {cloudId}<br>Uw email: {email}<br>Uw naam: {name}<br><br></p>",
"explanation": "<h2>Invite a remote user to exchange cloud ID's.</h2>If you want to share data with a Research Drive user from a <b>different institute</b> you need that person's cloud ID.<br>You can obtain the cloud ID of the person you want to share with by sending a one time invitation.<br>When this person accepts the invitation your cloud IDs will be exchanged and saved in each others Research Drive environment.<br>From then on, when sharing, you can find that remote person by name, email or institute name.",
"explanation": "<h2>Een remote gebruiker uitnodigen om cloud IDs uit te wisselen.</h2>Om data te kunnen delen met een Research Drive gebruiker van een <b>ander instituut</b> heeft u het cloud ID van die gebruiker nodig.<br>U kunt middels een eenmalige uitnodiging deze remote gebruiker verzoeken uw cloud IDs uit te wisselen.<br>Wanneer die gebruiker de uitnodiging accepteert worden de cloud IDs automatisch uitgewisseld en opgeslagen in de Research Drive omgeving.<br>Vanaf dat moment kunt u bij het data delen elkaar vinden op basis van naam, email en naam van het instituut.",
"MESH_REGISTRY_ADD_PROVIDER_ERROR": "Er is iets misgegaan. Kan geen provider toevoegen.",
"MESH_REGISTRY_UPDATE_PROVIDER_ERROR": "Er is iets misgegaan. Kan provider niet aanpassen.",
"SETTINGS_UPDATE_ERROR": "An error has occurred. Kon deze setting niet updaten.",
"SETTINGS_ADD_PROVIDER_IS_NOT_REMOTE_ERROR": "Alleen remote providers kunnen toegevoegd worden.",
"MESH_REGISTRY_GET_SERVICE_PROVIDERS_ERROR": "Er is iets misgegaan. Kan geen providers ophalen.",
"MESH_REGISTRY_DELETE_SERVICE_PROVIDER_ERROR": "Er is iets misgegaan. Kan provider niet verwijderen.",
"MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR": "Dit is een verplicht veld."
"MESH_REGISTRY_UPDATE_PROVIDER_REQUIRED_FIELD_ERROR": "Dit is een verplicht veld.",
"withdraw-invitation-confirmation-title": "Als u deze geaccepteerde uitnodiging verwijdert kunt u niet meer zoeken naar de remote gebruiker bij het creëren van een share. Weet u het zeker?",
"withdraw-invitation-confirmation-message": "Verwijder geaccepteerde uitnodiging.",
"decline-invitation-confirmation-title": "Weet u dit zeker?",
"decline-invitation-confirmation-message": "Wijs deze uitnodiging af.",
"revoke-invitation-confirmation-title": "Weet u dit zeker?",
"revoke-invitation-confirmation-message": "Deze uitnodiging intrekken."
},
"nplurals=2; plural=(n != 1);");

0 comments on commit 5cd927e

Please sign in to comment.