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

#5921 - user feedback: add documentation link in page editor #5982

Merged

Conversation

grahamlangford
Copy link
Collaborator

What does this PR do?

Demo

image

Checklist

  • Designate a primary reviewer @BLoe

@grahamlangford grahamlangford requested review from twschiller and turbochef and removed request for twschiller and turbochef June 29, 2023 19:35
@@ -56,13 +62,26 @@ const EditorNodeConfigPanel: React.FC = () => {
/>
);

const showDocumentationLink = !isLoadingListing && listings[blockId]?.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only want to show the link if the "how to use" section is not empty for the listing? IIRC that was the old behavior we had

Copy link
Collaborator

@BLoe BLoe left a comment

Choose a reason for hiding this comment

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

There is a now-unused component for this called ConfigurationTitle. I think this PR should either:

  • Rename/refactor/use that component for this docs link
    OR
  • Delete that component if no longer needed

TBH, I originally thought we were just going to add the ConfigurationTitle component back in, in order to complete both this and the brick name task 🤷

@grahamlangford
Copy link
Collaborator Author

grahamlangford commented Jun 29, 2023

There is a now-unused component for this called ConfigurationTitle. I think this PR should either:

  • Rename/refactor/use that component for this docs link
    OR
  • Delete that component if no longer needed

TBH, I originally thought we were just going to add the ConfigurationTitle component back in, in order to complete both this and the brick name task 🤷

Didn't know about this component, looking into it now. Looks like it's exactly what I needed with a few tweaks. All I really need to do is add a check for the instructions.

Copy link
Collaborator

@BLoe BLoe left a comment

Choose a reason for hiding this comment

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

What you have here is probably fine, and this is a minor feature, but it's not really handling async state in our newer idiomatic way using AsyncStateGate or other utils.

See here for an example of using AsyncStateGate to guard the async state instead of checking loading flags/values.

Comment on lines 68 to 69
const showDocumentationLink =
!isLoadingListing && listingInstructions && listingId;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably don't need to check the loading flag if you are also checking falsy values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We really don't. I just didn't think to remove it when I changed the other checks.

@@ -30,6 +30,9 @@ import PopoverInfoLabel from "@/components/form/popoverInfoLabel/PopoverInfoLabe
import AnalysisResult from "@/pageEditor/tabs/editTab/AnalysisResult";
import { useSelector } from "react-redux";
import { selectActiveNodeInfo } from "@/pageEditor/slices/editorSelectors";
import { MARKETPLACE_URL } from "@/utils/strings";
import { useGetMarketplaceListingsQuery } from "@/services/api";
import classNames from "classnames";
Copy link
Contributor

Choose a reason for hiding this comment

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

The convention is to import as cx, import cx from "classnames". This would be a good lint rule too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have a linting epic for those now. I'll add that as a recommendation.

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #5982 (ed6817a) into main (7d903ef) will increase coverage by 0.08%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main    #5982      +/-   ##
==========================================
+ Coverage   66.14%   66.23%   +0.08%     
==========================================
  Files        1092     1091       -1     
  Lines       33716    33682      -34     
  Branches     6354     6342      -12     
==========================================
+ Hits        22301    22308       +7     
+ Misses      11415    11374      -41     
Impacted Files Coverage Δ
...ab/editorNodeConfigPanel/EditorNodeConfigPanel.tsx 96.96% <87.50%> (-3.04%) ⬇️

Copy link
Contributor

@twschiller twschiller left a comment

Choose a reason for hiding this comment

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

LGTM - snapshot needs to be updated

@twschiller twschiller added this to the 1.7.33 milestone Jun 30, 2023
…5921-user-feedback-add-documentation-link-in-page-editor
@grahamlangford grahamlangford merged commit d7a499a into main Jun 30, 2023
11 checks passed
@grahamlangford grahamlangford deleted the 5921-user-feedback-add-documentation-link-in-page-editor branch June 30, 2023 16:58
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.

User Feedback: Add Documentation Link in Page Editor
3 participants