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

Related resources #219

Merged
merged 430 commits into from
Jul 17, 2023
Merged

Related resources #219

merged 430 commits into from
Jul 17, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Jun 15, 2023

Adds a RelatedResources component, allowing editors to attach first- and third-party links to their document.

@jeffdaley jeffdaley marked this pull request as ready for review July 13, 2023 21:37
@jeffdaley jeffdaley requested a review from a team as a code owner July 13, 2023 21:37
@jeffdaley jeffdaley changed the title WIP: Related resources Related resources Jul 13, 2023
Copy link
Contributor

@jfreda jfreda left a comment

Choose a reason for hiding this comment

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

Still reviewing, just a couple questions so far...

web/app/components/document/sidebar/related-resources.ts Outdated Show resolved Hide resolved
"status",
"owners",
],
// TODO: Confirm this with a fresh index
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean for this to stay in? I'm not really sure what it's in reference to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can remove it but let's make sure to test this on staging.

I have Algolia index problems that prevent me from trying this locally.

Copy link
Contributor

@jfreda jfreda left a comment

Choose a reason for hiding this comment

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

Consider the resources related (just some non-blocking questions/nits).

this.relatedDocuments = cachedDocuments;

this.flashMessages.add({
title: "Unable to save",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: might be somewhat helpful for the user to differentiate between another save (doc?) action.

Suggested change
title: "Unable to save",
title: "Unable to save related resources",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept this generic so it could also apply to non "Related resources"-labeled fields, e.g., "RFC." I've changed it to "Unable to save resource" which might split the difference? What do you think

const getLinkIconHelper = helper<GetLinkIconSignature>(([url]) => {
if (url) {
const urlParts = url.split("/");
let domain = urlParts[2];
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have more URL validation at this level? What kind of UX is it if we fail the assert below?

Copy link
Contributor Author

@jeffdaley jeffdaley Jul 17, 2023

Choose a reason for hiding this comment

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

Yeah good call. I've changed it from assert to if... so if the string doesn't match our formatting, it'll still return a generic icon.

https://github.com/hashicorp-forge/hermes/pull/219/files#diff-1143b701d4f7a899d72b0aec3ef623d0a07db00767f7c3343b7b675fa9ba9291

@jeffdaley jeffdaley merged commit 08c3f04 into main Jul 17, 2023
1 check passed
@jeffdaley jeffdaley deleted the jeffdaley/linked-document branch July 17, 2023 13:57
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.

None yet

2 participants