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

[KED-2997] Create rename run and edit notes UI behavior #665

Merged
merged 44 commits into from
Jan 6, 2022

Conversation

tynandebold
Copy link
Member

@tynandebold tynandebold commented Dec 7, 2021

Description

Resolves KED-2997.

Development notes

To do this, I've created a couple of new components:

Front-end :

  • A <RunDetailsModal/> component, based on the <SettingsModal/> that we already had, except this new one isn't connected in any way to Redux. It does share a lot of styles with the <SettingsModal/>, as I'm importing that CSS file.
  • A new <Input/> component that lives within a new components/ui folder. This component actually uses a <textarea/> HTML element under the hood, which gives good flexibility. And further, going forward, I think we can start to move some UI-only components into this folder and create any new UI components here, as needed.
  • A <Pencil/> icon component.

Backend :
UpdateRunDetailSuccess now returns a Run with the latest changes requested by the user instead of returning a JSONObject as it did previously.

QA notes

Check out the branch and click on the Edit details pencil icon or the run metadata title/notes text to trigger the modal.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Copy link
Contributor

@studioswong studioswong left a comment

Choose a reason for hiding this comment

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

Great stuff, the UI works great!

I've added some futher comments, in particular some suggestions of taking out the need of the selectedMetadataRunId hook and assigning the run metadata directly on click.

Adding in a request change to also remind us not to merge this in until the mutation endpoints are merged in as a completed feature for this user journey.

src/components/experiment-tracking/details/index.js Outdated Show resolved Hide resolved
src/components/experiment-tracking/details/index.js Outdated Show resolved Hide resolved
const MIN_HEIGHT = 20;

