Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/i18n-keysets/auth.sign-in/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"label_login-placeholder": "Username",
"label_password-placeholder": "Password",
"label_sign-up-hint": "Don't have an account?",
"label_sing-up-link": "Sign up",
"title_product": "DataLens"
"label_sing-up-link": "Sign up"
}
3 changes: 1 addition & 2 deletions src/i18n-keysets/auth.sign-in/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"label_login-placeholder": "Логин",
"label_password-placeholder": "Пароль",
"label_sign-up-hint": "У вас ещё нет учётной записи?",
"label_sing-up-link": "Зарегистрироваться",
"title_product": "DataLens"
"label_sing-up-link": "Зарегистрироваться"
}
9 changes: 2 additions & 7 deletions src/server/components/layout/opensource-layout-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
DLUser,
TenantSettings,
} from '../../../shared';
import {FALLBACK_LANGUAGES, Feature, Language, USER_SETTINGS_KEY} from '../../../shared';
import {FALLBACK_LANGUAGES, Language, USER_SETTINGS_KEY} from '../../../shared';
import type {AppLayoutSettings, GetLayoutConfig} from '../../types/app-layout';
import {addTranslationsScript} from '../../utils/language';
import {getUserInfo} from '../zitadel/utils';
Expand Down Expand Up @@ -72,11 +72,6 @@ export const getOpensourceLayoutConfig: GetLayoutConfig = async (args) => {
};
}

const isRebrandingEnabled = req.ctx.get('isEnabledServerFeature')(Feature.EnableDLRebranding);

// applying new favicon from rebranding
const faviconUrl = isRebrandingEnabled ? '/os-favicon.ico' : config.faviconUrl;

