Skip to content

Commit

Permalink
[Backport 2.x] Make the steps diagram honor the theme (#1550)
Browse files Browse the repository at this point in the history
* Make the steps diagram honor the theme (#1538)

Signed-off-by: Miki <[email protected]>
Co-authored-by: Craig Perkins <[email protected]>
Co-authored-by: Ryan Liang <[email protected]>
(cherry picked from commit 20ba268)

* Update jwt_auth.test.ts

Extend timeout for 2.x line

Signed-off-by: Stephen Crawford <[email protected]>

---------

Signed-off-by: Stephen Crawford <[email protected]>
Co-authored-by: Miki <[email protected]>
Co-authored-by: Stephen Crawford <[email protected]>
  • Loading branch information
3 people authored Aug 16, 2023
1 parent a5e35e3 commit e10924a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 107 deletions.
42 changes: 42 additions & 0 deletions public/apps/configuration/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,45 @@
.limit-width-input {
max-width: 400px;
}

.security-steps-diagram {
height: 114px;
position: relative;

&::before,
&::after {
content: "";
position: absolute;
width: 100%;
height: 100%;
}

&::before {
mask: url("../../assets/get_started_layer_1.svg") center / contain no-repeat;
background: $euiColorDarkestShade;
}

&::after {
mask: url("../../assets/get_started_layer_2.svg") center / contain no-repeat;
background: $euiColorPrimary;
}

@supports not (mask: center / contain no-repeat) {
/* stylelint-disable property-no-vendor-prefix */
&::before,
&::after {
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
-webkit-mask-position: center;
}

&::before {
-webkit-mask-image: url("../../assets/get_started_layer_1.svg");
}

&::after {
-webkit-mask-image: url("../../assets/get_started_layer_2.svg");
}
/* stylelint-enable property-no-vendor-prefix */
}
}
13 changes: 1 addition & 12 deletions public/apps/configuration/panels/get-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
EuiCode,
EuiFlexGroup,
EuiFlexItem,
EuiImage,
EuiPageHeader,
EuiPanel,
EuiSpacer,
Expand All @@ -31,7 +30,6 @@ import { FormattedMessage } from '@osd/i18n/react';
import { flow } from 'lodash';
import { HashRouter as Router, Route } from 'react-router-dom';
import { AppDependencies } from '../../types';
import securityStepsDiagram from '../../../assets/get_started.svg';
import { buildHashUrl, buildUrl } from '../utils/url-builder';
import { Action, ResourceType, RouteItem } from '../types';
import { API_ENDPOINT_CACHE, DocLinks } from '../constants';
Expand Down Expand Up @@ -189,16 +187,7 @@ export function GetStarted(props: AppDependencies) {
</EuiText>

<EuiSpacer size="l" />
{props.config.ui.backend_configurable && (
<div className="text-center">
<EuiImage
size="xl"
alt="Three steps to set up your security"
url={securityStepsDiagram}
style={{ maxWidth: '100%', height: 'auto', width: 'auto' }}
/>
</div>
)}
{props.config.ui.backend_configurable && <div className={'security-steps-diagram'} />}

<EuiSpacer size="l" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,8 @@ exports[`Get started (landing page) renders when backend configuration is enable
size="l"
/>
<div
className="text-center"
>
<EuiImage
alt="Three steps to set up your security"
size="xl"
style={
Object {
"height": "auto",
"maxWidth": "100%",
"width": "auto",
}
}
url="test-file-stub"
/>
</div>
className="security-steps-diagram"
/>
<EuiSpacer
size="l"
/>
Expand Down
79 changes: 1 addition & 78 deletions public/assets/get_started.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/get_started_layer_1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/get_started_layer_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions test/jest_integration/jwt_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('start OpenSearch Dashboards server', () => {
.sign(key);
const driver = getDriver(browser, options).build();
await driver.get(`http://localhost:5601/app/opensearch_dashboards_overview?token=${token}`);
await driver.wait(until.elementsLocated(By.xpath(pageTitleXPath)), 10000);
await driver.wait(until.elementsLocated(By.xpath(pageTitleXPath)), 15000);

const cookie = await driver.manage().getCookies();
expect(cookie.length).toEqual(1);
Expand All @@ -259,7 +259,7 @@ describe('start OpenSearch Dashboards server', () => {

await driver.wait(
until.elementsLocated(By.xpath('//*[@data-test-subj="sendRequestButton"]')),
10000
15000
);

const cookie = await driver.manage().getCookies();
Expand Down

0 comments on commit e10924a

Please sign in to comment.