const Input = ({
characterLimit = false,
Copy link
Contributor

Choose a reason for hiding this comment

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

if we set this to 0 by default then we would not need the seperate check for isLimitSet

Suggested change
characterLimit = false,
characterLimit = 0,

src/components/ui/input/index.js Outdated Show resolved Hide resolved
src/components/experiment-tracking/run-metadata/index.js Outdated Show resolved Hide resolved
src/components/experiment-tracking/details/index.js Outdated Show resolved Hide resolved
@@ -0,0 +1,54 @@
import React from 'react';
import Button from '@quantumblack/kedro-ui/lib/components/button';
import Modal from '@quantumblack/kedro-ui/lib/components/modal';
Copy link
Contributor

Choose a reason for hiding this comment

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

hi, the Kedro-UI modal PR is ready to merge. Just need someone to review the handleKeyevents stuff. Can we use that in this if it gets merged before this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, absolutely we can.

@studioswong
Copy link
Contributor

Thanks for the efforts for aligning on the mutation @tynandebold and @rashidakanchwala.

I tested this branch this morning and just now with the new changes that was merged in earlier today, and noticed the following:

  1. The mutation doesn't seem to be working ( see below screenshot.) I am guessing this might be fixed by the latest fix to the BE that @rashidakanchwala might push to this branch?

image

  1. This is likely a problem on the FE side - Once submitting a mutation request that failed, clicking on the rename module for other runs will still display the error message ( 'Couldn't update run details. ....' )

  2. This is also likely to be a problem on the FE side - On testing this branch earlier without the latest BE changes (i.e when the mutation is still working), I notice that, on having submitted the mutation successfully while having the rename module still on, the run details on the module jumps to the first run on the sidebar. (I would've capture this error in a gif, but am not able to reproduce this given the existing mutation errors. We can test this and revisit this once the mutation problems are all clear.)

@studioswong
Copy link
Contributor

studioswong commented Jan 4, 2022

2 more comments about the behaviour of the FE:

  1. As per the design here, the default 'Add here' phrase under the notes input field should not be counted as part of the input characters

Current modal:

image

Design:

image

  1. Some weird behaviour I observed - On trying to edit the notes and receiving an error, the note editing field persists with the last entry on clicking a new run - see below.
    edit-notes

Copy link
Contributor

@rashidakanchwala rashidakanchwala left a comment

Choose a reason for hiding this comment

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

Hi, looks great and works well. Thanks @tynandebold

Would like @limdauto to review the BE work.

Also nit, currently Apply Changes doesn't close modal. It felt more natural to me it would. But there's no requirements of such in the design.

@studioswong
Copy link
Contributor

@tynandebold on checking out this branch and running the app I've been getting the following error - looks like it's worth revisiting?
image

@tynandebold
Copy link
Member Author

@tynandebold on checking out this branch and running the app I've been getting the following error - looks like it's worth revisiting? image

@rashidakanchwala was getting the same thing yesterday. I think you just need to restart all servers/npm install/clear cache/etc. It should work after that. Not exactly sure what Rashida did but she got it working after seeing the same error.

@studioswong
Copy link
Contributor

studioswong commented Jan 6, 2022

yes indeed weirdly an npm install does the trick - thank you.

The mutation is working well now, and I see that the word count and error message issue has been solved - many thanks for that!

One more observation, on having fill in the note editing field and selecting the cancel option, the previous note entry persists on the modal for a different run ( see below gif) - this should be just a simple fix of just clearing the hook / local state.
ezgif com-gif-maker (1)

Sorry to be thick - We are almost there!

Comment on lines 128 to 129
- v${CACHE_VERSION}-{{ arch }}-dependencies-{{ checksum "package.json" }}
- v${CACHE_VERSION}-{{ arch }}-dependencies-
Copy link
Contributor

Choose a reason for hiding this comment

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

are these changes relevant to this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sort of. They're an addendum to what @limdauto did yesterday.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yea this is needed to separate linux cache from windows cache in CI.

Copy link
Collaborator

@limdauto limdauto left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@studioswong studioswong left a comment

Choose a reason for hiding this comment

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

works well for me now - let's get this in once the CI is all clear 😉

…into feature/rename-run-and-edit-notes-behavior#ked-2997
@tynandebold tynandebold merged commit 81c3bd6 into main Jan 6, 2022
@tynandebold tynandebold deleted the feature/rename-run-and-edit-notes-behavior#ked-2997 branch January 6, 2022 16:19
rashidakanchwala added a commit that referenced this pull request Jan 10, 2022
* add pencil/edit icon; create run-details modal; open/close of that modal working

* add basic text area in modal

* local creation of an Input component

* create ui folder and add generic textarea and input components

* use text-decoration for active state

* modal gets dynamic data from selected run

* run details modal tests

* rename textarea to input and use that in modal; remove other input component

* test written for input component

* updates based on PR review

* Rashida's PR reviews; hide edit run button when comparison view is on

* fix typos; update general edit run modal behavior

* add runDetails mutation

* remove searchable text; add client to mutation so tests pass

* don't format schema

* Update backend schema

* Fixed mypy error

* fixed mypy2

* fixed pylint error

* update to id from runId in graphql response

* update run_id to id in response -2

* UpdateRunDetails returns Run

* correct response from updateRunDetails mutation; reset mutation on error; use placeholder for notes field

* fix run-selection anomoly

* fix failing RunDetailsModal test

* update mutation response

* use the Modal component from the repo, not the QB UI one

* fix failing RunDetailsModal test

* remove working_directory from circleci

* add working_directory to build_38

* use tmp folder instead of repo

* revert and use arch

* revert by removing working_directory from build_38 and test build again

* clear input on trigger; remove arch from circle ci

Co-authored-by: Rashida Kanchwala <[email protected]>
Signed-off-by: Rashida Kanchwala <[email protected]>
rashidakanchwala added a commit that referenced this pull request Jan 11, 2022
* add pencil/edit icon; create run-details modal; open/close of that modal working

* add basic text area in modal

* local creation of an Input component

* create ui folder and add generic textarea and input components

* use text-decoration for active state

* modal gets dynamic data from selected run

* run details modal tests

* rename textarea to input and use that in modal; remove other input component

* test written for input component

* updates based on PR review

* Rashida's PR reviews; hide edit run button when comparison view is on

* fix typos; update general edit run modal behavior

* add runDetails mutation

* remove searchable text; add client to mutation so tests pass

* don't format schema

* Update backend schema

* Fixed mypy error

* fixed mypy2

* fixed pylint error

* update to id from runId in graphql response

* update run_id to id in response -2

* UpdateRunDetails returns Run

* correct response from updateRunDetails mutation; reset mutation on error; use placeholder for notes field

* fix run-selection anomoly

* fix failing RunDetailsModal test

* update mutation response

* use the Modal component from the repo, not the QB UI one

* fix failing RunDetailsModal test

* remove working_directory from circleci

* add working_directory to build_38

* use tmp folder instead of repo

* revert and use arch

* revert by removing working_directory from build_38 and test build again

* clear input on trigger; remove arch from circle ci

Co-authored-by: Rashida Kanchwala <[email protected]>
Signed-off-by: Rashida Kanchwala <[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.

4 participants