const tenantSettings: TenantSettings = {
defaultColorPaletteId: res.locals.tenantDefaultColorPaletteId,
};
Expand Down Expand Up @@ -115,7 +110,7 @@ export const getOpensourceLayoutConfig: GetLayoutConfig = async (args) => {
lang,
icon: {
type: 'image/ico',
href: faviconUrl,
href: '/os-favicon.ico',
sizes: '32x32',
},
inlineScripts: ['window.DL = window.__DATA__.DL', ...chartkitInlineScripts],
Expand Down
1 change: 0 additions & 1 deletion src/ui/assets/icons/logo.svg

This file was deleted.

9 changes: 2 additions & 7 deletions src/ui/components/AsideHeaderAdapter/AsideHeaderAdapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import {Settings as SettingsPanel} from './Settings/Settings';
import {DIALOG_RELEASE_VERSION} from './VersionDialog/VersionDialog';
import {ASIDE_HEADER_LOGO_ICON_SIZE} from './constants';

import defaultLogoIcon from '../../assets/icons/logo.svg';
import iconCollection from '../../assets/icons/mono-collection.svg';
import rebrandingLogoIcon from '../../assets/icons/os-logo.svg';
import defaultLogoIcon from '../../assets/icons/os-logo.svg';

import './AsideHeaderAdapter.scss';

Expand Down Expand Up @@ -222,8 +221,6 @@ export const AsideHeaderAdapter = ({
setCurrentPopup(null);
}, []);

const isRebrandingEnabled = isEnabledFeature(Feature.EnableDLRebranding);

const renderFooter = () => {
return (
<React.Fragment>
Expand Down Expand Up @@ -328,14 +325,12 @@ export const AsideHeaderAdapter = ({
);
};

const defaultLogo = isRebrandingEnabled ? rebrandingLogoIcon : defaultLogoIcon;

return (
<AsideHeader
compact={isCompact}
logo={{
text: () => <LogoText {...logoTextProps} />,
icon: logoIcon ?? defaultLogo,
icon: logoIcon ?? defaultLogoIcon,
iconSize: ASIDE_HEADER_LOGO_ICON_SIZE,
iconClassName: b('logo-icon'),
className: b('logo'),
Expand Down
4 changes: 0 additions & 4 deletions src/ui/components/AsideHeaderAdapter/LogoText/LogoText.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

.aside-header-logo-text {
&__title {
@include text-body-2;
}

&__title_rebranding {
@include text-subheader-2;
}

Expand Down
13 changes: 4 additions & 9 deletions src/ui/components/AsideHeaderAdapter/LogoText/LogoText.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react';

import block from 'bem-cn-lite';
import {Feature} from 'shared/types';
import {PRODUCT_NAME, REBRANDING_PRODUCT_NAME} from 'ui/constants';
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
import {REBRANDING_PRODUCT_NAME} from 'ui/constants';

import './LogoText.scss';

Expand All @@ -17,15 +15,12 @@ export type LogoTextProps = {

export const LogoText = React.forwardRef<HTMLDivElement, LogoTextProps>(
({installationInfo, productName, installationInfoClassName}, ref) => {
const isRebrandingEnabled = isEnabledFeature(Feature.EnableDLRebranding);
const showInstallation = isRebrandingEnabled && installationInfo;
const defaultProductName = isRebrandingEnabled ? REBRANDING_PRODUCT_NAME : PRODUCT_NAME;
const showInstallation = installationInfo;
const defaultProductName = REBRANDING_PRODUCT_NAME;

return (
<div className={b()}>
<div className={b('title', {rebranding: isRebrandingEnabled})}>
{productName || defaultProductName}
</div>
<div className={b('title')}>{productName || defaultProductName}</div>
{showInstallation && (
<div ref={ref} className={b('installation-info', installationInfoClassName)}>
{installationInfo}
Expand Down
46 changes: 24 additions & 22 deletions src/ui/components/Illustration/getIllustrationStore.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
export const getIllustrationStore = () => ({
light: {
notFound: () => import('assets/images/illustration/light/404.svg'),
notFoundError: () => import('assets/images/illustration/light/404.svg'),
noAccess: () => import('assets/images/illustration/light/403.svg'),
error: () => import('assets/images/illustration/light/500.svg'),
identity: () => import('assets/images/illustration/light/identity.svg'),
project: () => import('assets/images/illustration/light/project.svg'),
template: () => import('assets/images/illustration/light/template.svg'),
emptyDirectory: () => import('assets/images/illustration/light/folder.svg'),
successOperation: () => import('assets/images/illustration/light/success_operation.svg'),
badRequest: () => import('assets/images/illustration/light/bad_request.svg'),
noAccounts: () => import('assets/images/illustration/light/404.svg'),
notFound: () => import('assets/images/new-illustrations/light/nothing_found.svg'),
notFoundError: () => import('assets/images/new-illustrations/light/404.svg'),
noAccess: () => import('assets/images/new-illustrations/light/403.svg'),
error: () => import('assets/images/new-illustrations/light/500.svg'),
identity: () => import('assets/images/new-illustrations/light/no_permission.svg'),
project: () => import('assets/images/new-illustrations/light/project.svg'),
template: () => import('assets/images/new-illustrations/light/empty_state.svg'),
emptyDirectory: () => import('assets/images/new-illustrations/light/empty_directory.svg'),
successOperation: () =>
import('assets/images/new-illustrations/light/success_operation.svg'),
badRequest: () => import('assets/images/new-illustrations/light/bad_request.svg'),
noAccounts: () => import('assets/images/new-illustrations/light/no_accounts.svg'),
},
dark: {
notFound: () => import('assets/images/illustration/dark/404.svg'),
notFoundError: () => import('assets/images/illustration/dark/404.svg'),
noAccess: () => import('assets/images/illustration/dark/403.svg'),
error: () => import('assets/images/illustration/dark/500.svg'),
identity: () => import('assets/images/illustration/dark/identity.svg'),
project: () => import('assets/images/illustration/dark/project.svg'),
template: () => import('assets/images/illustration/dark/template.svg'),
emptyDirectory: () => import('assets/images/illustration/dark/folder.svg'),
successOperation: () => import('assets/images/illustration/dark/success_operation.svg'),
badRequest: () => import('assets/images/illustration/light/bad_request.svg'),
noAccounts: () => import('assets/images/illustration/dark/404.svg'),
notFound: () => import('assets/images/new-illustrations/dark/nothing_found.svg'),
notFoundError: () => import('assets/images/new-illustrations/dark/404.svg'),
noAccess: () => import('assets/images/new-illustrations/dark/403.svg'),
error: () => import('assets/images/new-illustrations/dark/500.svg'),
identity: () => import('assets/images/new-illustrations/dark/no_permission.svg'),
project: () => import('assets/images/new-illustrations/dark/project.svg'),
template: () => import('assets/images/new-illustrations/dark/empty_state.svg'),
emptyDirectory: () => import('assets/images/new-illustrations/dark/empty_directory.svg'),
successOperation: () =>
import('assets/images/new-illustrations/dark/success_operation.svg'),
badRequest: () => import('assets/images/new-illustrations/dark/bad_request.svg'),
noAccounts: () => import('assets/images/new-illustrations/dark/no_accounts.svg'),
},
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: remove CHARTS-11919
export const getRebrandingIllustrationStore = () => ({
light: {
notFound: () => import('assets/images/new-illustrations/light/nothing_found.svg'),
Expand Down
11 changes: 4 additions & 7 deletions src/ui/components/MobileHeader/MobileHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
height: 0;
}

&__logo_rebranding {
&__logo {
flex: 1;
}

Expand All @@ -25,13 +25,10 @@
}

&__logo-icon {
height: auto;
width: auto;
padding-left: var(--g-spacing-2);
color: var(--g-color-base-brand);

&_rebranding {
height: auto;
width: auto;
padding-left: var(--g-spacing-2);
}
}

&__user-avatar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import {MobileHeader, getMobileHeaderCustomEvent} from '@gravity-ui/navigation';
import {mergeRefs} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
import {I18n} from 'i18n';
import {Feature} from 'shared/types';
import {LogoText} from 'ui/components/AsideHeaderAdapter/LogoText/LogoText';
import {PRODUCT_NAME} from 'ui/constants';
import type {MobileHeaderComponentProps} from 'ui/registry/units/common/types/components/MobileHeaderComponent';
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
import {useScrollableContainerContext} from 'ui/utils/scrollableContainerContext';

import {DL} from '../../../constants/common';
Expand All @@ -19,9 +16,8 @@ import {MOBILE_HEADER_LOGO_ICON_SIZE} from '../constants';
import {BurgerMenuFooter} from './BurgerMenuFooter/BurgerMenuFooter';
import {UserPanel} from './UserPanel/UserPanel';

import defaultLogoIcon from 'ui/assets/icons/logo.svg';
import iconCollection from 'ui/assets/icons/mono-collection.svg';
import rebrandingLogoIcon from 'ui/assets/icons/os-logo.svg';
import defaultLogoIcon from 'ui/assets/icons/os-logo.svg';

import '../MobileHeader.scss';

Expand Down Expand Up @@ -73,12 +69,6 @@ export const MobileHeaderComponent = ({
]
: undefined;

const defaultLogo = isEnabledFeature(Feature.EnableDLRebranding)
? rebrandingLogoIcon
: defaultLogoIcon;

const isRebrandingEnabled = isEnabledFeature(Feature.EnableDLRebranding);

const {scrollableContainerRef} = useScrollableContainerContext();

const contentRef = React.useRef<HTMLDivElement>();
Expand All @@ -98,11 +88,11 @@ export const MobileHeaderComponent = ({
<MobileHeader
ref={setupRefs}
logo={{
icon: logoIcon ?? defaultLogo,
text: isRebrandingEnabled ? () => <LogoText {...logoTextProps} /> : PRODUCT_NAME,
iconClassName: b('logo-icon', {rebranding: isRebrandingEnabled}),
className: b('logo', {rebranding: isRebrandingEnabled}),
iconSize: isRebrandingEnabled ? MOBILE_HEADER_LOGO_ICON_SIZE : undefined,
icon: logoIcon ?? defaultLogoIcon,
text: () => <LogoText {...logoTextProps} />,
iconClassName: b('logo-icon'),
className: b('logo'),
iconSize: MOBILE_HEADER_LOGO_ICON_SIZE,
}}
burgerMenu={{items: menuItems, renderFooter: () => <BurgerMenuFooter />}}
contentClassName={CONTENT_CLASSNAME}
Expand Down
6 changes: 0 additions & 6 deletions src/ui/entries/dl-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,13 @@ import 'ui/styles/variables.scss';
import 'ui/styles/split-pane-resizer.scss';
import 'ui/styles/theme.scss';
import 'ui/styles/rebranding-theme.scss';
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
import {Feature} from 'shared';
import {ScrollableContainerContextProvider} from 'ui/utils/scrollableContainerContext';

const Content = () => {
const userTheme = useSelector(selectTheme);
const theme = getOverridedTheme(userTheme);
const themeSettings = useSelector(selectThemeSettings);

if (isEnabledFeature(Feature.EnableDLRebranding)) {
Utils.addBodyClass('dl-root', 'dl-root_rebranding');
}

Utils.addBodyClass('dl-root_new-palette');

return (
Expand Down
4 changes: 1 addition & 3 deletions src/ui/registry/units/auth/types/components/Signin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import type {IconData} from '@gravity-ui/uikit';

export type SigninProps = {alternativeAuthOptions?: React.ReactNode; logoIcon?: IconData};
export type SigninProps = {alternativeAuthOptions?: React.ReactNode};
10 changes: 2 additions & 8 deletions src/ui/registry/units/common/register.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {Feature, extractEntryId, isEntryId} from 'shared';
import {extractEntryId, isEntryId} from 'shared';
import {getEntryScopesWithRevisionsList} from 'ui/components/RevisionsPanel/utils';
import {DL} from 'ui/constants';
import {getAdditionalChartkitErrorContent} from 'ui/libs/DatalensChartkit/Error/getAdditionalChartkitErrorContent';
import {getIsCompact, updateIsCompact} from 'ui/store/utils/asideHeader';
import {getLoginById} from 'ui/units/auth/components/LoginById/utils';
import {resolveUsersByIds} from 'ui/units/auth/store/actions/usersByIds';
import {getRestrictedParamNames} from 'ui/utils/getRestrictedParamNames';
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
import {setEntryKey} from 'ui/utils/setEntryKey';

import {formatNumber} from '../../../../shared/modules/format-units/formatUnit';
Expand All @@ -18,7 +17,6 @@ import {getAdditionalEntryDialoguesMap} from '../../../components/EntryDialogues
import {getEntryName} from '../../../components/EntryTitle/utils';
import {Illustration} from '../../../components/Illustration/Illustration';
import {getIllustrationStore} from '../../../components/Illustration/getIllustrationStore';
import {getRebrandingIllustrationStore} from '../../../components/Illustration/getRebrandingIllustrationStore';
import {MarkdownControl} from '../../../components/MarkdownControl/MarkdownControl';
import {MobileHeaderComponent} from '../../../components/MobileHeader/MobileHeaderComponent/MobileHeaderComponent';
import {
Expand Down Expand Up @@ -55,8 +53,6 @@ import {registry} from '../../index';
import {EXAMPLE_FUNCTION} from './constants/functions';

export const registerCommonPlugins = () => {
const isRebrandingEnabled = isEnabledFeature(Feature.EnableDLRebranding);

registry.common.components.registerMany({
MobileHeaderComponent,
PlaceholderIllustrationImage: Illustration,
Expand All @@ -74,9 +70,7 @@ export const registerCommonPlugins = () => {
getEntryMenuConfig,
getMenuGroupConfig,
getIconDataById,
getIllustrationStore: isRebrandingEnabled
? getRebrandingIllustrationStore
: getIllustrationStore,
getIllustrationStore,
getIsCompact,
updateIsCompact,
getPlaceSelectParameters,
Expand Down
Loading
Loading