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

Source management sorting #3

Merged
merged 8 commits into from
Sep 2, 2024
Merged

Source management sorting #3

merged 8 commits into from
Sep 2, 2024

Conversation

Saelmala
Copy link

@Saelmala Saelmala commented Aug 28, 2024

This PR:

  • Adds a lastConnected to the Source dB schema, which updates on inventory syncing if the source is found in the api
  • Adds functionality to the FilterDropdown to sort sources based on their lastConnected date, with a button to reverse the order of the sorting

No sorting selected (in this case, the 'reverse sort order' button is disabled):

Sort on most recent is selected, reverse button NOT pressed:

Sort on most recent is selected, with the reverse button pressed:

Copy link

@bwallberg bwallberg left a comment

Choose a reason for hiding this comment

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

I think for this to feel complete we should add the "lastConnected" date to the inventory card. Difficult to make an educated decision since the information isn't available 🙈

@Saelmala
Copy link
Author

Saelmala commented Aug 29, 2024

Added last connected date to the source card/ edit view:

birme pushed a commit that referenced this pull request Aug 29, 2024
fix: generate correct gui-version on build
return {
...inventorySource,
status: apiSource.status
status: apiSource.status,
lastConnected: new Date()

Choose a reason for hiding this comment

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

I just learned ( yesterday ) that the API now actually stores some data about previously connected sources ( they used to just disappear... ) so we have check the status here and only update lastConnected if status !== "gone".

Copy link

@bwallberg bwallberg left a comment

Choose a reason for hiding this comment

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

See comment about when to set lastConnected. The rest of code LGTM!

Copy link

@bwallberg bwallberg left a comment

Choose a reason for hiding this comment

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

👏

Copy link

@malmen237 malmen237 left a comment

Choose a reason for hiding this comment

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

LGTM

@LucasMaupin
Copy link

LGTM

@Saelmala Saelmala merged commit bb5c1a2 into main Sep 2, 2024
4 checks passed
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.

4 participants