Skip to content

Commit

Permalink
Regression: uninstall subscribed app modal (#15077)
Browse files Browse the repository at this point in the history
* Add option to change cancel button color on modal

* Avoid an extra modal when uninstalling subscribed app
  • Loading branch information
tassoevan authored and sampaiodiego committed Aug 1, 2019
1 parent ee2ed86 commit ecc1ba1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/apps/client/admin/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const promptSubscribedAppUninstall = () => new Promise((resolve) => {
showCancelButton: true,
confirmButtonText: t('Apps_Marketplace_Modify_App_Subscription'),
cancelButtonText: t('Apps_Marketplace_Uninstall_Subscribed_App_Anyway'),
cancelButtonColor: '#DD6B55',
closeOnConfirm: true,
html: false,
}, resolve, () => resolve(false));
Expand Down Expand Up @@ -200,6 +201,13 @@ export const triggerAppPopoverMenu = (app, currentTarget, instance) => {
}
return;
}

try {
await Apps.uninstallApp(app.id);
} catch (error) {
handleAPIError(error);
}
return;
}

if (!await promptAppUninstall()) {
Expand Down
2 changes: 1 addition & 1 deletion app/ui-utils/client/lib/modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h1 class="rc-modal__title">
</section>
{{# if showFooter }}
<footer class="rc-modal__footer {{#unless showFooter}}rc-modal__footer--empty{{/unless}}">
<input class="rc-button rc-button--nude js-close {{#unless showCancelButton}}rc-button--invisible{{/unless}}" type="submit" data-button="cancel" value="{{cancelButtonText}}">
<input class="rc-button rc-button--nude js-close {{#unless showCancelButton}}rc-button--invisible{{/unless}}" style="{{#if cancelButtonColor}}color: {{cancelButtonColor}}{{/if}}" type="submit" data-button="cancel" value="{{cancelButtonText}}">
<input style="background-color:{{confirmButtonColor}}" class="rc-button rc-button--primary js-confirm {{#unless showConfirmButton}}rc-button--invisible{{/unless}}" type="submit" data-button="create" value="{{confirmButtonText}}">
</footer>
{{/if}}
Expand Down

0 comments on commit ecc1ba1

Please sign in to comment.