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

Add SectionHeading and PermaLinkDetails components #3591

Merged
merged 10 commits into from
Aug 16, 2024

Conversation

tinykite
Copy link
Contributor

@tinykite tinykite commented Aug 13, 2024

What this does

  • Adds PermaLinkDetails and SectionHeading components.
  • Replaces previous IconButton developer playground examples in CreateLink with new examples nested within the new UI
  • Updates IconButton styles and chevron paths to better match legacy dashboard UI
  • Removes UpdateGUID from CaptureError now that it isn't needed (for now — the component will still exist for future reference)

Screenshot

image

Linear Issue

Satisfies LIL-2313. Required for further work on the Batch Capture history UI.

How to Test

  • Make sure you've toggled both the vue-dashboard and developer-playground flags, either via query parameter or via the django admin.
    • The url pattern for toggling them is https://perma.test:8000/manage/create?dwft_DJANGO-FLAG=1
  • You should see the newly-built Section Headings in addition to the legacy ones. The vue rebuild should be on top:
image
  • You should be able to click or navigate with your keyboard onto each of the buttons within the UI. Clicking or hitting return should log a test message related to the name of each icon button.

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.03%. Comparing base (1ea13fe) to head (182a9c9).
Report is 14 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3591   +/-   ##
========================================
  Coverage    69.03%   69.03%           
========================================
  Files           48       48           
  Lines         6978     6978           
========================================
  Hits          4817     4817           
  Misses        2161     2161           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +37 to +39
<svg v-if="isChevron" class="c-button__chevron" aria-hidden="true" width="14" height="7" viewBox="0 0 14 7" fill="none" xmlns="http://www.w3.org/2000/svg">
<path v-if="props.icon === 'chevron-down'" d="M6.88136 7L14 1.58065L12.5763 0L6.88136 4.26591L1.42373 0L0 1.58065L6.88136 7Z" fill="#2E76EE"/>
<path v-if="props.icon === 'chevron-up'" d="M6.88136 0L14 5.41935L12.5763 7L6.88136 2.73409L1.42373 7L0 5.41935L6.88136 0Z" fill="#2E76EE"/>
Copy link
Contributor Author

@tinykite tinykite Aug 13, 2024

Choose a reason for hiding this comment

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

I initially exported this svg as a 18x9 shape to match the rendered browser size of each chevron image in the legacy dashboard. On closer look, the legacy png included additional whitespace around the chevrons.

To better match this, and future proof the way we might make use of the chevrons in the future, I slightly resized the svg itself and added the necessary margin with a css class.

(If we ever needed additional variants of chevrons in the future, we could always create a component for this and have it accept "size", "direction", and "color" props)

Comment on lines +41 to +50
<SectionHeading name="Another Journal Links" icon="organization">
<template #iconButton>
<IconButton
icon="download-alt"
name="Export Links"
:handleClick="() => {console.log('Export Links');}"

/>
</template>
</SectionHeading>
Copy link
Contributor Author

@tinykite tinykite Aug 14, 2024

Choose a reason for hiding this comment

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

The SectionHeading component can be passed an optional icon prop as a reusable, flexible way to support the needs of the Perma Link list, which will include an organization icon when a user has selected an organization or sponsorship-related folder:

image

@tinykite tinykite marked this pull request as ready for review August 14, 2024 14:45
@tinykite tinykite requested a review from a team as a code owner August 14, 2024 14:45
@tinykite tinykite requested review from bensteinberg and removed request for a team August 14, 2024 14:45
@tinykite tinykite changed the title Add SectionHeading and PermaLinkDetails Add SectionHeading and PermaLinkDetails components Aug 14, 2024
Copy link
Contributor

@bensteinberg bensteinberg left a comment

Choose a reason for hiding this comment

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

LGTM!

@tinykite tinykite merged commit 1a75e7d into harvard-lil:develop Aug 16, 2024
2 checks passed
@tinykite tinykite deleted the add-section-heading branch August 16, 2024 14:07
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