Merge branch 'master' into kris/download_account_fe Revert lib update (temp) Update lib Add English labels for downloading file messages Update lib Clear out active download entry on actual download Update lib update lib Add user name to action approve URL query parameters Update lib Add needed English labels for download account Co-authored-by: jonathan <jonathan@noreply.git.bubblev.org> Co-authored-by: Kristijan Mitrovic <kmitrovic@itekako.com> Reviewed-on: #8tags/v0.10.5
@@ -5,6 +5,7 @@ | |||||
package bubble.service.account.download; | package bubble.service.account.download; | ||||
import bubble.dao.account.message.AccountMessageDAO; | import bubble.dao.account.message.AccountMessageDAO; | ||||
import bubble.model.account.Account; | |||||
import bubble.server.BubbleConfiguration; | import bubble.server.BubbleConfiguration; | ||||
import com.fasterxml.jackson.databind.JsonNode; | import com.fasterxml.jackson.databind.JsonNode; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
@@ -58,7 +59,20 @@ public class AccountDownloadService { | |||||
public void cancel(String uuid) { | public void cancel(String uuid) { | ||||
getApprovedAccountData().del(uuid); | getApprovedAccountData().del(uuid); | ||||
getAccountData().del(uuid); | |||||
final var userDataString = getAccountData().get(uuid); | |||||
if (userDataString != null) { | |||||
getAccountData().del(uuid); | |||||
final var userDataJson = json(userDataString, JsonNode.class); | |||||
Account account = null; | |||||
try { | |||||
account = json(userDataJson.get("Account").get(0).textValue(), Account.class); | |||||
} catch (Exception e) { | |||||
log.warn("cancel: cannot extract account UUID from account data for request: " + uuid); | |||||
} | |||||
if (account != null) { activeDownloads.remove(account.getUuid()); } | |||||
} | |||||
} | } | ||||
public void downloadAccountData(Request req, | public void downloadAccountData(Request req, | ||||
@@ -9,14 +9,14 @@ The request was made on {{format_epoch message.ctime 'MMM dd, YYYY' network.time | |||||
If you did not make this request or would like to cancel this request, please click this link: | If you did not make this request or would like to cancel this request, please click this link: | ||||
{{publicUri}}/action?deny={{confirmationToken}} | |||||
{{publicUri}}/action?deny={{confirmationToken}}&user={{account.name}} | |||||
---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ||||
---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ||||
If you DID make this request and want to download your account data, click the link below. | If you DID make this request and want to download your account data, click the link below. | ||||
{{publicUri}}/action?approve={{confirmationToken}} | |||||
{{publicUri}}/action?approve={{confirmationToken}}&user={{account.name}} | |||||
---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ||||
---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ||||
@@ -34,9 +34,12 @@ button_label_update_profile=Update | |||||
link_label_change_password=Change Password | link_label_change_password=Change Password | ||||
link_label_account_ssh_keys=Manage SSH Keys | link_label_account_ssh_keys=Manage SSH Keys | ||||
link_label_account_policy=Account Policy and Contact Info | link_label_account_policy=Account Policy and Contact Info | ||||
link_label_account_download=Request Account Data Download | |||||
link_label_account_payments=Payment Methods and Credits | link_label_account_payments=Payment Methods and Credits | ||||
link_label_account_bills=Bills | link_label_account_bills=Bills | ||||
message_profile_update_success=Profile update was successful | message_profile_update_success=Profile update was successful | ||||
downloading_notice=File download will start promptly... | |||||
downloading_failed=File download failed. Please retry from the start | |||||
# Account SSH key fields | # Account SSH key fields | ||||
form_title_ssh_keys=Account SSH Keys | form_title_ssh_keys=Account SSH Keys | ||||
@@ -64,6 +67,9 @@ time_duration_days_factor=86400000 | |||||
# Policy fields | # Policy fields | ||||
form_title_account_policy=Account Policy | form_title_account_policy=Account Policy | ||||
field_label_account_download=Account Data Download | |||||
button_label_account_download=Request Download | |||||
field_label_account_download_requested_notice=We have received your request. Check your email inbox for required data. | |||||
field_label_policy_account_deletion=Account Deletion Policy | field_label_policy_account_deletion=Account Deletion Policy | ||||
field_label_policy_account_deletion_options=full_delete,block_delete | field_label_policy_account_deletion_options=full_delete,block_delete | ||||
account_deletion_name_full_delete=Full delete | account_deletion_name_full_delete=Full delete | ||||