aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-05-08 16:06:34 +0300
committerMichael Lando <ml636r@att.com>2018-05-08 13:40:11 +0000
commit60c47df2499a98a1d0bd54ef4feb3316ae738e05 (patch)
treed02bae3b1b52ab602c5393ab50624ecb90128496 /catalog-ui/src/app/ng2
parentecd3d712aad4ac37f399c90f4bf9258bfe483b9a (diff)
Developed disable navigation mechanism
Added a list for events to not fire an WINDOW_OUT event after sdc notifies about them Small fix to Plugins loader Change-Id: Ia31ebf4095b94a5ca602c4f502df4fcc32368b0b Issue-ID: SDC-1277 Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r--catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts19
-rw-r--r--catalog-ui/src/app/ng2/services/event-bus.service.ts3
2 files changed, 15 insertions, 7 deletions
diff --git a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts
index 83d302b2a8..cd92cca2f7 100644
--- a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts
+++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts
@@ -58,15 +58,20 @@ export class PluginFrameComponent implements OnInit {
// before moving to a new state
this.$scope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams) => {
if ((fromState.name !== toState.name) || (fromState.name === toState.name) && (toParams.path !== fromParams.path)) {
- if (!this.isClosed) {
- event.preventDefault();
+ if(this.eventBusService.NoWindowOutEvents.indexOf(this.eventBusService.lastEventNotified) == -1) {
+ if (!this.isClosed) {
+ event.preventDefault();
- this.eventBusService.notify("WINDOW_OUT").subscribe(() => {
- this.isClosed = true;
- this.eventBusService.unregister(this.plugin.pluginId);
+ this.eventBusService.notify("WINDOW_OUT").subscribe(() => {
+ this.isClosed = true;
+ this.eventBusService.unregister(this.plugin.pluginId);
- this.$state.go(toState.name, toParams);
- });
+ this.$state.go(toState.name, toParams);
+ });
+ }
+ }
+ else {
+ this.eventBusService.unregister(this.plugin.pluginId);
}
}
});
diff --git a/catalog-ui/src/app/ng2/services/event-bus.service.ts b/catalog-ui/src/app/ng2/services/event-bus.service.ts
index cff18e1db3..10990e2f2c 100644
--- a/catalog-ui/src/app/ng2/services/event-bus.service.ts
+++ b/catalog-ui/src/app/ng2/services/event-bus.service.ts
@@ -4,8 +4,11 @@ import {BasePubSub, IPubSubEvent} from "../../models/base-pubsub";
@Injectable()
export class EventBusService extends BasePubSub {
+ NoWindowOutEvents: Array<string>;
+
constructor() {
super("sdc-hub");
+ this.NoWindowOutEvents = ["CHECK_IN", "SUBMIT_FOR_TESTING", "UNDO_CHECK_OUT"];
}
protected handlePluginRegistration(eventData: IPubSubEvent, event: any) {