Skip to content

Commit

Permalink
fix: (CXSPA-9266) prevent animation playing when scene loaded (#19965)
Browse files Browse the repository at this point in the history
It should only play when the user clicks the play button.

Fixed by updating from UI5 1.108 to 1.120

JIRA: CXSPA-9266
  • Loading branch information
sam-garland authored Feb 10, 2025
1 parent d8876fe commit 8ce468d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export enum NavigationMode {
/**
* Left mouse button drag causes turntable rotation.
*/
Turntable = 0,
Turntable = 'Turntable',
/**
* Left mouse button drag performs panning.
*/
Pan = 2,
Pan = 'Pan',
/**
* Left mouse button drag performs zooming.
*/
Zoom = 3,
Zoom = 'Zoom',
}
Original file line number Diff line number Diff line change
Expand Up @@ -1189,10 +1189,7 @@ describe('VisualViewerService', () => {
).and.callFake(mockExecuteWhenSceneLoaded);

const mockDrawerToolbar = {
_activateGesture: (
_viewport: any,
_navigationMode: NavigationMode
) => {},
setNavigationMode: (_navigationMode: NavigationMode) => {},
};

const mockViewportImplementation = {};
Expand All @@ -1214,9 +1211,9 @@ describe('VisualViewerService', () => {
'get'
).and.returnValue(mockViewport);

const mockDrawerToolbar_activateGestureSpy = spyOn(
const mockDrawerToolbar_setNavigationMode = spyOn(
mockDrawerToolbar,
'_activateGesture'
'setNavigationMode'
);

visualViewerService.navigationMode = NavigationMode.Pan;
Expand All @@ -1225,9 +1222,8 @@ describe('VisualViewerService', () => {
expect(executeWhenSceneLoadedSpy).toHaveBeenCalledTimes(1);
expect(getDrawerToolbarPropertySpy).toHaveBeenCalled();
expect(getViewportPropertySpy).toHaveBeenCalled();
expect(mockDrawerToolbar_activateGestureSpy).toHaveBeenCalledTimes(1);
expect(mockDrawerToolbar_activateGestureSpy).toHaveBeenCalledWith(
mockViewportImplementation,
expect(mockDrawerToolbar_setNavigationMode).toHaveBeenCalledTimes(1);
expect(mockDrawerToolbar_setNavigationMode).toHaveBeenCalledWith(
NavigationMode.Pan
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,7 @@ export class VisualViewerService implements OnDestroy {
this._navigationMode = navigationMode;
this.executeWhenSceneLoaded(() => {
if (this.drawerToolbar && this.viewport) {
// sap.ui.vk library will have a public API to set the navigation mode in a future UI5 version
(this.drawerToolbar as any)._activateGesture(
(this.viewport as any).getImplementation(),
navigationMode
);
this.drawerToolbar.setNavigationMode(navigationMode);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getTestConfig(): EpdVisualizationConfig {
baseUrl: 'https://fake.visualization.application.domain.sap',
},
ui5: {
bootstrapUrl: 'https://ui5.sap.com/1.108/resources/sap-ui-core.js',
bootstrapUrl: 'https://ui5.sap.com/1.120/resources/sap-ui-core.js',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { EpdVisualizationConfig, EpdVisualizationRootModule } from "@spartacus/e
provideConfig(<EpdVisualizationConfig>{
epdVisualization: {
ui5: {
bootstrapUrl: "https://ui5.sap.com/1.108/resources/sap-ui-core.js"
bootstrapUrl: "https://ui5.sap.com/1.120/resources/sap-ui-core.js"
},
apis: {
Expand Down Expand Up @@ -58,7 +58,7 @@ import { EpdVisualizationConfig, EpdVisualizationRootModule } from "@spartacus/e
provideConfig(<EpdVisualizationConfig>{
epdVisualization: {
ui5: {
bootstrapUrl: "https://ui5.sap.com/1.108/resources/sap-ui-core.js"
bootstrapUrl: "https://ui5.sap.com/1.120/resources/sap-ui-core.js"
},
apis: {
Expand Down Expand Up @@ -100,7 +100,7 @@ import { EPD_VISUALIZATION_FEATURE, EpdVisualizationConfig, EpdVisualizationRoot
provideConfig(<EpdVisualizationConfig>{
epdVisualization: {
ui5: {
bootstrapUrl: "https://ui5.sap.com/1.108/resources/sap-ui-core.js"
bootstrapUrl: "https://ui5.sap.com/1.120/resources/sap-ui-core.js"
},
apis: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function buildCdsConfig(
content: `<${EPD_VISUALIZATION_CONFIG}>{
epdVisualization: {
ui5: {
bootstrapUrl: "https://ui5.sap.com/1.108/resources/sap-ui-core.js"
bootstrapUrl: "https://ui5.sap.com/1.120/resources/sap-ui-core.js"
},
apis: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const epdVisualizationConfig: EpdVisualizationConfig = {
},

ui5: {
bootstrapUrl: 'https://ui5.sap.com/1.108/resources/sap-ui-core.js',
bootstrapUrl: 'https://ui5.sap.com/1.120/resources/sap-ui-core.js',
},
},
};
Expand Down

0 comments on commit 8ce468d

Please sign in to comment.