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

feature: new page for notebook create #1308

Closed
wants to merge 17 commits into from
Closed

feature: new page for notebook create #1308

wants to merge 17 commits into from

Conversation

derek-ho
Copy link
Collaborator

@derek-ho derek-ho commented Nov 30, 2022

Signed-off-by: Derek Ho [email protected]

Description

Creates a new page (with unique URL) for dashboards integration.

Issues Resolved

relates to opensearch-project/dashboards-observability#110 ,
solves opensearch-project/dashboards-observability#9

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2022

Codecov Report

Merging #1308 (be8b274) into 2.x (0fe1253) will decrease coverage by 4.37%.
The diff coverage is 64.70%.

@@             Coverage Diff              @@
##                2.x    opensearch-project/observability#1308      +/-   ##
============================================
- Coverage     41.71%   37.33%   -4.38%     
============================================
  Files           298      257      -41     
  Lines         17753    15377    -2376     
  Branches       4280     4039     -241     
============================================
- Hits           7405     5741    -1664     
+ Misses        10176     9605     -571     
+ Partials        172       31     -141     
Flag Coverage Δ
dashboards-observability 37.33% <64.70%> (+0.07%) ⬆️
opensearch-observability ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...lic/components/notebooks/components/note_table.tsx 55.00% <ø> (+2.05%) ⬆️
...ublic/components/notebooks/components/notebook.tsx 30.14% <50.00%> (+0.66%) ⬆️
.../public/components/notebooks/components/create.tsx 65.62% <65.62%> (ø)
...bility/public/components/metrics/helpers/utils.tsx 74.28% <0.00%> (-1.43%) ⬇️
...s/trace_analytics/components/common/search_bar.tsx 82.35% <0.00%> (ø)
...in/org/opensearch/observability/model/Timestamp.kt
...rvability/model/ObservabilityObjectSearchResult.kt
...ensearch/observability/model/SavedVisualization.kt
...ervability/action/GetObservabilityObjectRequest.kt
...rch/observability/model/ObservabilityObjectType.kt
... and 37 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@derek-ho derek-ho marked this pull request as ready for review December 1, 2022 19:36
@derek-ho derek-ho requested a review from a team as a code owner December 1, 2022 19:36
Signed-off-by: Derek Ho <[email protected]>
sejli
sejli previously approved these changes Dec 1, 2022
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
mengweieric
mengweieric previously approved these changes Dec 7, 2022
@@ -81,4 +81,39 @@ describe('<NoteTable /> spec', () => {
utils.getByText('Actions').click();
utils.getByText('Rename').click();
});
});

it('create notebook', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add or modify any cypress tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call out let me check

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mengweieric fixed in: 3dc8296. Do we want to run cypress test as a part of github action? It's a bit long but we should know about it somehow/they should be updated on any changes or flakiness or they should be removed in my opinion - why do we have tests that don't run on a regular basis?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, yes that's one task I currently have on plate, just need to resolve all the failing tests which may need some helping hands. Not sure if we should simply just add it to run on every PR or something like a nightly run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mengweieric I vote for nightly run 👍🏽 😄

Signed-off-by: Derek Ho <[email protected]>
mengweieric
mengweieric previously approved these changes Dec 7, 2022
Copy link
Member

@ps48 ps48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. In general, we need some UX feedback here. In my opinion, it is a bad experience to create a whole page for 1 input box.

.click();
cy.wait(delay);

cy.get('.euiToastHeader__title').contains('Invalid notebook name').should('exist');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the invalid notebook toast here. Any reason we removed this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this because now the create button will not be clickable unless they have entered in some non-empty string. This is to keep the page on parity with the application analytics create page, as I was thinking to keep a consistent experience across the plugin, but I can change it back if folks think that's not appropriate. @ps48 @mengweieric


const onCreate = (name: string) => {
createNotebook(name);
sessionStorage.setItem('NotebooksName', '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a hard requirement to use sessionStorage here? Side Question: Why are we resetting NotebooksName in sessionStorage after creation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hard requirement, but again wanted to keep some parity between application analytics and notebooks. I think only reason is to not lose page content on refresh, but not sure how valuable that is. The reset is so that if they create something and then try to create another one they will not see their old notebook name when trying to create a new one.

renameNotebook: (name: string, id: string) => void
}

export const CreateNotebook = (props: CreateNotebookProps) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the name here CreateNotebook -> CreateNotebookPage Maybe? We already have createNotebook function. This would be confusing for other developers if not changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Changed in 1e6978c

@derek-ho
Copy link
Collaborator Author

derek-ho commented Dec 7, 2022

I left some comments. In general, we need some UX feedback here. In my opinion, it is a bad experience to create a whole page for 1 input box.

@ps48 this PR is coming from opensearch-project/dashboards-observability#110, as part of the integration we need a new landing page when creating/editing notebooks. @pjfitzgibbons can you chime in here? I agree we may need UX on how to layout the page in a better way...

Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants