diff --git a/frontend/cypress/integration/feature-toggle/feature.spec.js b/frontend/cypress/integration/feature-toggle/feature.spec.js index 4446d50a25..a808390cae 100644 --- a/frontend/cypress/integration/feature-toggle/feature.spec.js +++ b/frontend/cypress/integration/feature-toggle/feature.spec.js @@ -129,7 +129,7 @@ describe('feature toggle', () => { }); it('Can add a gradual rollout strategy to the development environment', () => { - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click(); cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-2').click(); @@ -172,7 +172,7 @@ describe('feature toggle', () => { }); it('can update a strategy in the development environment', () => { - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.get('[data-test=STRATEGY_ACCORDION_ID-flexibleRollout').click(); @@ -219,7 +219,7 @@ describe('feature toggle', () => { }); it('can delete a strategy in the development environment', () => { - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.intercept( @@ -238,7 +238,7 @@ describe('feature toggle', () => { }); it('Can add a userid strategy to the development environment', () => { - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click(); cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-3').click(); @@ -285,7 +285,7 @@ describe('feature toggle', () => { it('Can add two variant to the feature', () => { const variantName = 'my-new-variant'; const secondVariantName = 'my-second-variant'; - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/variants`); cy.intercept( 'PATCH', @@ -315,7 +315,7 @@ describe('feature toggle', () => { cy.wait('@variantcreation'); }); it('Can set weight to fixed value for one of the variants', () => { - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/variants`); cy.get('[data-test=VARIANT_EDIT_BUTTON]').first().click(); @@ -352,7 +352,7 @@ describe('feature toggle', () => { it(`can delete variant`, () => { const variantName = 'to-be-deleted'; - cy.wait(500); + cy.wait(1000); cy.visit(`/projects/default/features/${featureToggleName}/variants`); cy.get('[data-test=ADD_VARIANT_BUTTON]').click(); cy.get('[data-test=VARIANT_NAME_INPUT]').type(variantName); diff --git a/frontend/package.json b/frontend/package.json index c8ef4e2ff5..6c8221a9e4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "unleash-frontend", "description": "unleash your features", - "version": "4.8.0-beta.5", + "version": "4.8.0-beta.7", "keywords": [ "unleash", "feature toggle", @@ -48,6 +48,7 @@ "@types/debounce": "1.2.1", "@types/deep-diff": "1.0.1", "@types/jest": "27.4.0", + "@types/lodash.clonedeep": "4.5.6", "@types/node": "14.18.12", "@types/react": "17.0.39", "@types/react-dom": "17.0.11", @@ -56,6 +57,8 @@ "@types/react-test-renderer": "17.0.1", "@types/react-timeago": "4.1.3", "@welldone-software/why-did-you-render": "6.2.3", + "chart.js": "3.7.1", + "chartjs-adapter-date-fns": "2.0.0", "classnames": "2.3.1", "copy-to-clipboard": "3.3.1", "craco": "0.0.3", @@ -66,12 +69,12 @@ "deep-diff": "1.0.2", "fast-json-patch": "3.1.0", "http-proxy-middleware": "2.0.3", - "@types/lodash.clonedeep": "4.5.6", "lodash.clonedeep": "4.5.0", "lodash.flow": "3.5.0", "prettier": "2.5.1", "prop-types": "15.8.1", "react": "17.0.2", + "react-chartjs-2": "4.0.1", "react-dnd": "14.0.5", "react-dnd-html5-backend": "14.1.0", "react-dom": "17.0.2", @@ -82,7 +85,7 @@ "react-test-renderer": "16.14.0", "react-timeago": "6.2.1", "sass": "1.49.8", - "swr": "1.2.1", + "swr": "1.2.2", "typescript": "4.5.5", "web-vitals": "2.1.4" }, diff --git a/frontend/src/app.css b/frontend/src/app.css index 3b145e53ac..1e9cb390a2 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -133,6 +133,10 @@ p { font-size: var(--p-size); } +[hidden] { + display: none !important; +} + @media screen and (max-width: 1024px) { :root { --drawer-padding: 0.75rem 1.25rem; diff --git a/frontend/src/component/common/GeneralSelect/GeneralSelect.tsx b/frontend/src/component/common/GeneralSelect/GeneralSelect.tsx index fb3d7f1842..4c76656312 100644 --- a/frontend/src/component/common/GeneralSelect/GeneralSelect.tsx +++ b/frontend/src/component/common/GeneralSelect/GeneralSelect.tsx @@ -7,6 +7,7 @@ export interface ISelectOption { title?: string; label?: string; } + export interface ISelectMenuProps { name: string; id: string; @@ -14,16 +15,19 @@ export interface ISelectMenuProps { label?: string; options: ISelectOption[]; style?: object; - onChange?: ( - event: React.ChangeEvent<{ name?: string; value: unknown }>, - child: React.ReactNode - ) => void; + onChange?: OnGeneralSelectChange; disabled?: boolean; + fullWidth?: boolean; className?: string; classes?: any; defaultValue?: string; } +export type OnGeneralSelectChange = ( + event: React.ChangeEvent<{ name?: string; value: unknown }>, + child: React.ReactNode +) => void; + const GeneralSelect: React.FC = ({ name, value = '', @@ -35,6 +39,7 @@ const GeneralSelect: React.FC = ({ disabled = false, className, classes, + fullWidth, ...rest }) => { const renderSelectItems = () => @@ -50,10 +55,13 @@ const GeneralSelect: React.FC = ({ )); return ( - - - {label} - + + {label}