UI – remove problematic legacy .body-wrap, apply UI-standard .core-wrapper and .main-content to DUP (#16310)

## More global solution to #16277, cleanup to prevent similar bugs

- Swap out [localized
solution](https://github.com/fleetdm/fleet/pull/16287) for standard
`.main-content` containing desired padding
- Apply `.core-wrapper` class to parent, in line with all other UI pages
- Remove problematic legacy `.body-wrap`
  - spot check all places this class was being applied:
    - PlatformWrapper
    - LiveQuery –> SelectTargets (was causing excess padding here)
    - PackQueriesTable (caused excess padding here)
    - TeamManagementPage (excess padding was being locally negated)
    - EditQueryPage
    - LiveQueryPage
    - DeviceUserPage
  - Remove local styles meant to negate `.body-wrap`'s styles

- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
Jacob Shandling 2024-01-25 18:48:38 +00:00 committed by GitHub
parent c8ac7777e3
commit 07366e9497
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 9 additions and 23 deletions

View File

@ -16,10 +16,6 @@
margin: 0;
}
.body-wrap {
padding: 0;
}
.input-field {
&__textarea {
min-height: 88px;

View File

@ -416,7 +416,7 @@ const SelectTargets = ({
if (isLoadingLabels || (isPremiumTier && isLoadingTeams)) {
return (
<div className={`${baseClass}__wrapper body-wrap`}>
<div className={`${baseClass}__wrapper`}>
<h1>Select targets</h1>
<div className={`${baseClass}__page-loading`}>
<Spinner />
@ -427,7 +427,7 @@ const SelectTargets = ({
if (errorLabels || errorTeams) {
return (
<div className={`${baseClass}__wrapper body-wrap`}>
<div className={`${baseClass}__wrapper`}>
<h1>Select targets</h1>
<PageError />
</div>

View File

@ -72,7 +72,7 @@ const PackQueriesTable = ({
const tableData = generateDataSet(getQueries());
return (
<div className={`${baseClass} body-wrap`}>
<div className={`${baseClass}`}>
{scheduledQueries?.length ? (
<TableContainer
columnConfigs={tableHeaders}

View File

@ -252,7 +252,7 @@ const TeamManagementPage = (): JSX.Element => {
const tableData = teams ? generateDataSet(teams) : [];
return (
<div className={`${baseClass} body-wrap`}>
<div className={`${baseClass}`}>
<p className={`${baseClass}__page-description`}>
Create, customize, and remove teams from Fleet.
</p>

View File

@ -1,5 +1,4 @@
.team-management {
padding: 0;
&__page-description {
font-size: $x-small;
color: $core-fleet-black;

View File

@ -359,11 +359,11 @@ const DeviceUserPage = ({
findIndex(tabPaths, (x) => x.startsWith(pathname.split("?")[0]));
return (
<div className="fleet-desktop-wrapper">
<div className="core-wrapper">
{isLoadingHost ? (
<Spinner />
) : (
<div className={`${baseClass} body-wrap`}>
<div className={`${baseClass} main-content`}>
{host?.platform === "darwin" &&
isMdmUnenrolled &&
globalConfig?.mdm.enabled_and_configured && (

View File

@ -4,11 +4,13 @@
}
}
// styles specific to DeviceUserPage
// for styles that should apply to both DeviceUserPage and HostDetailsPage (most of them),
// update frontend/pages/hosts/details/_styles.scss/ `.host-details, .device-user {...}`
.device-user {
justify-content: flex-start;
padding-bottom: 50px;
min-width: 0;
padding: $pad-xlarge;
.info-banner {
&__cta {

View File

@ -1,8 +1,5 @@
.edit-query-page {
@include page;
.body-wrap {
min-width: 0;
}
&__warning {
padding: $pad-medium;

View File

@ -1,7 +1,4 @@
.run-query-page {
.body-wrap {
min-width: 0;
}
&__results {
display: flex;
flex-grow: 1;

View File

@ -67,11 +67,6 @@ b {
}
}
.body-wrap {
border-radius: 3px;
background-color: $core-white;
}
.has-sidebar {
display: flex;
flex-grow: 1;