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 refactor and External Link scope #327

Merged
merged 16 commits into from
Sep 26, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Sep 7, 2023

Refactors and expands the RelatedResources component so it can be used outside of the DocumentSidebar context/format.

  • Moves potentially shared types and functions (most of what happens in-modal) from /components/documents/sidebar/components
  • Adds an external-link scope to skip remove the "search Algolia" functionality. (There's also a document scope that replaces allowAddingExternalLinks=false),
  • Renames some external-link-related files and elements differentiate between scoped and fallback cases

@jeffdaley jeffdaley marked this pull request as ready for review September 7, 2023 20:31
@jeffdaley jeffdaley requested a review from a team as a code owner September 7, 2023 20:31
@jeffdaley jeffdaley changed the title WIP: Related Resources refactor Related Resources refactor and External Link scope Sep 7, 2023
@@ -299,7 +299,6 @@
@documentIsDraft={{this.isDraft}}
@productArea={{@document.product}}
@objectID={{@document.objectID}}
@allowAddingExternalLinks={{true}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now the default setting.

@resource={{this.externalLink}}
@hideModal={{this.hideModal}}
@onClose={{this.hideModal}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to be consistent with the argument Modal expects.

@jeffdaley jeffdaley marked this pull request as draft September 7, 2023 21:25
@jeffdaley jeffdaley marked this pull request as ready for review September 8, 2023 01:05
@@ -6,6 +6,8 @@
</div>
{{else}}
<ul class="related-resources-list" ...attributes>
{{! This is being looped through twice for some reason... }}
{{! On immediate save, the order is wrong - maybe an array push thing? }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we follow up on this (/add a TODO)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was actually resolved and I forgot to remove the comment. Thanks for catching.

@jeffdaley jeffdaley merged commit 1cebdcd into main Sep 26, 2023
1 check passed
@jeffdaley jeffdaley deleted the jeffdaley/related-resources branch September 26, 2023 22:03
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.

2 participants