Skip to content

Commit

Permalink
Partial cherry-pick of #4521: Shared lib fixes for custom code
Browse files Browse the repository at this point in the history
Commit `78c64aa7474bd917b6f5629e185d3e6107468175`
  • Loading branch information
ek68794998 committed Apr 2, 2024
1 parent aebe1f7 commit 8f7b70e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libs/designer-ui/src/lib/panel/panelResizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const PanelResizer = (props: PanelResizerProps): JSX.Element => {
const animationFrame = useRef<number>(0);

const resize = useCallback(
({ clientX }: MouseEvent) => {
(e: MouseEvent) => {
e.preventDefault();
const { clientX } = e;
animationFrame.current = requestAnimationFrame(() => {
if (isResizing) {
const newWidth = Math.max(window.innerWidth - clientX, 400);
Expand Down
1 change: 0 additions & 1 deletion libs/designer/src/lib/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ export {
getBrandColorFromManifest,
getIconUriFromManifest,
} from './utils/card';
export { resetCustomCode } from './state/customcode/customcodeSlice';
2 changes: 2 additions & 0 deletions libs/designer/src/lib/core/state/global.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { resetCustomCode } from './customcode/customcodeSlice';
import { useIsWorkflowDirty } from './workflow/workflowSelectors';
import { setIsWorkflowDirty } from './workflow/workflowSlice';
import { setIsWorkflowParametersDirty } from './workflowparameters/workflowparametersSlice';
Expand All @@ -17,4 +18,5 @@ export const resetDesignerDirtyState = createAsyncThunk('resetDesignerDirtyState
const dispatch = thunkAPI.dispatch;
dispatch(setIsWorkflowDirty(false));
dispatch(setIsWorkflowParametersDirty(false));
dispatch(resetCustomCode());
});
2 changes: 1 addition & 1 deletion libs/designer/src/lib/ui/panel/panelRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const PanelRoot = (props: PanelRootProps): JSX.Element => {
className={`msla-panel-root-${currentPanelMode}`}
isLightDismiss
isBlocking={!isLoadingPanel && !nonBlockingPanels.includes(currentPanelMode ?? '')}
type={panelLocation === PanelLocation.Right ? PanelType.custom : PanelType.customNear}
type={commonPanelProps.panelLocation === PanelLocation.Right ? PanelType.custom : PanelType.customNear}
isOpen={!collapsed}
onDismiss={dismissPanel}
hasCloseButton={false}
Expand Down

0 comments on commit 8f7b70e

Please sign in to comment.