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

17152 Menu UI improvements #635

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.0.11",
"version": "5.0.12",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand Down
41 changes: 28 additions & 13 deletions src/components/new-request/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
item-value="[group,value]"
:menu-props="{ bottom: true, offsetY: true, maxHeight: 423 }"
@change="setClearErrors(null); onRequestActionChange($event)"
return-object
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Aug 2, 2023

Choose a reason for hiding this comment

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

This returns the entire item object (in $event) instead of just its value.

>
<template v-slot:item="{ item }">
<!-- FUTURE: use "selection" slot to format the selected business -->
<!-- <template #selection="{ item }">
<div class="font-weight-bold text-truncate">{{ item.text }}</div>
<div class="text-subtitle-1">{{ item.subtext }}</div>
</template> -->
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Aug 2, 2023

Choose a reason for hiding this comment

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

I played with this a little on Janis' and Ethan's request, and we decided to not pursue this yet, but I left the code here for the next dev.

Sample:
Clipboard - August 1, 2023 3_08 PM

^^ plus some CSS to tighten up line heights/margins


<template #item="{ item }">
<v-list-item-content
v-if="item.isHeader"
class="group-header px-4 py-5"
Expand All @@ -32,9 +39,12 @@
</div>
</v-list-item-content>

<!-- render but conditionally hide disabled list items, so that the v-select
continues to display the current selection even when a different group is active -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the item is not in the list then the v-select sometimes shows a blank selection (ticket 17044).

<v-list-item-content
v-else
class="group-item pl-8 pr-4 py-4"
:class="{ 'hide-me': item.disabled }"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can't just use d-none because it's actually the parent element I need to hide.

>
<div class="font-weight-bold">{{ item.text }}</div>
<div>{{ item.subtext }}</div>
Expand Down Expand Up @@ -404,19 +414,20 @@ export default class Search extends Mixins(CommonMixin) {
}
/** The request action items to display. */
get requestActions () {
return RequestActions.filter(action => {
// always show header action
if (action.isHeader) return true
// show item action if group is open
if (action.group === this.activeActionGroup) return true
// don't show this action
return false
get requestActions (): RequestActionsI[] {
return RequestActions.filter(item => {
// always include header items
if (item.isHeader) return true
// include but disable items not in active group
// (they will be hidden via CSS)
item['disabled'] = (item.group !== this.activeActionGroup)
return true
})
}
/** If current group is active, deactivates it, otherwise activates group. */
toggleActionGroup (group: number) {
toggleActionGroup (group: number): void {
this.activeActionGroup = (this.activeActionGroup === group) ? NaN : group
}
Expand Down Expand Up @@ -543,8 +554,8 @@ export default class Search extends Mixins(CommonMixin) {
}
/** Called when Request Action menu item is changed. */
onRequestActionChange (text: string): void {
this.request = RequestActions.find(request => request.text === text)
onRequestActionChange (request: RequestActionsI): void {
this.request = request
// clear Jurisdiction and Entity Type
this.setLocation(null)
Expand Down Expand Up @@ -598,8 +609,12 @@ export default class Search extends Mixins(CommonMixin) {
padding: 20px 8px !important;
}
// set content colour when hovering over list items
// hide disabled list items
::v-deep .v-list-item:has(.v-list-item__content.hide-me) {
JazzarKarim marked this conversation as resolved.
Show resolved Hide resolved
display: none;
}
// set content colour when hovering over list items
.v-list-item:hover .v-list-item__content,
.list-item:hover {
color: $app-blue !important;
Expand Down
Loading