From 0ecb52b6e64c5d09b34535b4831c044ed4e6758c Mon Sep 17 00:00:00 2001 From: Emmanuel Darnis Date: Mon, 5 Feb 2018 16:37:10 +0000 Subject: [PATCH] Add previous next when linking account --- .../connect-addon-modal.coffee | 21 +++++++++++++++ .../connect-addon-modal.html | 26 ++++++++++--------- .../apps/modals/app-settings-modal.coffee | 2 +- .../views/apps/modals/app-settings-modal.html | 2 +- src/locales/en.json | 2 ++ 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/app/components/connect-addon-modal/connect-addon-modal.coffee b/src/app/components/connect-addon-modal/connect-addon-modal.coffee index f7c9c045..967a512f 100644 --- a/src/app/components/connect-addon-modal/connect-addon-modal.coffee +++ b/src/app/components/connect-addon-modal/connect-addon-modal.coffee @@ -54,6 +54,27 @@ angular.module('mnoEnterpriseAngular').component('connectAddonModal', { ctrl.isUpdating = false ) + ctrl.backClick = -> + switch ctrl.currentStep + when 1 then ctrl.disconnect() + when 2 then ctrl.unselectEntities() + + ctrl.nextClick = -> + switch ctrl.currentStep + when 0 then ctrl.submitForm() + when 1 then ctrl.updateEntities() + when 2 then ctrl.synchronize(ctrl.historicalData) + + ctrl.disconnect = -> + ctrl.isDisconnecting = true + MnoeAppInstances.disconnect(ctrl.app) + .then((response) -> + ctrl.app.addon_organization.has_account_linked = false + ctrl.app.addon_organization.sync_enabled = false + ctrl.currentStep = 0 + ctrl.isDisconnecting = false + ) + ctrl.synchronize = (historicalData) -> MnoeAppInstances.sync(ctrl.app, historicalData) ctrl.app.addon_organization.sync_enabled = true diff --git a/src/app/components/connect-addon-modal/connect-addon-modal.html b/src/app/components/connect-addon-modal/connect-addon-modal.html index a444da85..969ceac5 100644 --- a/src/app/components/connect-addon-modal/connect-addon-modal.html +++ b/src/app/components/connect-addon-modal/connect-addon-modal.html @@ -63,17 +63,19 @@

{{"mno_enterprise.templates.components.addon_connect.syn diff --git a/src/app/views/apps/modals/app-settings-modal.coffee b/src/app/views/apps/modals/app-settings-modal.coffee index ba3116c5..83abd4bd 100755 --- a/src/app/views/apps/modals/app-settings-modal.coffee +++ b/src/app/views/apps/modals/app-settings-modal.coffee @@ -162,7 +162,7 @@ angular.module 'mnoEnterpriseAngular' template: htmlTemplate } - $scope.loadIdMaps = (externalName, input = null) -> + $scope.loadIdMaps = (externalName = 'All', input = null) -> $scope.idMaps.loading = true $scope.idMaps.entityName = externalName params = { diff --git a/src/app/views/apps/modals/app-settings-modal.html b/src/app/views/apps/modals/app-settings-modal.html index ef3c47f1..51245654 100755 --- a/src/app/views/apps/modals/app-settings-modal.html +++ b/src/app/views/apps/modals/app-settings-modal.html @@ -32,7 +32,7 @@

{{ 'mno_en - +