Arthur Bogaart pushed to branch master at cms-community / 
hippo-addon-channel-manager


Commits:
bee4c5e7 by Arthur Bogaart at 2018-02-06T23:36:28+01:00
CHANNELMGR-1703 Record own change after HstComponentService sets parameter

Moved the record-own-change call from the OverlayService to the 
HstComponentService so it will simply be applied whenever the parameter is set, 
in our case after creating or picking a document.

- - - - -
4fa30bcd by Arthur Bogaart at 2018-02-08T10:52:47+01:00
CHANNELMGR-1703 Reintegrate bugfix/CHANNELMGR-1703

- - - - -


3 changed files:

- frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.js
- frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.spec.js
- frontend-ng/src/app/services/hstComponent.service.js


Changes:

=====================================
frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.js
=====================================
--- a/frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.js
+++ b/frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.js
@@ -590,9 +590,6 @@ class OverlayService {
       .then(() => {
         this.PageStructureService.renderComponent(component.getId());
         
this.FeedbackService.showNotification('NOTIFICATION_DOCUMENT_SELECTED_FOR_COMPONENT',
 { componentName });
-
-        // record own change to enable the publish button in the application 
toolbar
-        this.ChannelService.recordOwnChange();
       })
       .catch(() => {
         
this.FeedbackService.showError('ERROR_DOCUMENT_SELECTED_FOR_COMPONENT', { 
componentName });


=====================================
frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.spec.js
=====================================
--- a/frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.spec.js
+++ b/frontend-ng/src/app/channel/hippoIframe/overlay/overlay.service.spec.js
@@ -569,7 +569,6 @@ describe('OverlayService', () => {
     spyOn(HstComponentService, 'pickPath').and.returnValue($q.resolve());
     spyOn(PageStructureService, 'renderComponent');
     spyOn(FeedbackService, 'showNotification');
-    spyOn(ChannelService, 'recordOwnChange');
 
     loadIframeFixture(() => {
       const overlayElementScenario5 = 
iframe('.hippo-overlay-element-manage-content-link')[4];
@@ -585,7 +584,6 @@ describe('OverlayService', () => {
       
expect(FeedbackService.showNotification).toHaveBeenCalledWith('NOTIFICATION_DOCUMENT_SELECTED_FOR_COMPONENT',
 {
         componentName: 'component B',
       });
-      expect(ChannelService.recordOwnChange).toHaveBeenCalled();
 
       done();
     });
@@ -622,7 +620,6 @@ describe('OverlayService', () => {
     spyOn(HstComponentService, 'pickPath').and.returnValue($q.resolve());
     spyOn(PageStructureService, 'renderComponent');
     spyOn(FeedbackService, 'showNotification');
-    spyOn(ChannelService, 'recordOwnChange');
 
     loadIframeFixture(() => {
       const overlayElementScenario7 = 
iframe('.hippo-overlay-element-manage-content-link')[6];
@@ -638,7 +635,6 @@ describe('OverlayService', () => {
       
expect(FeedbackService.showNotification).toHaveBeenCalledWith('NOTIFICATION_DOCUMENT_SELECTED_FOR_COMPONENT',
 {
         componentName: 'Component with experiment',
       });
-      expect(ChannelService.recordOwnChange).toHaveBeenCalled();
 
       done();
     });


=====================================
frontend-ng/src/app/services/hstComponent.service.js
=====================================
--- a/frontend-ng/src/app/services/hstComponent.service.js
+++ b/frontend-ng/src/app/services/hstComponent.service.js
@@ -21,6 +21,7 @@ class HstComponentService {
     'ngInject';
 
     this.$q = $q;
+    this.ChannelService = ChannelService;
     this.CmsService = CmsService;
     this.HstService = HstService;
 
@@ -69,7 +70,8 @@ class HstComponentService {
     // in the backend call, it must be URI-encoded to be parsed correctly by 
the backend.
     const encodedVariant = encodeURIComponent(componentVariant);
 
-    return this.HstService.doPutForm(params, componentId, encodedVariant);
+    return this.HstService.doPutForm(params, componentId, encodedVariant)
+      .then(() => this.ChannelService.recordOwnChange());
   }
 }
 



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/compare/d473b16c0cbf9d727a6f061c86517f75158fe0c4...4fa30bcde10bda3e1af0fdbf10e408d1f37a00d9

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/compare/d473b16c0cbf9d727a6f061c86517f75158fe0c4...4fa30bcde10bda3e1af0fdbf10e408d1f37a00d9
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to