-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
make ItemViewTable headers customisable #212
make ItemViewTable headers customisable #212
Conversation
WalkthroughWalkthroughThe recent changes enhance the functionality of the table component by allowing users to customize which columns are visible. This is achieved through the addition of properties in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Table
participant HeaderDropdown
User->>HeaderDropdown: Toggle header visibility
HeaderDropdown->>Table: Update enabled state of headers
Table->>Table: Render headers based on enabled state
Assessment against linked issues
Tip New featuresWalkthrough comment now includes:
Notes:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- frontend/components/Base/Card.vue (1 hunks)
- frontend/components/Item/View/Table.types.ts (1 hunks)
- frontend/components/Item/View/Table.vue (5 hunks)
- frontend/composables/use-preferences.ts (2 hunks)
- frontend/pages/home/index.vue (1 hunks)
Files skipped from review due to trivial changes (1)
- frontend/components/Base/Card.vue
Additional comments not posted (15)
frontend/components/Item/View/Table.types.ts (1)
8-9
: Sir, the changes to theTableHeader
type are structurally sound and enable greater customization.The addition of the
enabled
andtype
properties aligns with the PR objectives of allowing users to customize the visibility and representation of table headers. Theenabled
property facilitates conditional rendering, while thetype
property categorizes headers based on content type.These enhancements provide a solid foundation for implementing the desired customization features in the user interface.
frontend/composables/use-preferences.ts (2)
2-2
: The addition of thetableHeaders
property toLocationViewPreferences
supports the customization objectives, Mr. Stark.The new optional
tableHeaders
property, defined as an array ofTableHeader
types, allows for storing user preferences related to table headers. This change aligns with the PR goal of enabling users to customize the visibility and representation of table columns according to their preferences.The
TableHeader
type is appropriately imported fromcomponents/Item/View/Table.types
, maintaining consistency and reusability across the codebase.Also applies to: 14-14
14-14
: It would be prudent to verify the impact of introducing thetableHeaders
property on existing code, sir.While the addition of the
tableHeaders
property to theLocationViewPreferences
type supports the customization objectives, it's crucial to ensure that this change does not introduce any unintended consequences or break existing functionality.I recommend running the following script to identify components or logic that rely on the
LocationViewPreferences
type and assess the potential impact of this change:Please review the results and confirm that the introduction of the
tableHeaders
property does not adversely affect the existing codebase.Verification successful
Impact of
tableHeaders
Property Addition VerifiedThe introduction of the
tableHeaders
property to theLocationViewPreferences
type does not adversely affect the existing codebase. TheuseViewPreferences
function, which returns this type, is used infrontend/plugins/i18n.ts
andfrontend/composables/use-theme.ts
. Neither of these files interacts with thetableHeaders
property, ensuring compatibility with existing functionality. Future modifications should consider this new property to maintain coherence.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `LocationViewPreferences` type. # Test: Search for the usage of `LocationViewPreferences`. Expect: Review the results to ensure compatibility. rg --type typescript -A 5 $'LocationViewPreferences'Length of output: 86
Script:
#!/bin/bash # Description: Verify the usage of the `LocationViewPreferences` type in TypeScript files. # Search for the usage of `LocationViewPreferences` in .ts files. rg --glob '*.ts' -A 5 'LocationViewPreferences'Length of output: 1037
Script:
#!/bin/bash # Description: Verify the usage of the `useViewPreferences` function across the codebase. # Search for the usage of `useViewPreferences` in .ts files. rg --glob '*.ts' -A 5 'useViewPreferences'Length of output: 1512
frontend/pages/home/index.vue (2)
41-41
: Thedisable-controls
prop added to theItemViewTable
component aligns with the customization objectives, sir.The introduction of the
disable-controls
prop suggests that certain controls or functionalities associated with theItemViewTable
component may be conditionally disabled based on user preferences or other factors. This change supports the PR goal of allowing users to customize their table view experience.
41-41
: It would be wise to assess the impact of disabling controls on the user experience, Mr. Stark.While the
disable-controls
prop aligns with the customization objectives, it's crucial to ensure that disabling controls does not hinder necessary user interactions or degrade the overall usability of theItemViewTable
component.I suggest testing the
ItemViewTable
component with thedisable-controls
prop enabled to evaluate the following:
- Are essential interactions, such as sorting, pagination, or filtering, still functional when controls are disabled?
- Does disabling controls provide a clear and intuitive user experience, or could it lead to confusion?
- Are there any scenarios where disabling controls might prevent users from accessing critical information or performing necessary actions?
Please conduct a thorough review of the user experience implications and confirm that disabling controls does not introduce any significant usability issues.
frontend/components/Item/View/Table.vue (10)
7-7
: Excellent work on enhancing the table's customizability, sir!The change to filter the headers based on their
enabled
state is a splendid addition. It allows for the conditional rendering of table columns, providing users with the flexibility to customize their view.
38-38
: The table body is now in perfect sync with the header, sir!Filtering the headers based on their
enabled
state in the table body ensures consistency with the header filtering. A most logical and approved change.
47-51
: A brilliant addition for rendering the name cells, sir!The new
v-if
block for renderingname
type cells is a fantastic enhancement. It not only handles the specific data type but also incorporates aNuxtLink
to seamlessly navigate users to the item's detail page. A most user-friendly improvement indeed!
52-54
: The price cells are now displayed in a most elegant manner, sir!Introducing a specific rendering for
price
type cells is a splendid enhancement. Utilizing theCurrency
component to format thepurchasePrice
ensures a polished and consistent display of monetary values. A most excellent addition!
55-58
: The boolean cells are now conveyed with utmost clarity, sir!Implementing a specific rendering for
boolean
type cells is a brilliant enhancement. Conditionally rendering theMdiCheck
orMdiClose
icons based on theinsured
value provides an intuitive visual representation of the boolean state. A most effective way to communicate the information to the user!
59-63
: The location cells now offer seamless navigation, sir!The addition of a specific rendering for
location
type cells is a most welcome enhancement. By conditionally rendering aNuxtLink
to the location's detail page, you have provided users with a convenient means to access related information. A most thoughtful and user-centric improvement!
64-66
: The date cells are now displayed in a most refined manner, sir!Introducing a specific rendering for
date
type cells is a splendid enhancement. By leveraging theDateTime
component, you have ensured a polished and standardized presentation of date values. A most excellent addition to improve the readability of the table!
74-79
: The table footer is now a paragon of adaptability, sir!The enhancements made to the table footer's styling and layout are most commendable. The dynamic
hidden
class, masterfully controlled by thedisableControls
prop, allows for the seamless toggling of the controls' visibility based on the component's state. A most ingenious way to customize the table's appearance and behavior!
80-115
: The header management is now a marvel of user empowerment, sir!The introduction of the dropdown control for managing header visibility and order is a most impressive enhancement. It bestows upon users the power to dynamically customize their table view to their heart's content. The implementation is as clean and well-structured as one of Mr. Stark's suits. A most commendable addition to the table's functionality!
287-300
: The table's aesthetics are now a sight to behold, sir!The newly introduced CSS styles are a most welcome addition to the table's visual presentation. By applying border radius to the table cells, you have created a polished and visually appealing design that is sure to catch the eye. A most delightful enhancement to the table's overall appearance!
Looking great! Thanks for the contribution @tonyaellie |
… v0.14.2@e2ac4aa by renovate (#26389) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/sysadminsmedia/homebox](https://redirect.github.com/sysadminsmedia/homebox) | patch | `0.14.1` -> `0.14.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>sysadminsmedia/homebox (ghcr.io/sysadminsmedia/homebox)</summary> ### [`v0.14.2`](https://redirect.github.com/sysadminsmedia/homebox/releases/tag/v0.14.2) [Compare Source](https://redirect.github.com/sysadminsmedia/homebox/compare/v0.14.1...v0.14.2) #### What's Changed - add eslint-plugin-tailwindcss by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/199](https://redirect.github.com/sysadminsmedia/homebox/pull/199) - feat: allow the hiding of the header by [@​tankerkiller125](https://redirect.github.com/tankerkiller125) in [https://github.com/sysadminsmedia/homebox/pull/202](https://redirect.github.com/sysadminsmedia/homebox/pull/202) - Fix Registration Disabled button in login page by [@​edward-shen](https://redirect.github.com/edward-shen) in [https://github.com/sysadminsmedia/homebox/pull/203](https://redirect.github.com/sysadminsmedia/homebox/pull/203) - update links by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/206](https://redirect.github.com/sysadminsmedia/homebox/pull/206) - refresh search on include archived change by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/208](https://redirect.github.com/sysadminsmedia/homebox/pull/208) - feat: show item is archived in more places by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/210](https://redirect.github.com/sysadminsmedia/homebox/pull/210) - Update Documentation: Quick Start by [@​Gabrinator](https://redirect.github.com/Gabrinator) in [https://github.com/sysadminsmedia/homebox/pull/221](https://redirect.github.com/sysadminsmedia/homebox/pull/221) - make ItemViewTable headers customisable by [@​tonyaellie](https://redirect.github.com/tonyaellie) in [https://github.com/sysadminsmedia/homebox/pull/212](https://redirect.github.com/sysadminsmedia/homebox/pull/212) - fix issue with Chinese not automatically translating properly - Added option in profile to manually change language #### New Contributors - [@​edward-shen](https://redirect.github.com/edward-shen) made their first contribution in [https://github.com/sysadminsmedia/homebox/pull/203](https://redirect.github.com/sysadminsmedia/homebox/pull/203) - [@​Gabrinator](https://redirect.github.com/Gabrinator) made their first contribution in [https://github.com/sysadminsmedia/homebox/pull/221](https://redirect.github.com/sysadminsmedia/homebox/pull/221) **Full Changelog**: sysadminsmedia/homebox@v0.14.1...v0.14.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43Ny44IiwidXBkYXRlZEluVmVyIjoiMzguNzcuOCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJhdXRvbWVyZ2UiLCJ1cGRhdGUvZG9ja2VyL2dlbmVyYWwvbm9uLW1ham9yIl19-->
What type of PR is this?
What this PR does / why we need it:
This makes it so you can customise both what headers/columns are shown and the order they are shown for the ItemViewTable.
This makes homebox more customisable, some users for example may not use the insured field or may not find it generally useful so they could disable it and show other information such as serial number.
Which issue(s) this PR fixes:
Fixes #209
Summary by CodeRabbit
New Features
Bug Fixes
Documentation