-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mnoe 669] Company deletion #398
Open
enizor
wants to merge
6
commits into
maestrano:2.0
Choose a base branch
from
enizor:MNOE-669
base: 2.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab10395
[MNOE-669] Company Deletion component
enizor 9589d2b
[MNOE-669] Deletion confirmation modal
enizor 0013485
[MNOE-669] Hide tabs & panels when org isn't active
enizor d97dea0
[MNOE-669] Internationalization
enizor 156d694
[MNOE-669] Address code review
enizor ea01429
[MNOE-669] Code review
enizor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/app/components/dashboard-company-deletion/dashboard-company-deletion.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
angular.module 'mnoEnterpriseAngular' | ||
.component('dashboardCompanyDeletion', { | ||
restrict: 'EA' | ||
templateUrl: 'app/components/dashboard-company-deletion/dashboard-company-deletion.html', | ||
controllerAs: "DashboardCompanyDeletionCtrl" | ||
controller: ($uibModal, MnoeCurrentUser, MnoeOrganizations, MnoeAppInstances, MnoConfirm) -> | ||
vm = this | ||
vm.isDeletionOpen = false | ||
|
||
vm.proceed = (reason, password) -> | ||
MnoeOrganizations.freeze(reason, password) | ||
|
||
vm.requestDeletion = () -> | ||
modalInstance = $uibModal.open( | ||
component: "dashboardDeletionConfirm", | ||
size: "lg", | ||
resolve: | ||
actionCb: () -> vm.proceed | ||
) | ||
return | ||
}) |
11 changes: 11 additions & 0 deletions
11
src/app/components/dashboard-company-deletion/dashboard-company-deletion.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div uib-accordion class="accordion"> | ||
<div uib-accordion-group is-open="DashboardCompanyDeletionCtrl.isDeletionOpen"> | ||
<div uib-accordion-heading> | ||
{{ 'mno_enterprise.templates.dashboard.organization.settings.company_deletion' | translate }}<span class="fa pull-right" ng-class="{'fa-caret-down': !DashboardCompanyDeletionCtrl.isDeletionOpen, 'fa-caret-up': DashboardCompanyDeletionCtrl.isDeletionOpen}"></span> | ||
</div> | ||
<div translate="mno_enterprise.templates.dashboard.organization.settings.deletion_info_html"></div> | ||
<button ng-click="DashboardCompanyDeletionCtrl.requestDeletion()" class='btn btn-warning'> | ||
{{ 'mno_enterprise.templates.dashboard.organization.settings.request_deletion' | translate }} | ||
</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/app/components/dashboard-deletion-confirm/dashboard-deletion-confirm.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
angular.module 'mnoEnterpriseAngular' | ||
.component('dashboardDeletionConfirm', { | ||
templateUrl: 'app/components/dashboard-deletion-confirm/dashboard-deletion-confirm.html', | ||
bindings: { | ||
resolve: '<' | ||
close: '&' | ||
dismiss: '&' | ||
} | ||
controller: ($log, $state, toastr) -> | ||
ctrl = this | ||
ctrl.password = "" | ||
ctrl.delReasons = "" | ||
ctrl.isLoading = false | ||
|
||
ctrl.cancel = () -> | ||
ctrl.dismiss({$value: "cancel"}) | ||
|
||
ctrl.ok = () -> | ||
ctrl.isLoading = true | ||
|
||
# Launch Cb | ||
ctrl.resolve.actionCb(ctrl.delReasons, ctrl.password).then( | ||
(response) -> | ||
toastr.success('Organization successfully frozen') | ||
# Reload the state to block access to Impac!, marketplace, ... | ||
$state.reload() | ||
ctrl.close(response) | ||
(errors) -> | ||
$log.error(errors) | ||
toastr.error(errors.statusText, "Error") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Locale key to add for i18n |
||
).finally(-> ctrl.isLoading = false) | ||
return | ||
}) |
24 changes: 24 additions & 0 deletions
24
src/app/components/dashboard-deletion-confirm/dashboard-deletion-confirm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="modal-body"> | ||
<div translate="mno_enterprise.templates.dashboard.organization.settings.confirm_deletion_html"></div> | ||
<div class="form-group"> | ||
<label for="delCompanyReasons"> | ||
{{ 'mno_enterprise.templates.dashboard.organization.settings.deletion_reason' | translate }} | ||
</label> | ||
<textarea type="text" class="form-control" ng-model="$ctrl.delReasons" id="delCompanyReasons"></textarea> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="delCompanypassword"> | ||
{{ 'mno_enterprise.templates.dashboard.organization.settings.confirm_password' | translate }} | ||
</label> | ||
<input type="password" class="form-control" id="delCompanypassword" ng-model="$ctrl.password"> | ||
</div> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty line to remove |
||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" ng-click="$ctrl.cancel()">{{ 'mno_enterprise.templates.dashboard.organization.settings.cancel' | translate }}</button> | ||
<button type="button" class="btn btn-warning" ng-click="$ctrl.ok()" ng-disabled="$ctrl.isLoading || $ctrl.password === ''"> | ||
<span ng-show="$ctrl.isLoading"><i class="fa fa-spinner fa-pulse fa-fw"></i></span> | ||
{{ 'mno_enterprise.templates.dashboard.organization.settings.confirm_deletion' | translate }} | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locale key to add for i18n