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

UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items #21933

Merged
merged 45 commits into from
Sep 12, 2024

Conversation

jacobshandling
Copy link
Contributor

@jacobshandling jacobshandling commented Sep 9, 2024

#21566 - Host details updates for Uninstall packages

details > software page. Full tasks outlined in the issue, Figma here

Updated install status tooltips:
install-status-tooltips

Uninstall action:
uninstall-action

Update install details:
Screenshot 2024-09-09 at 1 12 58 PM

#21931 - updated specs for install/uninstall states

#21568 - activity feed items for Uninstall

Screenshot 2024-09-09 at 5 00 07 PM
Screenshot 2024-09-09 at 5 42 52 PM
Screenshot 2024-09-09 at 5 43 03 PM

#21567 - Uninstall details modal

Screenshot 2024-09-10 at 7 42 18 PM
remaining TODO:

  • manually QA 'failed' states

  • determine where to source timestamp from for uninstall activities

  • Manual QA for all new/changed functionality

@jacobshandling jacobshandling requested a review from a team as a code owner September 9, 2024 22:25
@jacobshandling jacobshandling marked this pull request as ready for review September 11, 2024 21:03
@jacobshandling jacobshandling changed the title UI – Dynamic PR for Uninstall features UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items Sep 11, 2024
Copy link
Contributor

@gillespi314 gillespi314 left a comment

Choose a reason for hiding this comment

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

Looks good!

I left some non-blocking comments for your consideration. Feel free to address in a follow up PR :)

);
};

const SoftwareUninstallDetailsModal = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't notice any significant differences between uninstall and install details? Are we doing this as its own component for speed of development? (Not a problem, I just wanted to be sure I wasn't missing something.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The differences in data source (similar UI, from different fields of different APIs) for various elements were proving challenging to reconcile. I actually spent a few hours trying to use the existing modal at first, and this route proved simplest and clearest.

Comment on lines +19 to +20
isWindowsPackageType(pkgType) ? "PowerS" : "s"
}hell scripts are supported.`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
isWindowsPackageType(pkgType) ? "PowerS" : "s"
}hell scripts are supported.`;
isWindowsPackageType(pkgType) ? "PowerShell" : "shell"
} scripts are supported.`;

I appreciate the character efficiency, but I think it would be a little easier to read if slightly more verbose.

@@ -175,13 +176,13 @@ const HostSoftware = ({
[isMyDevicePage, refetchDeviceSoftware, refetchHostSoftware]
);

const userHasSWInstallPermission = Boolean(
const userHasSWWritePermission = Boolean(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe userCanWriteSoftware?

@@ -105,7 +105,8 @@ const HostSoftware = ({
isTeamMaintainer,
} = useContext(AppContext);

const [installingSoftwareId, setInstallingSoftwareId] = useState<
// disables install/uninstall actions after click
const [softwareIdActionPending, setSoftwareIdActionPending] = useState<
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just pendingSoftwareId and setPendingSoftwareId?

"pending_uninstall",
"failed_uninstall",
"failed_install",
...SOFTWARE_UNINSTALL_STATUSES,
Copy link
Contributor

Choose a reason for hiding this comment

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

If we have time for changes, I'd probably split this into three consts: install, uninstall, and a combined set of install and uninstall (which I'd just call SOFTWARE_STATUSES).

That way the composition is more clear: [...SOFTWARE_INSTALL_STATUSES, ...SOFTWARE_UNINSTALL_STATUSES].

ISoftwareTitleDetails,
isSoftwarePackage,
} from "interfaces/software";
import { DEFAULT_EMPTY_CELL_VALUE } from "utilities/constants";

const mergePackageStatuses = (packageStatuses: ISoftwarePackage["status"]) => ({
installed: packageStatuses.installed,
pending: packageStatuses.pending_install + packageStatuses.pending_uninstall,
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this used? Is there someplace where we are checking for the potential string "pending_installpending_uninstall"? Are we counting on the backend to ensure that never happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'm understanding your question, those fields actually contain counts of hosts in their respective statuses, not strings representing those statuses, so this gives us the total number of hosts pending install or pending uninstall.

SoftwareInstallStatus | "pending",
string
> = {
pending: "pending",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is pending being retained for for backwards compatibility? Does this still generate the expected text in the getInstallStatusPredicate function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll double check and clean this up a bit if it's not used anymore on an iterative PR, thanks for catching

@jacobshandling jacobshandling merged commit d9f7935 into 20320-feat-uninstall-packages Sep 12, 2024
11 checks passed
@jacobshandling jacobshandling deleted the 20320-ui branch September 12, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants