Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyManetov committed Nov 15, 2024
2 parents 50a814d + f7fe841 commit 074fb5a
Show file tree
Hide file tree
Showing 877 changed files with 90,727 additions and 109,445 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,9 @@ jobs:
- name: Packaging and Uploading Helm Chart
run: |
cd ./helmchart
# workaround to separate versioning modes for prod and non-prod
# temporary solution until we have a single versioning mode
# if [[ ${{ github.ref_name}} == "main" ]]; then
# export helm_tag="$GITVERSION_SEMVER"
# else
# export helm_tag="$GITVERSION_MAJOR.$GITVERSION_MINOR.$GITVERSION_COMMITSSINCEVERSIONSOURCE"
# fi
export helm_tag="$GITVERSION_MAJOR.$GITVERSION_MINOR.$GITVERSION_COMMITSSINCEVERSIONSOURCE"
# workaround to avoid Helm chart versioning issues
current_timestamp=$(date +%s)
export helm_tag="$GITVERSION_MAJOR.$GITVERSION_MINOR.$current_timestamp"
echo "[INFO] ${helm_tag}..."
echo "[INFO] Replace Helm Chart package version..."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: qa
# Controls when the action will run.
on:
push:
branches: [ feature/timeline ]
branches: [ themes/eduverse-theme ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
1 change: 1 addition & 0 deletions app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = {
// in the future, this rule will be enabled globally (not only in "app")
'react-hooks/exhaustive-deps': unifiedSeverity,
...turnOffEslintRulesToBeFixed(),
'no-restricted-imports': 'off',
},
};
26 changes: 13 additions & 13 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/app",
"version": "5.10.2",
"version": "5.11.0-rc.0",
"description": "EPAM Unified UI landing",
"author": "EPAM",
"license": "MIT",
Expand All @@ -17,19 +17,19 @@
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@elastic/apm-rum": "^5.14.0",
"@epam/assets": "5.10.2",
"@epam/draft-rte": "5.10.2",
"@epam/electric": "5.10.2",
"@epam/assets": "5.11.0-rc.0",
"@epam/draft-rte": "5.11.0-rc.0",
"@epam/electric": "5.11.0-rc.0",
"@epam/internal": "0.0.2",
"@epam/loveship": "5.10.2",
"@epam/promo": "5.10.2",
"@epam/uui": "5.10.2",
"@epam/uui-components": "5.10.2",
"@epam/uui-core": "5.10.2",
"@epam/uui-db": "5.10.2",
"@epam/uui-docs": "5.10.2",
"@epam/uui-editor": "5.10.2",
"@epam/uui-timeline": "5.10.2",
"@epam/loveship": "5.11.0-rc.0",
"@epam/promo": "5.11.0-rc.0",
"@epam/uui": "5.11.0-rc.0",
"@epam/uui-components": "5.11.0-rc.0",
"@epam/uui-core": "5.11.0-rc.0",
"@epam/uui-db": "5.11.0-rc.0",
"@epam/uui-docs": "5.11.0-rc.0",
"@epam/uui-editor": "5.11.0-rc.0",
"@epam/uui-timeline": "5.11.0-rc.0",
"@tanstack/react-query": "^5.17.19",
"@udecode/plate-common": "31.3.2",
"amplitude-js": "8.9.1",
Expand Down
2 changes: 1 addition & 1 deletion app/src/common/AppFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function AppFooter() {
</Anchor>
</FlexRow>
</FlexCell>
<FlexCell cx={ css.secondBlock } width="auto" grow={ 1 } minWidth={ 583 }>
<FlexCell cx={ css.secondBlock } width="auto" grow={ 1 } minWidth={ 650 }>
<FlexRow columnGap={ 48 } alignItems="top">
<FlexCell width="auto">
<Text color="white" fontWeight="600" fontSize="18">Have a question?</Text>
Expand Down
1 change: 1 addition & 0 deletions app/src/common/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export function AppHeader() {
if (!['figma', 'git', 'gitStar', 'direction', 'themeCaption'].includes(i.id)) {
return i.render({ ...i, onClose: props.onClose });
}
return null;
});
} }
/>
Expand Down
1 change: 0 additions & 1 deletion app/src/common/docs/baseDocBlock/components/tabsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export function TabsNav(props: TTabsNavProps) {
>
{ pageWidth <= 768 && (
<Button
rawProps={ { style: { marginInlineStart: '6px', marginInlineEnd: '12px' } } }
fill="none"
icon={ NavigationShowOutlineIcon }
onClick={ props.handleMobSidebarBtnClick }
Expand Down
6 changes: 5 additions & 1 deletion app/src/data/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ export enum BuiltInTheme {
loveship = 'loveship',
loveship_dark = 'loveship_dark',
promo = 'promo',
vanilla_thunder = 'vanilla_thunder'
vanilla_thunder = 'vanilla_thunder',
eduverse_light = 'eduverse_light',
eduverse_dark = 'eduverse_dark'
}

/* No restrictions on custom theme id - it can be any string */
Expand All @@ -22,4 +24,6 @@ export const builtInThemes: ThemeBaseParams[] = [
{ id: BuiltInTheme.loveship_dark, name: 'Loveship Dark' },
{ id: BuiltInTheme.vanilla_thunder, name: 'Vanilla Thunder' },
{ id: BuiltInTheme.promo, name: 'Promo' },
{ id: BuiltInTheme.eduverse_light, name: 'Eduverse Light' },
{ id: BuiltInTheme.eduverse_dark, name: 'Eduverse Dark' },
];
1 change: 1 addition & 0 deletions app/src/demo/dnd/DemoDnd.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@

@media (max-width: 1279px) {
justify-content: center;
margin: 30px 24px;
}
}
3 changes: 2 additions & 1 deletion app/src/demo/dnd/DemoDnd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export class DemoDnd extends React.Component<{}, DemoDndState> {
render() {
const sortedModules = orderBy(this.state.moduleItems, ({ order }) => order);
const sortedSections = orderBy(this.state.sectionItems, ({ order }) => order);
const isDesktop = window.screen?.width >= 1280;
const isDesktop = window.document.body.clientWidth >= 1280;

return (
<FlexRow cx={ css.root } alignItems="stretch">
{isDesktop && (
Expand Down
2 changes: 0 additions & 2 deletions app/src/demo/tables/filteredTable/FilteredTable.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
flex-shrink: 0;
background-color: var(--uui-surface-main);
border-bottom: 1px solid var(--uui-divider);
overflow-x: auto;
overflow-y: hidden;
align-items: center;

.presets-title {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export function MasterDetailedTable() {
const filters = useMemo(() => getFilters<PersonFilters['Person']>(), []);

const tableStateApi = useTableState<PersonTableFilter>({
columns: personColumns,
initialPresets: initialPresets,
onPresetCreate: svc.api.presets.createPreset,
onPresetUpdate: svc.api.presets.updatePreset,
Expand All @@ -41,7 +40,7 @@ export function MasterDetailedTable() {
);

const pin = useCallback(
({ value: { __typename } }: DataRowProps<PersonTableRecord, PersonTableRecordId[]>) =>
({ value: { __typename } }: DataRowProps<PersonTableRecord, PersonTableRecordId[]>) =>
__typename !== 'Person',
[],
);
Expand Down
1 change: 1 addition & 0 deletions app/src/demo/tables/masterDetailedTable/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const getFilters = <TFilter extends Record<string, any>>(): TableFiltersC
columnKey: 'birthDate',
title: 'Birth Date',
type: 'rangeDatePicker',
format: 'YYYY-MM-DD',
},
];
};
2 changes: 1 addition & 1 deletion app/src/docs/Badge.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class BadgeDoc extends BaseDocsBlock {
iconPosition: { values: ['right'] },
},
],
cellSize: '175-60',
cellSize: '200-60',
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion app/src/docs/Button.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class ButtonDoc extends BaseDocsBlock {
isDropdown: { examples: '*' },
},
],
cellSize: '150-60',
cellSize: '150-70',
});
const colorVariantsMatrix: TMatrixLocal = {
caption: { values: [TEST_DATA.caption1Line] },
Expand Down
15 changes: 14 additions & 1 deletion app/src/docs/IconButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ export class IconButtonDoc extends BaseDocsBlock {
[TSkin.Promo]: { type: '@epam/promo:IconButtonProps', component: promo.IconButton },
},
doc: (doc: DocBuilder<promo.IconButtonProps | loveship.IconButtonProps| uui.IconButtonProps>) => {
const mapNeutralColor: Record<string, string> = {
loveship_dark: 'neutral-10',
electric: 'neutral-95',
vanilla_thunder: 'control-bg-hover',
};

const mapSecondaryColor: Record<string, string> = {
loveship: 'neutral-50',
promo: 'neutral-50',
loveship_dark: 'neutral-40',
};

doc.merge('color', {
editorType: getColorPickerComponent({
...COLOR_MAP,
neutral: `var(--uui-${getCurrentTheme() === 'loveship_dark' ? 'neutral-10' : 'neutral-60'})`,
neutral: `var(--uui-${!!mapNeutralColor[getCurrentTheme()] ? mapNeutralColor[getCurrentTheme()] : 'neutral-60'})`,
secondary: `var(--uui-${!!mapSecondaryColor[getCurrentTheme()] ? mapSecondaryColor[getCurrentTheme()] : 'secondary-50'})`,
}),
});
doc.setDefaultPropExample('onClick', () => true);
Expand Down
2 changes: 1 addition & 1 deletion app/src/docs/MultiSwitch.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class MultiSwitchDoc extends BaseDocsBlock {
items: [{ caption: 'A', id: 1 }, { caption: 'B', id: 2 }],
value: 1,
};
const w120_h60: TPreviewCellSize = '120-60';
const w120_h60: TPreviewCellSize = '120-70';
const w80_h50: TPreviewCellSize = '80-50';
docPreview.add({
id: TMultiSwitchPreview['Size Variants'],
Expand Down
12 changes: 8 additions & 4 deletions app/src/docs/Rating.doc.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as React from 'react';
import * as uui from '@epam/uui';
import * as loveship from '@epam/loveship';
import * as promo from '@epam/promo';
import * as electric from '@epam/electric';
import { DocBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import * as uui from '@epam/uui';

export class RatingDoc extends BaseDocsBlock {
title = 'Rating';
Expand All @@ -12,17 +13,20 @@ export class RatingDoc extends BaseDocsBlock {
name: 'Rating',
contexts: [TDocContext.Default, TDocContext.Form],
bySkin: {
[TSkin.Loveship]: { type: '@epam/loveship:RatingProps', component: loveship.Rating },
[TSkin.Promo]: { type: '@epam/promo:RatingProps', component: promo.Rating },
[TSkin.UUI]: { type: '@epam/uui:RatingProps', component: uui.Rating },
[TSkin.Loveship]: { type: '@epam/uui:RatingProps', component: loveship.Rating },
[TSkin.Promo]: { type: '@epam/uui:RatingProps', component: promo.Rating },
[TSkin.Electric]: { type: '@epam/uui:RatingProps', component: electric.Rating },
},
doc: (doc: DocBuilder<promo.RatingProps | loveship.RatingProps>) => {
doc: (doc: DocBuilder<uui.RatingProps>) => {
doc.merge('Tooltip', { examples: [{ value: uui.Tooltip, name: 'Tooltip' }] });
doc.merge('value', {
editorType: 'MultiUnknownEditor',
examples: [
0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5,
],
});
doc.merge('hint', { examples: [{ value: (rating) => `${rating} star(s)`, name: '(rating) => string' }] });
},
};

Expand Down
6 changes: 2 additions & 4 deletions app/src/docs/RichTextEditor.doc.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import * as React from 'react';
import cx from 'classnames';
import { BaseDocsBlock, DocExample } from '../common';
import css from './styles.module.scss';

export class RichTextEditorDoc extends BaseDocsBlock {
title = 'Rich Text Editor';
renderContent() {
return (
<span className={ cx(css.wrapper) }>
<>
<DocExample path="./_examples/richTextEditor/Basic.example.tsx" />
<DocExample title="Inner scroll behavior" path="./_examples/richTextEditor/WithInnerScroll.example.tsx" />
</span>
</>
);
}
}
6 changes: 2 additions & 4 deletions app/src/docs/RichTextEditorSerializers.doc.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import * as React from 'react';
import cx from 'classnames';
import { BaseDocsBlock, DocExample } from '../common';
import css from './styles.module.scss';

export class RichTextEditorSerializersDoc extends BaseDocsBlock {
title = 'Rich Text Editor Serializers';
renderContent() {
return (
<span className={ cx(css.wrapper) }>
<>
<DocExample title="MD format" path="./_examples/richTextEditor/MdSerialization.example.tsx" />
<DocExample title="HTML format" path="./_examples/richTextEditor/HtmlSerialization.example.tsx" />
</span>
</>
);
}
}
6 changes: 2 additions & 4 deletions app/src/docs/SliderRating.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import * as loveship from '@epam/loveship';
import * as uui from '@epam/uui';
import { DocBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import cx from 'classnames';
import css from './styles.module.scss';

export class SliderRatingDoc extends BaseDocsBlock {
title = 'SliderRating';
Expand Down Expand Up @@ -37,11 +35,11 @@ export class SliderRatingDoc extends BaseDocsBlock {

renderContent() {
return (
<span className={ cx(css.wrapper) }>
<>
<EditableDocContent fileName="sliderRating-descriptions" />
{this.renderSectionTitle('Examples')}
<DocExample title="Basic" path="./_examples/sliderRating/Basic.example.tsx" />
</span>
</>
);
}
}
4 changes: 2 additions & 2 deletions app/src/docs/Tag.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class TagDoc extends BaseDocsBlock {
isDropdown: { examples: '*' },
onClear: { examples: ['callback', undefined] },
},
cellSize: '180-60',
cellSize: '210-60',
});
docPreview.add({
id: TTagPreview['Color Variants'],
Expand All @@ -70,7 +70,7 @@ export class TagDoc extends BaseDocsBlock {
fill: { examples: '*' },
isDisabled: { examples: '*' },
},
cellSize: '130-60',
cellSize: '140-60',
});
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React, { useState } from 'react';
import { DataQueryFilter, DataSourceState, useLazyDataSource, useUuiContext } from '@epam/uui-core';
import { DataSourceViewer } from '@epam/uui-docs';
import { TApi } from '../../../data';
import { City } from '@epam/uui-docs';

export default function LazyDataSourceDataExample() {
const svc = useUuiContext<TApi>();

const [value, onValueChange] = useState<DataSourceState>({});
const dataSource = useLazyDataSource<City, string, DataQueryFilter<City>>({
api: async (req) => {
// We emulate server cursor-based API here.
// Usually this done at server, and you need to pass cursor as is.

// The server-side logic might be more complex, as we ignore several cases here:
// - we assume the list is sorted by name, and sorting can't change
// To handle this, cursor would need to store field by which the list is sorted.
// - we assume that names are unique.
// To handle this, we would need to add item ID to cursor, and make more complex filter, like:
// where (name > cursor.name) OR (name = cursor.name && id > cursor.id)
// order by name, id

const { cursor, ...request } = req;

if (cursor) {
request.filter = request.filter || {};
// fetch only cities with name after the last fetched city alphabetically
request.filter.name = { gt: cursor };
request.range = { ...request.range, from: 0 };
}

request.sorting = [{ field: 'name', direction: 'asc' }];

const response = await svc.api.demo.cities(request);

if (response.items.length > 0) {
// store last item's name as cursor
response.cursor = response.items[response.items.length - 1].name;
}

return response;
},
}, []);

return (
<DataSourceViewer
value={ value }
onValueChange={ onValueChange }
dataSource={ dataSource }
/>
);
}
Loading

0 comments on commit 074fb5a

Please sign in to comment.