Skip to content

Commit

Permalink
app customization: cancel delete & default routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Burel Remy committed Oct 17, 2016
1 parent b0130e9 commit ae7e201
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/javascripts/ng-admin/Crud/delete/DeleteController.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default class DeleteController {
}

back() {
this.$window.history.back();
//custom app does not support history.back()
// this.$window.history.back();
this.$state.go(this.$state.get('edit'), { entity: this.entity.name(), id: this.$scope.entry.identifierValue });
}

destroy() {
Expand Down
21 changes: 20 additions & 1 deletion src/javascripts/ng-admin/Main/config/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,26 @@ function routing($stateProvider, $urlRouterProvider) {
template: errorTemplate
});

$urlRouterProvider.when('', '/dashboard');
// custom app with special paths and no dashboard as a default
// $urlRouterProvider.when('', '/dashboard');
$urlRouterProvider.when('', ['$location','$document',function($location,$document) {
if($location.absUrl().indexOf('O0104F01') !== -1 || $document[0].title.indexOf('Person in charge information') !== -1 || $document[0].title.indexOf('担当者マスタメンテナンス') !== -1) {
return '/m_pic/list';
} else if($location.absUrl().indexOf('O0106F01') !== -1 || $document[0].title.indexOf('Subsidy information') !== -1 || $document[0].title.indexOf('補助金種別マスタメンテナンス') !== -1) {
return '/m_subsidy_type/list';
} else if($location.absUrl().indexOf('O0110F01') !== -1 || $document[0].title.indexOf('Tag information') !== -1 || $document[0].title.indexOf('タグマスタメンテナンス') !== -1) {
return '/m_tag/list';
} else if($location.absUrl().indexOf('O0109F01') !== -1 || $document[0].title.indexOf('Conservation Inspection Job information') !== -1 || $document[0].title.indexOf('保全点検作業マスタメンテナンス') !== -1) {
return '/m_conservation_inspection_job/list';
} else if($location.absUrl().indexOf('O0108F01') !== -1 || $document[0].title.indexOf('Conservation Inspection information') !== -1 || $document[0].title.indexOf('保全点検マスタメンテナンス') !== -1) {
return '/m_conservation_inspection/list';
} else if($location.absUrl().indexOf('O0105F01') !== -1 || $document[0].title.indexOf('Device information') !== -1 || $document[0].title.indexOf('機器マスタメンテナンス') !== -1) {
return '/m_device/list';
} else if($location.absUrl().indexOf('O0107F01') !== -1 || $document[0].title.indexOf('Job information') !== -1 || $document[0].title.indexOf('作業マスタメンテナンス') !== -1) {
return '/m_job/list';
}
}]);


$urlRouterProvider.otherwise(function($injector, $location) {
var state = $injector.get('$state');
Expand Down

0 comments on commit ae7e201

Please sign in to comment.