Skip to content

Add custom Request card component#67

Merged
adamshire123 merged 5 commits into
mit-mainfrom
request-card
Jul 16, 2026
Merged

Add custom Request card component#67
adamshire123 merged 5 commits into
mit-mainfrom
request-card

Conversation

@adamshire123

Copy link
Copy Markdown

Why these changes are being introduced:

We wanted to change how the request card component displays
so that the entire card is clickable rather than
having a separate button inside the card for the request action.

How this addresses that need:

Adds a new custom request card component to replace the original.

This new component receives an instance of the original request card component.

The original request card component's properties are passed to the new component's template and calls the parent component's methods to
handle the request actions.

Side effects of this change

Changes to the original request card component's properties and methods may prevent this component from displaying properly.

Relevant ticket(s)

https://mitlibraries.atlassian.net/browse/NDE-155

@adamshire123 adamshire123 changed the title Request card Add custom Request card component Jul 14, 2026
@adamshire123
adamshire123 requested a review from Copilot July 15, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new standalone custom request card web component (custom-mit-request-card) intended to replace the out-of-the-box nde-request-card UI so the entire card is clickable, while delegating request behavior back to the host component.

Changes:

  • Added MitRequestCardComponent (template/styles/logic) that renders a fully clickable card and delegates actions to the host card instance.
  • Added unit tests covering click delegation logic and SVG cloning behavior.
  • Registered the custom component mapping and hid the original nde-request-card via theme styling.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/app/styles/mit-theme.scss Hides the OOTB nde-request-card to avoid duplicate UI when the custom card is injected.
src/app/mit-request-card/mit-request-card.component.ts Implements custom request card behavior, including click delegation and SVG extraction from host.
src/app/mit-request-card/mit-request-card.component.html New card template making the full card keyboard/click interactive.
src/app/mit-request-card/mit-request-card.component.scss New styling for the clickable card and icon.
src/app/mit-request-card/mit-request-card.component.spec.ts Adds unit tests for click behavior and SVG cloning on init.
src/app/custom1-module/customComponentMappings.ts Registers the new request card component mapping (nde-request-card-after).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/mit-request-card/mit-request-card.component.html Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.ts
Comment thread src/app/mit-request-card/mit-request-card.component.ts Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.ts
Comment thread src/app/mit-request-card/mit-request-card.component.scss Outdated
Comment thread src/app/styles/mit-theme.scss Outdated
adamshire123 and others added 2 commits July 15, 2026 12:23
Why these changes are being introduced:
We wanted to change how the request card component displays
so that the entire card is clickable rather than
having a separate button inside the card for the request action.

How this addresses that need:
Adds a new custom request card component to replace the original.

This new component receives an instance of the original request card component.

This new component passes the original request card component's
properties to its template and calls the parent component's methods to
handle the request actions.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Comment thread src/app/styles/mit-theme.scss Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.html Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.html Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.ts
Comment thread src/app/mit-request-card/mit-request-card.component.ts Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.ts Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.scss Outdated
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread src/app/styles/mit-theme.scss Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.html
Comment thread src/app/mit-request-card/mit-request-card.component.ts
Comment thread src/app/mit-request-card/mit-request-card.component.scss

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment thread src/app/mit-request-card/mit-request-card.component.html
Comment thread src/app/mit-request-card/mit-request-card.component.ts
Comment thread src/app/mit-request-card/mit-request-card.component.html
Comment thread src/app/mit-request-card/mit-request-card.component.ts
Comment thread src/app/styles/mit-theme.scss Outdated
@adamshire123

Copy link
Copy Markdown
Author

Comment thread src/app/styles/mit-theme.scss Outdated
Comment thread src/app/mit-request-card/mit-request-card.component.scss Outdated

@djanelle-mit djanelle-mit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Only two small non-blocking musings, but nothing critical.

This looks good to me otherwise!

moves the styles hiding  the original request
card to the component css.

uses ng-deep to make this particular style apply globally
@adamshire123
adamshire123 merged commit fbe17bc into mit-main Jul 16, 2026
1 check passed
@adamshire123
adamshire123 deleted the request-card branch July 16, 2026 15:08
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.

3 participants