From 38da56eb2e9cf7e66a5235c10f78ce30d6931bb6 Mon Sep 17 00:00:00 2001 From: iberdinsky Date: Wed, 31 Jul 2024 10:48:09 +0200 Subject: [PATCH 1/3] Frontend imprevements. --- client/public/favicon.ico | Bin 101076 -> 34494 bytes client/src/App.tsx | 49 ++++++++++++++++++++++++ client/src/components/layout/Title.tsx | 10 ++++- client/src/utils/helpers.tsx | 9 +++++ client/src/utils/react-flow-builder.tsx | 6 ++- 5 files changed, 71 insertions(+), 3 deletions(-) diff --git a/client/public/favicon.ico b/client/public/favicon.ico index 2f05c5f484fbf720523541519ff0cad4df752a9f..e9d306355238f386bb015c3ab5bf057295179a6d 100644 GIT binary patch literal 34494 zcmeI5d32Z6na4Bd%=|GrXHNeR5+a+9T5DUUcCq`^rD8iRwpwi~kbU0)QE|6cTb0_n z6xUi6To4s^6e%LOfPxC{wpJ@h5|WURyzl+-=0{SYk|CKho^#KSAo;!b zx%aux@_oL~eKRutDdS%#eU8s4|L2U1pJrraWMxG^U;eKd8Bgo)#*dGFo~M5| z;ombdzVLVfUn&VRued*p;6fhD9g$c9wqE zbyOU!-~UYX`{#_X=kmMD3l@%8n=@zsXw2HbF=s|Ra`x{mC>RkG{V3dCd4g-N__Etv z{b|=$H_El1H^Qx~TKUs}3fXZf*B z9Ti{cZLdB&XsgK%+h&gF-E?J^3kt4rtQGS5=k@pLO24#UBW}u%Nb29gDxq4I>-ZNUdQ7m1_ z-Lv1949z!ZhrvT*oh$pP3yMzG?@!qM=j->I?i?L?b^6G#b>_%$llFJhud_ndnYBV*=G?e= zT*&Wkc^r%hesOO?g*YnFv*L``G>;By+hi-)0-|+6yj&)|Oke500Tz+?b z`(eH5a_#BQ*cq9s44EUdU;KW)Y*zYzzpoA5AF7+(-IX7>2g~1ZPnNB8%S)EHRYecG zHwy0N47rA!-?{e5zjQs5X1eYvb*?M7RJxVp!opLX&ad|Qc-K+>4Lid+M{aY?IM+69 zr0l>*eRqqyqiTb@xAHx+Da$KgajVLgyEn_8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wB{8978!2alt0s_KX9^GHsNl@Alig|YHr!Z|RJ{FgXFNobc;)erTWc^%=Lh)6z% z(|Ie0Ba*-2w0Cwp4eB@Z63m3AcXIKNBSU9&&h?29)0q0K&M ztN%ID_v!qcB)V<&E2pS_(_gbs((F$)`%=w*RI?A&>_0WjC2N`T`pt3LW`AI`FEHE> zX!Zd{`u~y@w|N|^PcKFFn|_$fXkSpcAIp5-t7Wq4*UcA>_CjE{4C2CfBM8DW0bp0p z`CuN`T(%YJIsp4Auv=mCg zg8lKj(sY7Mjl|e{`kt{Z$e>?VBCS!#`hw8C*t=pei!5SFn$M{ z_Z{8JiSOfg3VxsAcNu<<;dfXf_nnM$GM { + const response = await fetch(`${apiUrl}/customisation`, { + method: 'GET', + }) + const data = await response.json() + if (data?.plasmactl_web_ui_platform_favicon) { + const base64Favicon = svgToBase64(data.plasmactl_web_ui_platform_favicon) + sessionStorage.setItem('plasmactl_web_ui_platform_favicon', base64Favicon) + setFavicon(base64Favicon) + + sessionStorage.setItem( + 'plasmactl_web_ui_platform_logo', + data?.plasmactl_web_ui_platform_logo + ) + } + if (data?.plasmactl_web_ui_platform_logo) { + const base64Logo = svgToBase64(data.plasmactl_web_ui_platform_logo) + sessionStorage.setItem('plasmactl_web_ui_platform_logo', base64Logo) + } + + if (data?.plasmactl_web_ui_platform_name) { + sessionStorage.setItem( + 'plasmactl_web_ui_platform_name', + data?.plasmactl_web_ui_platform_name + ) + } +} + +const setFavicon = (faviconUrl: string) => { + const link: HTMLLinkElement = + (document.querySelector("link[rel*='icon']") as HTMLLinkElement) || + (document.createElement('link') as HTMLLinkElement) + link.type = 'image/svg+xml' + link.rel = 'icon' + link.href = faviconUrl + document.getElementsByTagName('head')[0].append(link) +} + export function App() { + useEffect(() => { + const favicon = sessionStorage.getItem('plasmactl_web_ui_platform_favicon') + if (favicon) { + setFavicon(favicon) + } else { + fetchData() + } + }, []) + return ( diff --git a/client/src/components/layout/Title.tsx b/client/src/components/layout/Title.tsx index 45813fa..895a828 100644 --- a/client/src/components/layout/Title.tsx +++ b/client/src/components/layout/Title.tsx @@ -32,7 +32,12 @@ export const ThemedTitleV2: FC = ({ ...wrapperStyles, }} > - {t('Logo')} + {t('Logo')} = ({ fontSize="15px" textOverflow="ellipsis" overflow="hidden" + sx={{ textTransform: 'uppercase' }} > - {text} + {sessionStorage.getItem('plasmactl_web_ui_platform_name') || text} ) diff --git a/client/src/utils/helpers.tsx b/client/src/utils/helpers.tsx index 5bdaa22..41153ce 100644 --- a/client/src/utils/helpers.tsx +++ b/client/src/utils/helpers.tsx @@ -62,3 +62,12 @@ export const extractDateTimeFromId = (id: string) => { return formattedDate } + +export const svgToBase64 = (svg: string) => { + const base64 = btoa( + encodeURIComponent(svg).replaceAll(/%([\dA-F]{2})/g, (_, p1) => + String.fromCodePoint(Number.parseInt(p1, 16)) + ) + ) + return `data:image/svg+xml;base64,${base64}` +} diff --git a/client/src/utils/react-flow-builder.tsx b/client/src/utils/react-flow-builder.tsx index 1ca7bb3..45ac1b5 100644 --- a/client/src/utils/react-flow-builder.tsx +++ b/client/src/utils/react-flow-builder.tsx @@ -471,7 +471,11 @@ export const getNodesAndEdges = ( const nodes: IFolder = { id: 'start', - data: { label: 'Platform name' }, + data: { + label: + sessionStorage.getItem('plasmactl_web_ui_platform_name') || + 'Platform name', + }, type: 'node-start', folders: {}, actions: {}, From 4376a42ca7c042f8dd6ba38d5be02120b08367cf Mon Sep 17 00:00:00 2001 From: iberdinsky-skilld Date: Thu, 29 Aug 2024 13:17:26 +0200 Subject: [PATCH 2/3] Fix feedbacks --- client/index.html | 4 +- client/src/App.tsx | 50 +++---------------------- client/src/components/layout/Title.tsx | 14 +++---- client/src/utils/page-customisation.ts | 50 +++++++++++++++++++++++++ client/src/utils/react-flow-builder.tsx | 8 ++-- 5 files changed, 69 insertions(+), 57 deletions(-) create mode 100644 client/src/utils/page-customisation.ts diff --git a/client/index.html b/client/index.html index 5541d23..5c8323e 100644 --- a/client/index.html +++ b/client/index.html @@ -8,7 +8,7 @@ - refine - Build your React-based CRUD applications, without constraints. + Platform diff --git a/client/src/App.tsx b/client/src/App.tsx index e687984..890fce1 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -26,56 +26,17 @@ import { FlowShow } from './pages/flow' import { dataProvider as launchrDataProvider } from './rest-data-provider' import { ThemeProvider } from './ThemeProvider' import { getApiUrl } from './utils/app-urls-resolver' -import { svgToBase64 } from './utils/helpers' +import { getCustomisation, setCustomisation } from './utils/page-customisation' const apiUrl = getApiUrl() -const fetchData = async () => { - const response = await fetch(`${apiUrl}/customisation`, { - method: 'GET', - }) - const data = await response.json() - if (data?.plasmactl_web_ui_platform_favicon) { - const base64Favicon = svgToBase64(data.plasmactl_web_ui_platform_favicon) - sessionStorage.setItem('plasmactl_web_ui_platform_favicon', base64Favicon) - setFavicon(base64Favicon) - - sessionStorage.setItem( - 'plasmactl_web_ui_platform_logo', - data?.plasmactl_web_ui_platform_logo - ) - } - if (data?.plasmactl_web_ui_platform_logo) { - const base64Logo = svgToBase64(data.plasmactl_web_ui_platform_logo) - sessionStorage.setItem('plasmactl_web_ui_platform_logo', base64Logo) - } - - if (data?.plasmactl_web_ui_platform_name) { - sessionStorage.setItem( - 'plasmactl_web_ui_platform_name', - data?.plasmactl_web_ui_platform_name - ) - } -} - -const setFavicon = (faviconUrl: string) => { - const link: HTMLLinkElement = - (document.querySelector("link[rel*='icon']") as HTMLLinkElement) || - (document.createElement('link') as HTMLLinkElement) - link.type = 'image/svg+xml' - link.rel = 'icon' - link.href = faviconUrl - document.getElementsByTagName('head')[0].append(link) +const customTitleHandler = () => { + return getCustomisation()?.plasmactl_web_ui_platform_page_name ?? 'Platform' } export function App() { useEffect(() => { - const favicon = sessionStorage.getItem('plasmactl_web_ui_platform_favicon') - if (favicon) { - setFavicon(favicon) - } else { - fetchData() - } + setCustomisation() }, []) return ( @@ -131,10 +92,9 @@ export function App() { } /> - - + diff --git a/client/src/components/layout/Title.tsx b/client/src/components/layout/Title.tsx index 895a828..72638dd 100644 --- a/client/src/components/layout/Title.tsx +++ b/client/src/components/layout/Title.tsx @@ -7,6 +7,8 @@ import { useTranslation } from 'react-i18next' import Logo from '/images/logo.svg' +import { getCustomisation } from '../../utils/page-customisation' + const defaultText = import.meta.env.VITE_APP_NAME export const ThemedTitleV2: FC = ({ @@ -20,6 +22,9 @@ export const ThemedTitleV2: FC = ({ const ActiveLink = routerType === 'legacy' ? LegacyLink : Link + const logoUrl = getCustomisation()?.plasmactl_web_ui_platform_logo ?? Logo + const logoText = getCustomisation()?.plasmactl_web_ui_platform_name ?? text + return ( = ({ ...wrapperStyles, }} > - {t('Logo')} + {t('Logo')} = ({ overflow="hidden" sx={{ textTransform: 'uppercase' }} > - {sessionStorage.getItem('plasmactl_web_ui_platform_name') || text} + {logoText} ) diff --git a/client/src/utils/page-customisation.ts b/client/src/utils/page-customisation.ts new file mode 100644 index 0000000..4795958 --- /dev/null +++ b/client/src/utils/page-customisation.ts @@ -0,0 +1,50 @@ +import { getApiUrl } from './app-urls-resolver' +import { svgToBase64 } from './helpers' + +const apiUrl = getApiUrl() + +export const setCustomisation = async () => { + if (!localStorage.getItem('plasmactl_web_ui_customisation')) { + const response = await fetch(`${apiUrl}/customisation`, { + method: 'GET', + }) + const data = await response.json() + localStorage.setItem('plasmactl_web_ui_customisation', JSON.stringify(data)) + } + + setFavicon() +} + +export const getCustomisation = () => { + const customisation = localStorage.getItem('plasmactl_web_ui_customisation') + if (customisation) { + const parsed = JSON.parse(customisation) + if (parsed) { + if (parsed.plasmactl_web_ui_platform_favicon) { + parsed.plasmactl_web_ui_platform_favicon = svgToBase64( + parsed.plasmactl_web_ui_platform_favicon + ) + } + if (parsed.plasmactl_web_ui_platform_logo) { + parsed.plasmactl_web_ui_platform_logo = svgToBase64( + parsed.plasmactl_web_ui_platform_logo + ) + } + return parsed + } + } + return {} +} + +export const setFavicon = () => { + const favicon = getCustomisation()?.plasmactl_web_ui_platform_favicon + if (favicon) { + const link: HTMLLinkElement = + (document.querySelector("link[rel*='icon']") as HTMLLinkElement) || + (document.createElement('link') as HTMLLinkElement) + link.type = 'image/svg+xml' + link.rel = 'icon' + link.href = favicon + document.getElementsByTagName('head')[0]?.append(link) + } +} diff --git a/client/src/utils/react-flow-builder.tsx b/client/src/utils/react-flow-builder.tsx index 45ac1b5..449e994 100644 --- a/client/src/utils/react-flow-builder.tsx +++ b/client/src/utils/react-flow-builder.tsx @@ -5,6 +5,7 @@ import { GetListResponse } from '@refinedev/core' import { IFlowNodeType } from '../types' import { sentenceCase } from '../utils/helpers' +import { getCustomisation } from '../utils/page-customisation' // Coefficient less than 0.51 behaves unpredictably. // Use coefficient between 0.51 till endless @@ -469,12 +470,13 @@ export const getNodesAndEdges = ( return [] } + const nameText = + getCustomisation()?.plasmactl_web_ui_platform_name ?? 'Platform' + const nodes: IFolder = { id: 'start', data: { - label: - sessionStorage.getItem('plasmactl_web_ui_platform_name') || - 'Platform name', + label: nameText, }, type: 'node-start', folders: {}, From 52b5bc68c832f6a725bf22d5de904e20eb2d2820 Mon Sep 17 00:00:00 2001 From: iberdinsky-skilld Date: Mon, 9 Sep 2024 08:01:23 +0200 Subject: [PATCH 3/3] Header name --- client/src/components/layout/Title.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/layout/Title.tsx b/client/src/components/layout/Title.tsx index 72638dd..5963d1a 100644 --- a/client/src/components/layout/Title.tsx +++ b/client/src/components/layout/Title.tsx @@ -23,7 +23,7 @@ export const ThemedTitleV2: FC = ({ const ActiveLink = routerType === 'legacy' ? LegacyLink : Link const logoUrl = getCustomisation()?.plasmactl_web_ui_platform_logo ?? Logo - const logoText = getCustomisation()?.plasmactl_web_ui_platform_name ?? text + const logoText = getCustomisation()?.plasmactl_web_ui_platform_header_name ?? text return (