2022-12-06 20:58:32 +00:00
|
|
|
|
$shadow-width: 40px;
|
|
|
|
|
|
$shadow-transition-width: 10px;
|
|
|
|
|
|
|
2022-04-07 19:12:38 +00:00
|
|
|
|
.data-table-block {
|
2021-02-25 12:05:08 +00:00
|
|
|
|
position: relative;
|
2021-10-18 17:42:54 +00:00
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: 100%;
|
2016-11-21 16:26:58 +00:00
|
|
|
|
|
2021-03-15 11:26:18 +00:00
|
|
|
|
.data-table {
|
2021-02-25 12:05:08 +00:00
|
|
|
|
&__wrapper {
|
2021-05-13 14:30:42 +00:00
|
|
|
|
position: relative;
|
2023-01-05 15:23:27 +00:00
|
|
|
|
border: 1px solid $ui-fleet-black-10;
|
2021-02-25 12:05:08 +00:00
|
|
|
|
border-radius: 6px;
|
2021-10-18 17:42:54 +00:00
|
|
|
|
flex-grow: 1;
|
|
|
|
|
|
width: 100%;
|
2022-12-06 20:58:32 +00:00
|
|
|
|
|
|
|
|
|
|
// Shadow
|
2023-01-05 15:23:27 +00:00
|
|
|
|
background-image:
|
2022-12-06 20:58:32 +00:00
|
|
|
|
/* Shadows */ linear-gradient(
|
|
|
|
|
|
to right,
|
|
|
|
|
|
white,
|
|
|
|
|
|
$transparent
|
|
|
|
|
|
),
|
|
|
|
|
|
linear-gradient(to left, white, $transparent),
|
|
|
|
|
|
/* Shadow covers */
|
|
|
|
|
|
linear-gradient(to right, $ui-shadow, white $shadow-transition-width),
|
|
|
|
|
|
linear-gradient(to left, $ui-shadow, white $shadow-transition-width);
|
|
|
|
|
|
|
|
|
|
|
|
background-position: left center, right center, left center, right center;
|
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
background-size: $shadow-width 100%, $shadow-width 100%, 50% 100%,
|
|
|
|
|
|
50% 100%;
|
|
|
|
|
|
|
|
|
|
|
|
/* Opera doesn't support this in the shorthand */
|
|
|
|
|
|
background-attachment: local, local, scroll, scroll;
|
|
|
|
|
|
// End shadow
|
2021-02-25 12:05:08 +00:00
|
|
|
|
}
|
2024-10-17 14:01:23 +00:00
|
|
|
|
|
2024-08-21 20:12:42 +00:00
|
|
|
|
// applied to same element as data-table__table while loading
|
|
|
|
|
|
&__no-rows {
|
|
|
|
|
|
min-height: 272px;
|
|
|
|
|
|
}
|
2020-11-24 16:59:03 +00:00
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
&__table {
|
2021-05-13 14:30:42 +00:00
|
|
|
|
position: relative;
|
2021-02-25 12:05:08 +00:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
border-collapse: collapse;
|
2025-09-29 17:10:41 +00:00
|
|
|
|
color: $ui-fleet-black-75;
|
2021-02-25 12:05:08 +00:00
|
|
|
|
font-size: $x-small;
|
2022-11-30 14:20:16 +00:00
|
|
|
|
}
|
2022-11-28 14:56:34 +00:00
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
tr {
|
2023-01-05 15:23:27 +00:00
|
|
|
|
border-bottom: 1px solid $ui-fleet-black-10;
|
2016-11-21 16:26:58 +00:00
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
&:last-child {
|
|
|
|
|
|
border-bottom: 0;
|
|
|
|
|
|
}
|
2021-05-13 14:30:42 +00:00
|
|
|
|
|
|
|
|
|
|
// override styles of checkbox data cells
|
|
|
|
|
|
.form-field--checkbox {
|
2022-04-07 19:12:38 +00:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
2021-05-13 14:30:42 +00:00
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
2021-08-10 18:25:34 +00:00
|
|
|
|
.fleet-checkbox__label {
|
2021-05-13 14:30:42 +00:00
|
|
|
|
padding-left: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-17 14:01:23 +00:00
|
|
|
|
|
|
|
|
|
|
// Cleaner when tabbing
|
|
|
|
|
|
a:focus-visible {
|
|
|
|
|
|
outline-offset: 0;
|
|
|
|
|
|
border-radius: $border-radius-medium;
|
|
|
|
|
|
}
|
2016-11-21 16:26:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
thead {
|
2022-12-06 20:58:32 +00:00
|
|
|
|
background-color: $ui-off-white-opaque; // opaque needed for horizontal scroll shadow
|
2021-04-09 19:04:11 +00:00
|
|
|
|
color: $core-fleet-black;
|
2021-02-25 12:05:08 +00:00
|
|
|
|
text-align: left;
|
2023-01-05 15:23:27 +00:00
|
|
|
|
border-bottom: 1px solid $ui-fleet-black-10;
|
2016-11-21 16:26:58 +00:00
|
|
|
|
|
2021-11-17 18:08:00 +00:00
|
|
|
|
// resize header icons
|
2021-11-03 17:13:58 +00:00
|
|
|
|
img {
|
|
|
|
|
|
width: 16px;
|
|
|
|
|
|
height: 16px;
|
2022-02-15 16:19:01 +00:00
|
|
|
|
vertical-align: top;
|
2021-11-03 17:13:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-17 18:08:00 +00:00
|
|
|
|
// do not resize button icons inside headers
|
|
|
|
|
|
.button {
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: initial;
|
|
|
|
|
|
height: initial;
|
|
|
|
|
|
vertical-align: initial;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
th {
|
2025-11-06 20:31:14 +00:00
|
|
|
|
padding: 0 $table-cell-padding;
|
2021-02-25 12:05:08 +00:00
|
|
|
|
white-space: nowrap;
|
2025-01-24 15:06:49 +00:00
|
|
|
|
border-left: 1px solid $ui-fleet-black-10;
|
2023-05-23 21:24:01 +00:00
|
|
|
|
font-weight: $bold;
|
2026-03-06 23:41:28 +00:00
|
|
|
|
font-size: $xx-small;
|
2025-09-29 17:10:41 +00:00
|
|
|
|
height: 40px; // Match body row height
|
2016-11-21 16:26:58 +00:00
|
|
|
|
|
2021-08-03 20:09:01 +00:00
|
|
|
|
&:first-child {
|
|
|
|
|
|
border-top-left-radius: 6px;
|
2025-01-24 15:06:49 +00:00
|
|
|
|
border-left: none;
|
2021-08-03 20:09:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 20:31:14 +00:00
|
|
|
|
&.selection__header,
|
|
|
|
|
|
&.active-selection__checkbox {
|
|
|
|
|
|
width: 16px;
|
2025-09-29 17:10:41 +00:00
|
|
|
|
padding: 0 $pad-medium;
|
2021-08-03 20:09:01 +00:00
|
|
|
|
}
|
2021-08-10 18:25:34 +00:00
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
&:last-child {
|
2021-08-03 20:09:01 +00:00
|
|
|
|
border-top-right-radius: 6px;
|
2021-02-25 12:05:08 +00:00
|
|
|
|
}
|
2023-04-27 15:53:30 +00:00
|
|
|
|
|
2025-01-24 15:06:49 +00:00
|
|
|
|
&.actions__header,
|
2025-09-29 17:10:41 +00:00
|
|
|
|
&.id__header // Same as actions__header on some pages
|
2025-01-24 15:06:49 +00:00
|
|
|
|
{
|
|
|
|
|
|
border-left: none;
|
|
|
|
|
|
width: 99px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.linkToFilteredHosts__header,
|
|
|
|
|
|
&.view-all-hosts__header // Same as linkToFilteredHosts__header on some pages
|
|
|
|
|
|
{
|
|
|
|
|
|
border-left: none;
|
2025-02-04 19:05:22 +00:00
|
|
|
|
width: 120px;
|
2025-01-24 15:06:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-27 15:53:30 +00:00
|
|
|
|
.column-header {
|
2025-09-29 17:10:41 +00:00
|
|
|
|
display: flex;
|
2025-10-17 17:46:46 +00:00
|
|
|
|
flex-direction: column; // Filters under header name
|
2025-09-29 17:10:41 +00:00
|
|
|
|
min-width: max-content;
|
2026-01-31 19:24:55 +00:00
|
|
|
|
font-weight: $bold;
|
2025-09-29 17:10:41 +00:00
|
|
|
|
|
2023-04-27 15:53:30 +00:00
|
|
|
|
span {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 3px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-09-29 17:10:41 +00:00
|
|
|
|
|
|
|
|
|
|
.header-cell {
|
|
|
|
|
|
font-weight: $bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Sort arrows change color on hover
|
|
|
|
|
|
.sortable-header {
|
2025-10-17 17:46:46 +00:00
|
|
|
|
.column-header {
|
|
|
|
|
|
.header-cell {
|
2026-01-14 15:54:09 +00:00
|
|
|
|
min-height: 32px; // Leave room for outline on keyboard focus
|
2025-10-17 17:46:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-02 13:35:34 +00:00
|
|
|
|
|
2025-09-29 17:10:41 +00:00
|
|
|
|
&:hover {
|
|
|
|
|
|
.header-cell:not(.ascending) {
|
|
|
|
|
|
.ascending-arrow {
|
|
|
|
|
|
border-bottom-color: $ui-fleet-black-50;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.header-cell.ascending {
|
|
|
|
|
|
.descending-arrow {
|
|
|
|
|
|
border-top-color: $ui-fleet-black-50;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-02-25 12:05:08 +00:00
|
|
|
|
}
|
2021-11-12 21:51:47 +00:00
|
|
|
|
|
2022-03-31 21:10:11 +00:00
|
|
|
|
&.active-selection {
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
th {
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
}
|
2021-11-12 21:51:47 +00:00
|
|
|
|
.fleet-checkbox {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
}
|
2022-03-31 21:10:11 +00:00
|
|
|
|
.active-selection__container {
|
|
|
|
|
|
background-color: $ui-off-white;
|
|
|
|
|
|
width: 100% !important; // Too much specificity currently at page-level styling. Revisit after data table CSS update to remove !important.
|
|
|
|
|
|
.active-selection__inner {
|
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-11-12 21:51:47 +00:00
|
|
|
|
}
|
2021-02-25 12:05:08 +00:00
|
|
|
|
}
|
2016-11-21 16:26:58 +00:00
|
|
|
|
|
2021-05-13 14:30:42 +00:00
|
|
|
|
.active-selection {
|
|
|
|
|
|
position: absolute;
|
2021-07-26 18:41:36 +00:00
|
|
|
|
top: 0px;
|
2021-05-13 14:30:42 +00:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
border: 0;
|
2021-07-29 19:47:04 +00:00
|
|
|
|
border-radius: 6px;
|
2021-05-13 14:30:42 +00:00
|
|
|
|
|
2022-04-07 19:12:38 +00:00
|
|
|
|
&__checkbox {
|
2025-09-29 17:10:41 +00:00
|
|
|
|
width: 16px;
|
2022-04-07 19:12:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-13 14:30:42 +00:00
|
|
|
|
&__container {
|
2025-11-06 20:31:14 +00:00
|
|
|
|
padding: 0 $table-cell-padding;
|
2021-05-13 14:30:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&__inner {
|
|
|
|
|
|
display: flex;
|
2021-07-10 17:29:27 +00:00
|
|
|
|
justify-content: space-between;
|
2021-05-13 14:30:42 +00:00
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
|
margin: 0 $pad-medium 0 0;
|
|
|
|
|
|
font-weight: $regular;
|
|
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
|
font-weight: $bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
button {
|
|
|
|
|
|
margin-right: $pad-medium;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-07-15 17:02:58 +00:00
|
|
|
|
|
2021-07-10 17:29:27 +00:00
|
|
|
|
&__inner-left,
|
|
|
|
|
|
&__inner-right {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
2021-05-13 14:30:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
tbody {
|
2024-08-21 20:12:42 +00:00
|
|
|
|
.component__tooltip-wrapper {
|
|
|
|
|
|
margin: 10px 0; // vertical padding multiline text with tooltip
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.component__tooltip-wrapper__element {
|
|
|
|
|
|
white-space: initial; // wraps long text with tooltip
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tr,
|
|
|
|
|
|
.single-row {
|
|
|
|
|
|
transition: background-color 150ms ease-out;
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background-color: $ui-off-white-opaque; // opaque needed for horizontal scroll shadow
|
|
|
|
|
|
}
|
2024-12-18 15:12:27 +00:00
|
|
|
|
&:focus-visible {
|
2025-09-29 17:10:41 +00:00
|
|
|
|
outline: 2px solid $core-focused-outline;
|
2024-12-18 15:12:27 +00:00
|
|
|
|
background: $ui-off-white;
|
2025-09-29 17:10:41 +00:00
|
|
|
|
border-radius: $border-radius;
|
2024-12-18 15:12:27 +00:00
|
|
|
|
}
|
2024-08-21 20:12:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.single-row {
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
&:active {
|
|
|
|
|
|
background-color: $ui-vibrant-blue-10-opaque; // opaque needed for horizontal scroll shadow
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-04 19:05:22 +00:00
|
|
|
|
.clickable-row {
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-25 12:05:08 +00:00
|
|
|
|
td {
|
2021-07-05 19:26:38 +00:00
|
|
|
|
height: 40px;
|
2025-11-06 20:31:14 +00:00
|
|
|
|
padding: 0 $table-cell-padding;
|
2023-11-10 21:31:11 +00:00
|
|
|
|
max-width: 500px;
|
|
|
|
|
|
word-wrap: break-word;
|
2021-04-09 10:44:57 +00:00
|
|
|
|
|
2025-01-24 15:06:49 +00:00
|
|
|
|
&.actions__cell,
|
|
|
|
|
|
&.id__cell // Same as actions__cell on some pages
|
|
|
|
|
|
{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: end; // Aligns actions dropdown to right of table
|
|
|
|
|
|
max-width: 99px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.linkToFilteredHosts__cell,
|
|
|
|
|
|
&.view-all-hosts__cell // Same as linkToFilteredHosts__cell on some pages
|
|
|
|
|
|
{
|
2024-02-08 13:54:00 +00:00
|
|
|
|
text-align: right;
|
2025-01-24 15:06:49 +00:00
|
|
|
|
max-width: 140px;
|
2025-10-01 19:38:45 +00:00
|
|
|
|
// display: flex causes layout issues on /software/vulnerabilities table
|
2025-09-29 17:10:41 +00:00
|
|
|
|
align-items: center;
|
2024-02-08 13:54:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-07 19:12:38 +00:00
|
|
|
|
&.selection__cell {
|
|
|
|
|
|
width: 0px;
|
|
|
|
|
|
padding: 0 $pad-medium;
|
2021-10-27 21:19:23 +00:00
|
|
|
|
}
|
2022-04-07 19:12:38 +00:00
|
|
|
|
.link-cell,
|
|
|
|
|
|
.text-cell {
|
2023-09-22 14:48:21 +00:00
|
|
|
|
display: block; // inline-block is not vertically centered
|
2025-10-15 23:01:23 +00:00
|
|
|
|
overflow: hidden;
|
2022-04-07 19:12:38 +00:00
|
|
|
|
white-space: nowrap;
|
2023-08-10 13:27:54 +00:00
|
|
|
|
text-overflow: ellipsis;
|
2021-04-09 10:44:57 +00:00
|
|
|
|
margin: 0;
|
UI: Merge scheduling functionality into queries page (#12713)
## Addresses #12636
### See issue for list work done


### Notes for review:
- Because other work is based on this branch, TODOs / fixes are noted
here until the team comes to a strategy for merging all of the work:
- Add missing space in the Performance impact column "Undetermined"
tooltip text
- I'm having trouble confirming that the inherited queries table is
working right with the mock hard-coded data, though I did see it working
correctly previously. There's an issue with the page reverting to "All
teams" when trying to show the inherited table, though it does show the
table before re-rendering.
- This work is organized clearly by commit, so that might be a
manageable way to go through this code.
- Since the updated API for this work is not yet complete, this work can
be manually tested by either:
- Using mock API infrastructure, or
- in `ManageQueriesPage.tsx`, comment out the two `useQuery` calls and
add appropriate mock data. You can then modify any fields of interest to
test their related UI functionality. For example, lines 119 -242 might
read:
```
// const {
// data: curTeamEnhancedQueries,
// error: curTeamQueriesError,
// isFetching: isFetchingCurTeamQueries,
// refetch: refetchCurTeamQueries,
// } = useQuery<IListQueriesResponse, Error, IEnhancedQuery[]>(
// [{ scope: "queries", teamId: teamIdForApi }],
// () => queriesAPI.loadAll(teamIdForApi),
// {
// refetchOnWindowFocus: false,
// enabled: isRouteOk,
// select: (data) => data.queries.map(enhanceQuery),
// }
// );
// // If a team is selected, fetch inherited global queries as well
// const {
// data: globalEnhancedQueries,
// error: globalQueriesError,
// isFetching: isFetchingGlobalQueries,
// refetch: refetchGlobalQueries,
// } = useQuery<IListQueriesResponse, Error, IEnhancedQuery[]>(
// [{ scope: "queries", teamId: -1 }],
// () => queriesAPI.loadAll(),
// {
// refetchOnWindowFocus: false,
// enabled: isRouteOk && isAnyTeamSelected,
// select: (data) => data.queries.map(enhanceQuery),
// }
// );
const [
curTeamEnhancedQueries,
curTeamQueriesError,
isFetchingCurTeamQueries,
refetchCurTeamQueries,
] = useMemo(() => {
return [
[
{
created_at: "2023-06-08T15:31:35Z",
updated_at: "2023-06-08T15:31:35Z",
id: 2,
name: "test",
description: "",
query: "SELECT * FROM osquery_info;",
team_id: 43,
platform: "darwin",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
// interval: 300,
interval: 0,
observer_can_run: false,
author_id: 1,
author_name: "Jacob",
author_email: "jacob@fleetdm.com",
packs: [],
stats: {
// system_time_p50: 1,
// system_time_p95: null,
// user_time_p50: 1,
// user_time_p95: null,
// total_executions: 1,
},
performance: "Undetermined",
platforms: ["darwin"],
},
] as IEnhancedQuery[],
undefined,
false,
() => {
console.log("got the new queries");
},
];
}, []);
const [
globalEnhancedQueries,
globalQueriesError,
isFetchingGlobalQueries,
refetchGlobalQueries,
] = useMemo(() => {
return [
[
{
created_at: "2023-06-08T15:31:35Z",
updated_at: "2023-06-08T15:31:35Z",
id: 200,
name: "test",
description: "",
query: "SELECT * FROM osquery_info;",
team_id: null,
platform: "darwin",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
// interval: 300,
interval: 0,
observer_can_run: false,
author_id: 1,
author_name: "Jacob",
author_email: "jacob@fleetdm.com",
packs: [],
stats: {
// system_time_p50: 1,
// system_time_p95: null,
// user_time_p50: 1,
// user_time_p95: null,
// total_executions: 1,
},
performance: "Undetermined",
platforms: ["darwin"],
},
] as IEnhancedQuery[],
undefined,
false,
() => {
console.log("got the new inherited queries");
},
];
}, []);
```
- [x] Changes file added for user-visible changes in `changes/`
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-07-13 19:11:11 +00:00
|
|
|
|
.__react_component_tooltip {
|
|
|
|
|
|
white-space: normal;
|
|
|
|
|
|
}
|
2021-04-09 10:44:57 +00:00
|
|
|
|
}
|
2025-09-29 17:10:41 +00:00
|
|
|
|
|
|
|
|
|
|
// Caution: LinkCell depends on this to have animation only under text and not icons etc
|
2023-08-22 13:20:40 +00:00
|
|
|
|
.link-cell {
|
2025-09-29 17:10:41 +00:00
|
|
|
|
display: inline-block; // Underline only words
|
|
|
|
|
|
overflow: visible;
|
|
|
|
|
|
@include link;
|
2023-08-22 13:20:40 +00:00
|
|
|
|
|
2025-09-29 17:10:41 +00:00
|
|
|
|
&:not(.link-cell--tooltip-truncate) {
|
|
|
|
|
|
@include animated-bottom-border;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.link-cell--tooltip-truncate {
|
2026-03-17 14:26:53 +00:00
|
|
|
|
min-width: 100%; // Take up as much of cell as possible
|
|
|
|
|
|
|
2025-09-29 17:10:41 +00:00
|
|
|
|
.data-table__tooltip-truncated-text-container {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
@include bottom-border;
|
2025-04-10 19:42:10 +00:00
|
|
|
|
}
|
2025-09-29 17:10:41 +00:00
|
|
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
|
|
&:focus {
|
|
|
|
|
|
margin-bottom: 0; // Undo margin-bottom of animated bottom border
|
|
|
|
|
|
|
|
|
|
|
|
.data-table__tooltip-truncated-text::after,
|
|
|
|
|
|
.data-table__tooltip-truncated-text::after {
|
|
|
|
|
|
transform: scaleX(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
.data-table__tooltip-truncated-text-container {
|
|
|
|
|
|
@include animated-bottom-border;
|
2025-09-30 17:30:44 +00:00
|
|
|
|
margin-bottom: 0; // Undo margin-bottom of animated bottom border
|
2025-09-29 17:10:41 +00:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
margin-bottom: 0; // Undo margin-bottom of animated bottom border
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
|
|
transform: scaleX(
|
|
|
|
|
|
1
|
|
|
|
|
|
); // This gets the animation on the text only when hovering over the whole link-cell
|
|
|
|
|
|
}
|
2025-04-10 19:42:10 +00:00
|
|
|
|
}
|
2023-08-22 13:20:40 +00:00
|
|
|
|
}
|
2025-04-10 19:42:10 +00:00
|
|
|
|
|
2023-08-22 13:20:40 +00:00
|
|
|
|
> div {
|
2025-04-10 19:42:10 +00:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: $pad-small;
|
2023-08-22 13:20:40 +00:00
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
2025-04-10 19:42:10 +00:00
|
|
|
|
.truncated-tooltip {
|
|
|
|
|
|
font-weight: $regular;
|
|
|
|
|
|
}
|
2023-08-22 13:20:40 +00:00
|
|
|
|
}
|
2025-04-10 19:42:10 +00:00
|
|
|
|
|
2023-08-22 13:20:40 +00:00
|
|
|
|
// css to properly style link-cell with tooltip
|
2023-09-13 17:19:56 +00:00
|
|
|
|
.link-cell-tooltip-wrapper {
|
2023-08-22 13:20:40 +00:00
|
|
|
|
overflow: visible; // fixes tooltip overflow cut off by cell
|
2023-09-13 17:19:56 +00:00
|
|
|
|
white-space: nowrap; // single line
|
|
|
|
|
|
margin: 0; // padding applied to .link-cell for larger clickable area
|
2023-08-22 13:20:40 +00:00
|
|
|
|
.component__tooltip-wrapper {
|
2023-09-13 17:19:56 +00:00
|
|
|
|
&__element {
|
2023-08-22 13:20:40 +00:00
|
|
|
|
display: block;
|
|
|
|
|
|
white-space: nowrap; // single line
|
|
|
|
|
|
text-overflow: ellipsis; // truncates text
|
|
|
|
|
|
overflow: hidden;
|
2023-09-13 17:19:56 +00:00
|
|
|
|
// TODO – this naming is now confusing, as this .link-cell is not the outermost layer of
|
|
|
|
|
|
// the cell – it's a NameCell
|
|
|
|
|
|
.link-cell {
|
2023-11-07 21:15:49 +00:00
|
|
|
|
padding: 0;
|
2023-08-22 13:20:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-09-13 17:19:56 +00:00
|
|
|
|
|
|
|
|
|
|
&__tip-text {
|
|
|
|
|
|
cursor: auto;
|
|
|
|
|
|
}
|
2023-08-22 13:20:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-04-07 19:12:38 +00:00
|
|
|
|
.w400 {
|
2025-03-10 18:02:13 +00:00
|
|
|
|
max-width: 352px; // 400px - 48px padding
|
2022-07-25 20:26:52 +00:00
|
|
|
|
min-width: 100%;
|
|
|
|
|
|
text-align: left;
|
2022-04-07 19:12:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
.w250 {
|
2025-03-10 18:02:13 +00:00
|
|
|
|
max-width: 202px; // 250px - 48px padding
|
|
|
|
|
|
min-width: 100%;
|
|
|
|
|
|
text-align: left;
|
|
|
|
|
|
}
|
|
|
|
|
|
.w150 {
|
|
|
|
|
|
max-width: 102px; // 250px - 48px padding
|
2022-07-25 20:26:52 +00:00
|
|
|
|
min-width: 100%;
|
|
|
|
|
|
text-align: left;
|
2021-04-09 10:44:57 +00:00
|
|
|
|
}
|
2024-07-03 16:40:03 +00:00
|
|
|
|
.italic-cell {
|
2022-08-15 22:47:07 +00:00
|
|
|
|
font-style: italic;
|
UI: Merge scheduling functionality into queries page (#12713)
## Addresses #12636
### See issue for list work done


### Notes for review:
- Because other work is based on this branch, TODOs / fixes are noted
here until the team comes to a strategy for merging all of the work:
- Add missing space in the Performance impact column "Undetermined"
tooltip text
- I'm having trouble confirming that the inherited queries table is
working right with the mock hard-coded data, though I did see it working
correctly previously. There's an issue with the page reverting to "All
teams" when trying to show the inherited table, though it does show the
table before re-rendering.
- This work is organized clearly by commit, so that might be a
manageable way to go through this code.
- Since the updated API for this work is not yet complete, this work can
be manually tested by either:
- Using mock API infrastructure, or
- in `ManageQueriesPage.tsx`, comment out the two `useQuery` calls and
add appropriate mock data. You can then modify any fields of interest to
test their related UI functionality. For example, lines 119 -242 might
read:
```
// const {
// data: curTeamEnhancedQueries,
// error: curTeamQueriesError,
// isFetching: isFetchingCurTeamQueries,
// refetch: refetchCurTeamQueries,
// } = useQuery<IListQueriesResponse, Error, IEnhancedQuery[]>(
// [{ scope: "queries", teamId: teamIdForApi }],
// () => queriesAPI.loadAll(teamIdForApi),
// {
// refetchOnWindowFocus: false,
// enabled: isRouteOk,
// select: (data) => data.queries.map(enhanceQuery),
// }
// );
// // If a team is selected, fetch inherited global queries as well
// const {
// data: globalEnhancedQueries,
// error: globalQueriesError,
// isFetching: isFetchingGlobalQueries,
// refetch: refetchGlobalQueries,
// } = useQuery<IListQueriesResponse, Error, IEnhancedQuery[]>(
// [{ scope: "queries", teamId: -1 }],
// () => queriesAPI.loadAll(),
// {
// refetchOnWindowFocus: false,
// enabled: isRouteOk && isAnyTeamSelected,
// select: (data) => data.queries.map(enhanceQuery),
// }
// );
const [
curTeamEnhancedQueries,
curTeamQueriesError,
isFetchingCurTeamQueries,
refetchCurTeamQueries,
] = useMemo(() => {
return [
[
{
created_at: "2023-06-08T15:31:35Z",
updated_at: "2023-06-08T15:31:35Z",
id: 2,
name: "test",
description: "",
query: "SELECT * FROM osquery_info;",
team_id: 43,
platform: "darwin",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
// interval: 300,
interval: 0,
observer_can_run: false,
author_id: 1,
author_name: "Jacob",
author_email: "jacob@fleetdm.com",
packs: [],
stats: {
// system_time_p50: 1,
// system_time_p95: null,
// user_time_p50: 1,
// user_time_p95: null,
// total_executions: 1,
},
performance: "Undetermined",
platforms: ["darwin"],
},
] as IEnhancedQuery[],
undefined,
false,
() => {
console.log("got the new queries");
},
];
}, []);
const [
globalEnhancedQueries,
globalQueriesError,
isFetchingGlobalQueries,
refetchGlobalQueries,
] = useMemo(() => {
return [
[
{
created_at: "2023-06-08T15:31:35Z",
updated_at: "2023-06-08T15:31:35Z",
id: 200,
name: "test",
description: "",
query: "SELECT * FROM osquery_info;",
team_id: null,
platform: "darwin",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
// interval: 300,
interval: 0,
observer_can_run: false,
author_id: 1,
author_name: "Jacob",
author_email: "jacob@fleetdm.com",
packs: [],
stats: {
// system_time_p50: 1,
// system_time_p95: null,
// user_time_p50: 1,
// user_time_p95: null,
// total_executions: 1,
},
performance: "Undetermined",
platforms: ["darwin"],
},
] as IEnhancedQuery[],
undefined,
false,
() => {
console.log("got the new inherited queries");
},
];
}, []);
```
- [x] Changes file added for user-visible changes in `changes/`
- [x] Manual QA for all new/changed functionality
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-07-13 19:11:11 +00:00
|
|
|
|
.__react_component_tooltip {
|
|
|
|
|
|
font-style: normal;
|
|
|
|
|
|
}
|
2022-08-15 22:47:07 +00:00
|
|
|
|
}
|
2024-07-03 16:40:03 +00:00
|
|
|
|
.grey-cell {
|
|
|
|
|
|
color: $ui-fleet-black-50;
|
|
|
|
|
|
}
|
2020-12-19 01:36:39 +00:00
|
|
|
|
}
|
2022-12-06 20:58:32 +00:00
|
|
|
|
|
2022-11-02 18:18:08 +00:00
|
|
|
|
.disable-highlight:hover {
|
|
|
|
|
|
background-color: initial;
|
|
|
|
|
|
}
|
2021-10-22 20:05:49 +00:00
|
|
|
|
}
|
2021-10-18 17:42:54 +00:00
|
|
|
|
}
|
2022-04-07 19:12:38 +00:00
|
|
|
|
|
2021-10-18 17:42:54 +00:00
|
|
|
|
.loading-overlay {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
background-color: rgba(255, 255, 255, 0.8);
|
|
|
|
|
|
z-index: 1;
|
2016-11-21 16:26:58 +00:00
|
|
|
|
}
|
2021-10-18 19:14:24 +00:00
|
|
|
|
|
2022-01-31 22:24:20 +00:00
|
|
|
|
&__footer {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2025-03-31 15:44:04 +00:00
|
|
|
|
height: 50px; // Match pagination height as pagination is optionally rendered
|
2022-01-31 22:24:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-21 20:12:42 +00:00
|
|
|
|
&__table-help-text {
|
2022-01-31 22:24:20 +00:00
|
|
|
|
font-size: $x-small;
|
|
|
|
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
2016-11-21 16:26:58 +00:00
|
|
|
|
}
|