Skip to content

Commit

Permalink
fix: branding data merge (#1298)
Browse files Browse the repository at this point in the history
* fix: branding data merge

Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 authored Jan 22, 2025
1 parent 2d66426 commit 54ce4d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export type BrandingDocs = {
faq?: string;
storageTypes: string;
webSocketTroubleshooting: string;
startWorkspaceFromGit: string;
};

export type BrandingConfiguration = {
Expand Down Expand Up @@ -84,8 +83,6 @@ export const BRANDING_DEFAULT: BrandingData = {
'https://www.eclipse.org/che/docs/stable/end-user-guide/url-parameter-for-the-workspace-storage/',
webSocketTroubleshooting:
'https://www.eclipse.org/che/docs/stable/end-user-guide/troubleshooting-network-problems/',
startWorkspaceFromGit:
'https://eclipse.dev/che/docs/stable/end-user-guide/starting-a-workspace-from-a-git-repository-url/',
},
configuration: {},
};
5 changes: 3 additions & 2 deletions packages/dashboard-frontend/src/store/Branding/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

import common from '@eclipse-che/common';
import { createAction } from '@reduxjs/toolkit';
import { merge } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import merge from 'lodash/merge';

import { fetchApiInfo, fetchBranding } from '@/services/assets/branding';
import { BRANDING_DEFAULT, BrandingData } from '@/services/bootstrap/branding.constant';
Expand Down Expand Up @@ -71,7 +72,7 @@ export const actionCreators = {
};

export function getBrandingData(receivedBranding?: { [key: string]: any }): BrandingData {
let branding: BrandingData = Object.assign({}, BRANDING_DEFAULT);
let branding: BrandingData = cloneDeep(BRANDING_DEFAULT);

if (receivedBranding && Object.keys(receivedBranding).length > 0) {
branding = merge(branding, receivedBranding);
Expand Down

0 comments on commit 54ce4d1

Please sign in to comment.