-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For R.C. - 20404: Edit packages feature (#22169)
(This cherry-pick is only of 21812, unreleased bugs found in QA process will be cherry picked separately for trackability on zenhub) > [!NOTE] > This PR is already merged in `main`, see #21812 This is against the release branch so it can be included in 4.57.0 ``` 1106 git fetch fleetdm 1107 git checkout fleetdm/minor-fleet-v4.57.0 1108 git log main 1109 git cherry-pick 1c1ebef 1110 git status 1111 git checkout -b 20404-edit-software-rc 1112 git push -u fleetdm 20404-edit-software-rc ``` --------- Co-authored-by: Ian Littman <[email protected]> Co-authored-by: Luke Heath <[email protected]> Co-authored-by: Jacob Shandling <[email protected]> Co-authored-by: Victor Lyuboslavsky <[email protected]> Co-authored-by: Rachael Shaw <[email protected]>
- Loading branch information
1 parent
5d4e1db
commit 3df9ebd
Showing
49 changed files
with
1,465 additions
and
275 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 @@ | ||
* Software installer packages, self-service flag, scripts, pre-install query, and self-service availability can now be edited in-place rather than needing to be deleted and re-added. |
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,64 @@ | ||
import React from "react"; | ||
|
||
import { ISupportedGraphicNames } from "components/FileUploader/FileUploader"; | ||
import Graphic from "components/Graphic"; | ||
import Button from "components/buttons/Button"; | ||
import Icon from "components/Icon"; | ||
|
||
interface IFileDetailsProps { | ||
graphicNames: ISupportedGraphicNames | ISupportedGraphicNames[]; | ||
fileDetails: { | ||
name: string; | ||
platform?: string; | ||
}; | ||
canEdit: boolean; | ||
onFileSelect: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
accept?: string; | ||
} | ||
|
||
const baseClass = "file-details"; | ||
|
||
const FileDetails = ({ | ||
graphicNames, | ||
fileDetails, | ||
canEdit, | ||
onFileSelect, | ||
accept, | ||
}: IFileDetailsProps) => { | ||
return ( | ||
<div className={baseClass}> | ||
<div className={`${baseClass}__info`}> | ||
<Graphic | ||
name={ | ||
typeof graphicNames === "string" ? graphicNames : graphicNames[0] | ||
} | ||
/> | ||
<div className={`${baseClass}__content`}> | ||
<div className={`${baseClass}__name`}>{fileDetails.name}</div> | ||
{fileDetails.platform && ( | ||
<div className={`${baseClass}__platform`}> | ||
{fileDetails.platform} | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
{canEdit && ( | ||
<div className={`${baseClass}__edit`}> | ||
<Button className={`${baseClass}__edit-button`} variant="icon"> | ||
<label htmlFor="edit-file"> | ||
<Icon name="pencil" color="ui-fleet-black-75" /> | ||
</label> | ||
</Button> | ||
<input | ||
accept={accept} | ||
id="edit-file" | ||
type="file" | ||
onChange={onFileSelect} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default FileDetails; |
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,37 @@ | ||
.file-details { | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
|
||
&__info { | ||
display: flex; | ||
gap: $pad-medium; | ||
align-items: center; | ||
width: 100%; | ||
text-align: left; | ||
} | ||
|
||
&__name { | ||
font-size: $x-small; | ||
font-weight: $bold; | ||
} | ||
|
||
&__platform { | ||
font-size: $xx-small; | ||
color: $ui-fleet-black-75; | ||
} | ||
|
||
&__edit { | ||
display: flex; | ||
align-items: center; // Center the button vertically | ||
margin-right: -$pad-medium; // Adjust for button padding | ||
} | ||
|
||
label { | ||
display: flex; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
} | ||
} |
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 "./FileDetails"; |
Oops, something went wrong.