-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create automatic install policies for fleet-maintained apps (#2…
…4298) > Related issue: #22077 # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
- Loading branch information
Showing
45 changed files
with
1,155 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Adds functionality for creating an automatic install policy for Fleet-maintained apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from "react"; | ||
import classnames from "classnames"; | ||
|
||
import Icon from "components/Icon"; | ||
import { IconNames } from "components/icons"; | ||
|
||
const baseClass = "tag"; | ||
|
||
interface ITagProps { | ||
icon: IconNames; | ||
text: string; | ||
className?: string; | ||
onClick?: () => void; | ||
} | ||
|
||
const Tag = ({ icon, text, className, onClick }: ITagProps) => { | ||
const classNames = classnames( | ||
baseClass, | ||
className, | ||
onClick && `${baseClass}__clickable-tag` | ||
); | ||
|
||
const content = ( | ||
<> | ||
<Icon name={icon} size="small" color="ui-fleet-black-75" /> | ||
<span className={`${baseClass}__text`}>{text}</span> | ||
</> | ||
); | ||
|
||
return onClick ? ( | ||
// use a button element so that the tag can be focused and clicked | ||
// with the keyboard | ||
<button className={classNames} onClick={onClick}> | ||
{content} | ||
</button> | ||
) : ( | ||
<div className={classNames}>{content}</div> | ||
); | ||
}; | ||
|
||
export default Tag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.tag { | ||
display: flex; | ||
height: 18px; | ||
padding: 3px 6px; | ||
align-items: center; | ||
gap: $pad-xsmall; | ||
border-radius: $border-radius; | ||
border: 1px solid $ui-fleet-black-10; | ||
color: $ui-fleet-black-75; | ||
font-size: $xx-small; | ||
font-weight: $bold; | ||
white-space: nowrap; | ||
|
||
// styles to override the default <button> element styles for the tag | ||
// when it is clickable | ||
&__clickable-tag { | ||
background: none; | ||
cursor: pointer; | ||
outline: inherit; | ||
box-sizing: inherit; | ||
|
||
&:focus { | ||
// this is defined in the Button component styles | ||
@include button-focus-outline; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./Tag"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.