Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharable Kedro-Viz UI for AWS, GCP and Azure #1718

Merged
merged 26 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1bdd7ae
shareable viz with multiple platform UI
jitu5 Jan 24, 2024
bfb8a66
test fix
jitu5 Jan 25, 2024
ecbcdbb
Relative path fix for user entered url
jitu5 Jan 25, 2024
8b49f52
Test updated
jitu5 Jan 26, 2024
11768e5
Test updated
jitu5 Jan 26, 2024
1b0c5d3
UI alignment and endpoint help text added.
jitu5 Feb 20, 2024
5f349ad
Add Kedro-Viz documentation URLs and update modal content
jitu5 Feb 20, 2024
dd4deba
Merge branch 'feature/shareableviz-extended-support' of https://githu…
ravi-kumar-pilla Feb 20, 2024
102165a
Code review suggestions added
jitu5 Feb 21, 2024
7c9ced9
Merge branch 'feature/shareableviz-extended-support' into feature/sha…
jitu5 Feb 21, 2024
9505a3f
Refactor form field names in ShareableUrlModal component
jitu5 Feb 21, 2024
67d43f9
Add cursor style to input field in shareable-url-modal.js
jitu5 Feb 21, 2024
4ac0c05
Add cursor style to input field in shareable-url-modal.js
jitu5 Feb 21, 2024
0173d6a
Merge branch 'feature/share_viz_ui' of https://github.com/kedro-org/k…
ravi-kumar-pilla Feb 21, 2024
0039a15
Variable names updated.
jitu5 Feb 21, 2024
ccfa453
add exception handlers
ravi-kumar-pilla Feb 21, 2024
9ea4b83
Merge branch 'feature/share_viz_ui' of https://github.com/kedro-org/k…
ravi-kumar-pilla Feb 21, 2024
3debad8
Disclaimer note added and shareable-url-modal component refactored by…
jitu5 Feb 21, 2024
b5d3674
Wrapped the prop methods with useCallback
jitu5 Feb 22, 2024
7924277
info text updated.
jitu5 Feb 22, 2024
3f3e877
Merge branch 'feature/share_viz_ui' of https://github.com/kedro-org/k…
jitu5 Feb 22, 2024
6402fd2
Test fixed
jitu5 Feb 22, 2024
1522589
test fix and rearranging jsx
jitu5 Feb 22, 2024
cf471ab
Cypress test fix
jitu5 Feb 22, 2024
8a43e5b
button text updated
jitu5 Feb 22, 2024
bcece9d
Keeping button text as Publish for a link seetings
jitu5 Feb 22, 2024
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
4 changes: 2 additions & 2 deletions cypress/fixtures/mock/deploySuccessResponse.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"message": "Website deployed on S3",
"url": "http://myBucketName.s3-website.us-east-1.amazonaws.com"
"message": "Website deployed on AWS",
"url": "http://www.example.com"
}
56 changes: 41 additions & 15 deletions cypress/tests/ui/flowchart/shareable-urls.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('Shareable URLs', () => {
// Action
cy.reload();
cy.get('.pipeline-menu-button--deploy').click({ force: true });
cy.get('[data-test="disclaimerButton"]').click({ force: true });

// Assert after action
cy.get('.shareable-url-modal .modal__wrapper').contains(
Expand All @@ -28,6 +29,7 @@ describe('Shareable URLs', () => {
// Action
cy.reload();
cy.get('.pipeline-menu-button--deploy').click({ force: true });
cy.get('[data-test="disclaimerButton"]').click({ force: true });

// Assert after action
cy.get('.shareable-url-modal .modal__wrapper').contains(
Expand All @@ -38,6 +40,7 @@ describe('Shareable URLs', () => {
it('verifies that shareable url modal closes on close button click #TC-54', () => {
// Action
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal__button-wrapper button')
.contains('Cancel')
.click();
Expand All @@ -49,65 +52,73 @@ describe('Shareable URLs', () => {
);
});

it('verifies that users can click on region dropdown and see all region options #TC-55', () => {
const regionCount = 30;
it('verifies that users can click on platform dropdown and see all platform options #TC-55', () => {
const platformCount = 3;

// Action
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal [data-test=kedro-pipeline-selector]').click();

// Assert after action
cy.get('.shareable-url-modal .menu-option').should(
'have.length',
regionCount
platformCount
);
});

it('verifies that publish button should be disabled when region is not selected and bucket name is empty #TC-56', () => {
const selectedRegion = 'Select a region';
it('verifies that publish button should be disabled when platform is not selected and bucket name & endpoint name are empty #TC-56', () => {
const selectedPlatform = 'Select a hosting platform';
const primaryButtonNodeText = 'Publish';

// Action
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();

// Assert after action
cy.get(
'.shareable-url-modal [data-test=kedro-pipeline-selector] .dropdown__label span'
).contains(selectedRegion);
cy.get('.shareable-url-modal textarea').should('have.value', '');
).contains(selectedPlatform);
cy.get('.shareable-url-modal input').should('have.value', '');
cy.get('.shareable-url-modal__button-wrapper button')
.contains(primaryButtonNodeText)
.should('be.disabled');
});

it('verifies that publish button should be disabled when a bucket region is selected and bucket name is empty #TC-57', () => {
it('verifies that publish button should be disabled when a platform is selected and bucket name is empty #TC-57', () => {
const primaryButtonNodeText = 'Publish';

// Action
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal [data-test=kedro-pipeline-selector]').click();
cy.get('.shareable-url-modal .dropdown__options section div')
.first()
.click();

// Assert after action
cy.get('.shareable-url-modal textarea').should('have.value', '');
cy.get('.shareable-url-modal input').should('have.value', '');
cy.get('.shareable-url-modal__button-wrapper button')
.contains(primaryButtonNodeText)
.should('be.disabled');
});

it('verifies that publish button should be enabled when region is selected and bucket name is not empty #TC-58', () => {
it('verifies that publish button should be enabled when platform is selected and bucket name & endpoint name are not empty #TC-58', () => {
const endpointName = 'http://www.example.com';
const bucketName = 'myBucketName';
const primaryButtonNodeText = 'Publish';

// Action
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal [data-test=kedro-pipeline-selector]').click();
cy.get('.shareable-url-modal .dropdown__options section div')
.first()
.click();
cy.get('.shareable-url-modal textarea').type(bucketName);
cy.get('.shareable-url-modal [data-test="bucket_name"]').type(bucketName);
cy.get('.shareable-url-modal [data-test="endpoint_name"]').type(
endpointName
);

// Assert after action
cy.get('.shareable-url-modal__button-wrapper button')
Expand All @@ -116,15 +127,20 @@ describe('Shareable URLs', () => {
});

it('verifies that error message appears with wrong inputs on publish button click #TC-59', () => {
const endpointName = 'http://www.example.com';
const bucketName = 'myBucketName';
const primaryButtonNodeText = 'Publish';
// Action
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal [data-test=kedro-pipeline-selector]').click();
cy.get('.shareable-url-modal .dropdown__options section div')
.first()
.click();
cy.get('.shareable-url-modal textarea').type(bucketName);
cy.get('.shareable-url-modal [data-test="bucket_name"]').type(bucketName);
cy.get('.shareable-url-modal [data-test="endpoint_name"]').type(
endpointName
);
cy.get('.shareable-url-modal__button-wrapper button')
.contains(primaryButtonNodeText)
.click();
Expand All @@ -137,6 +153,7 @@ describe('Shareable URLs', () => {

it('verifies that AWS link is generated with correct inputs on publish button click #TC-60', () => {
const bucketName = 'myBucketName';
const endpointName = 'http://www.example.com';
const primaryButtonNodeText = 'Publish';

// Intercept the network request to mock with a fixture
Expand All @@ -149,11 +166,15 @@ describe('Shareable URLs', () => {
// Action
cy.reload();
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal [data-test=kedro-pipeline-selector]').click();
cy.get('.shareable-url-modal .dropdown__options section div')
.first()
.click();
cy.get('.shareable-url-modal textarea').type(bucketName);
cy.get('.shareable-url-modal [data-test="bucket_name"]').type(bucketName);
cy.get('.shareable-url-modal [data-test="endpoint_name"]').type(
endpointName
);
cy.get('.shareable-url-modal__button-wrapper button')
.contains(primaryButtonNodeText)
.click();
Expand All @@ -169,8 +190,9 @@ describe('Shareable URLs', () => {

it('verifies that AWS link is generated with correct inputs on Republish button click #TC-61', () => {
const bucketName = 'myBucketName';
const endpointName = 'http://www.example.com';
const primaryButtonNodeText = 'Publish';
const primaryButtonNodeTextVariant = 'Republish';
const primaryButtonNodeTextVariant = 'Publish';
const secondaryButtonNodeText = 'Link Settings';

// Intercept the network request to mock with a fixture
Expand All @@ -183,11 +205,15 @@ describe('Shareable URLs', () => {
// Action
cy.reload();
cy.get('.pipeline-menu-button--deploy').click();
cy.get('[data-test="disclaimerButton"]').click();
cy.get('.shareable-url-modal [data-test=kedro-pipeline-selector]').click();
cy.get('.shareable-url-modal .dropdown__options section div')
.first()
.click();
cy.get('.shareable-url-modal textarea').type(bucketName);
cy.get('.shareable-url-modal [data-test="bucket_name"]').type(bucketName);
cy.get('.shareable-url-modal [data-test="endpoint_name"]').type(
endpointName
);
cy.get('.shareable-url-modal__button-wrapper button')
.contains(primaryButtonNodeText)
.click();
Expand Down
15 changes: 15 additions & 0 deletions package/kedro_viz/api/rest/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
get_selected_pipeline_response,
)

try:
from azure.core.exceptions import ServiceRequestError
except ImportError: # pragma: no cover
ServiceRequestError = None # type: ignore

logger = logging.getLogger(__name__)

router = APIRouter(
Expand Down Expand Up @@ -68,6 +73,16 @@ async def deploy_kedro_viz(input_values: DeployerConfiguration):
return JSONResponse(
status_code=401, content={"message": "Please provide valid credentials"}
)
except (
# pylint: disable=catching-non-exception
(FileNotFoundError, ServiceRequestError)
if ServiceRequestError is not None
else FileNotFoundError
) as exc: # pragma: no cover
logger.exception("FileNotFoundError while deploying Kedro Viz : %s ", exc)
return JSONResponse(
status_code=400, content={"message": "The specified bucket does not exist"}
)
except Exception as exc: # pragma: no cover
logger.exception("Deploying Kedro Viz failed: %s ", exc)
return JSONResponse(status_code=500, content={"message": f"{exc}"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const RunDetailsModal = ({
defaultValue={valuesToUpdate.title}
onChange={(value) => onChange('title', value)}
resetValueTrigger={visible}
type="textarea"
size="large"
/>
</div>
Expand All @@ -100,6 +101,7 @@ const RunDetailsModal = ({
onChange={(value) => onChange('notes', value)}
placeholder="Add here"
resetValueTrigger={visible}
type="textarea"
size="small"
/>
</div>
Expand Down
33 changes: 18 additions & 15 deletions src/components/metadata/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {

import './styles/metadata.scss';
import MetaDataStats from './metadata-stats';
import { isRunningLocally } from '../../utils';

/**
* Shows node meta data
Expand Down Expand Up @@ -291,21 +292,23 @@ const MetaData = ({
</button>
</>
)}
{hasTrackingData && (
<button
className="pipeline-metadata__link"
onClick={
isMetricsTrackingDataset
? toMetricsViewPath
: toExperimentTrackingPath
}
>
<ExpandIcon className="pipeline-metadata__link-icon"></ExpandIcon>
<span className="pipeline-metadata__link-text">
Open in Experiment Tracking
</span>
</button>
)}
{isRunningLocally()
? hasTrackingData && (
<button
className="pipeline-metadata__link"
onClick={
isMetricsTrackingDataset
? toMetricsViewPath
: toExperimentTrackingPath
}
>
<ExpandIcon className="pipeline-metadata__link-icon"></ExpandIcon>
<span className="pipeline-metadata__link-text">
Open in Experiment Tracking
</span>
</button>
)
: null}
{hasPreviewData && (
<>
<div className="pipeline-metadata__preview">
Expand Down
41 changes: 22 additions & 19 deletions src/components/settings-modal/settings-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Button from '../ui/button';
import Modal from '../ui/modal';

import './settings-modal.scss';
import { isRunningLocally } from '../../utils';

/**
* Modal to allow users to change the flag settings
Expand Down Expand Up @@ -157,25 +158,27 @@ const SettingsModal = ({
toggleValue={toggleFlags[value]}
/>
))}
{isOutdated ? (
<div className="pipeline-settings-modal__upgrade-reminder">
<span>&#8226; Kedro-Viz {latestVersion} is here! </span>
<a
href="https://github.com/kedro-org/kedro-viz/releases"
target="_blank"
rel="noopener noreferrer"
>
View release notes
</a>
</div>
) : (
<div className="pipeline-settings-modal__already-latest">
<span>
&#8226; You are on the latest version of Kedro-Viz (
{latestVersion})
</span>
</div>
)}
{isRunningLocally() ? (
isOutdated ? (
<div className="pipeline-settings-modal__upgrade-reminder">
<span>&#8226; Kedro-Viz {latestVersion} is here! </span>
<a
href="https://github.com/kedro-org/kedro-viz/releases"
target="_blank"
rel="noopener noreferrer"
>
View release notes
</a>
</div>
) : (
<div className="pipeline-settings-modal__already-latest">
<span>
&#8226; You are on the latest version of Kedro-Viz (
{latestVersion})
</span>
</div>
)
) : null}
</div>
<div className="run-details-modal-button-wrapper">
<Button
Expand Down
Loading