-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(log-modal): 🎉 update log modal
- Loading branch information
1 parent
7832360
commit c72b1fa
Showing
15 changed files
with
234 additions
and
78 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,41 @@ | ||
name: Docker Image (onpremise-tta-01) | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: onpremise-tta-01 | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract Version from package.json | ||
id: project_version | ||
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" | ||
|
||
- name: Build the Docker Image | ||
run: | | ||
docker build \ | ||
--file Dockerfile \ | ||
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-tta-01 \ | ||
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \ | ||
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \ | ||
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \ | ||
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \ | ||
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \ | ||
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \ | ||
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \ | ||
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \ | ||
. | ||
- name: Login to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Push the Docker Image to Docker Hub | ||
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-tta-01 |
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 |
---|---|---|
@@ -1,53 +1,62 @@ | ||
import CreateRobotFormAddButton from "../CreateRobotFormAddButton/CreateRobotFormAddButton"; | ||
import CFHostDirectoriesInput from "../CFHostDirectoriesInput/CFHostDirectoriesInput"; | ||
import { IDetails } from "../../interfaces/robotInterfaces"; | ||
import { FormikProps } from "formik/dist/types"; | ||
import CFInfoBar from "../CFInfoBar/CFInfoBar"; | ||
import { ReactElement } from "react"; | ||
import { ReactElement, useEffect, useState } from "react"; | ||
import useFunctions from "../../hooks/useFunctions"; | ||
import Select from "react-select"; | ||
|
||
interface ICFHostDirectories { | ||
formik: FormikProps<IDetails>; | ||
disabled?: boolean; | ||
} | ||
export default function CFHostDirectories(): ReactElement { | ||
const [menuIsOpen, setMenuIsOpen] = useState<boolean>(false); | ||
const [selectableItems, setSelectableItems] = useState<string[]>([]); | ||
const [selectedItems, setSelectedItems] = useState<string[]>([]); | ||
const { getFiles } = useFunctions(); | ||
|
||
export default function CFHostDirectories({ | ||
formik, | ||
disabled, | ||
}: ICFHostDirectories): ReactElement { | ||
return ( | ||
<div> | ||
<CFInfoBar | ||
label="Host Directories:" | ||
tip="You can link a directory on the host to the directory specified in the application here." | ||
vertical | ||
> | ||
<div className="flex flex-col gap-2"> | ||
{formik.values.hostDirectories?.map((_, index) => { | ||
return ( | ||
<CFHostDirectoriesInput | ||
key={index} | ||
index={index} | ||
formik={formik} | ||
disabled={disabled} | ||
/> | ||
); | ||
})} | ||
</div> | ||
</CFInfoBar> | ||
useEffect(() => { | ||
handleGetSelectableItems(); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
useEffect(() => { | ||
console.log("selectableItems", selectableItems); | ||
console.log("selectedItems", selectedItems); | ||
}, [selectableItems, selectedItems]); | ||
|
||
async function handleGetSelectableItems(paths?: string[]) { | ||
const { items } = await getFiles(paths || []); | ||
|
||
<CreateRobotFormAddButton | ||
onClick={() => { | ||
formik.setFieldValue("hostDirectories", [ | ||
...formik.values.hostDirectories, | ||
{ | ||
hostDirectory: "", | ||
mountPath: "", | ||
}, | ||
]); | ||
if (items?.length) { | ||
setSelectableItems( | ||
items | ||
?.filter((item: any) => item.isDir) | ||
?.map((item: any) => `/${item.name}`), | ||
); | ||
} else { | ||
setSelectableItems([]); | ||
setMenuIsOpen(false); | ||
} | ||
} | ||
|
||
return ( | ||
<> | ||
<Select | ||
menuIsOpen={menuIsOpen} | ||
options={ | ||
selectableItems?.map((item) => ({ | ||
value: item, | ||
label: selectedItems?.join("") || item, | ||
})) || [] | ||
} | ||
onChange={(e) => { | ||
if (e) { | ||
handleGetSelectableItems([...selectedItems, e.value]); | ||
setSelectedItems([...selectedItems, e.value]); | ||
} | ||
}} | ||
onFocus={() => setMenuIsOpen(true)} | ||
onBlur={() => setMenuIsOpen(false)} | ||
value={{ | ||
value: selectedItems?.join("") || "", | ||
label: selectedItems?.join("") || "", | ||
}} | ||
className="!mt-1" | ||
disabled={disabled} | ||
isClearable | ||
/> | ||
</div> | ||
</> | ||
); | ||
} |
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,53 @@ | ||
import CreateRobotFormAddButton from "../CreateRobotFormAddButton/CreateRobotFormAddButton"; | ||
import CFHostDirectoriesInput from "../CFHostDirectoriesInput/CFHostDirectoriesInput"; | ||
import { IDetails } from "../../interfaces/robotInterfaces"; | ||
import { FormikProps } from "formik/dist/types"; | ||
import CFInfoBar from "../CFInfoBar/CFInfoBar"; | ||
import { ReactElement } from "react"; | ||
|
||
interface ICFHostDirectories { | ||
formik: FormikProps<IDetails>; | ||
disabled?: boolean; | ||
} | ||
|
||
export default function CFHostDirectories({ | ||
formik, | ||
disabled, | ||
}: ICFHostDirectories): ReactElement { | ||
return ( | ||
<div> | ||
<CFInfoBar | ||
label="Host Directories:" | ||
tip="You can link a directory on the host to the directory specified in the application here." | ||
vertical | ||
> | ||
<div className="flex flex-col gap-2"> | ||
{formik.values.hostDirectories?.map((_, index) => { | ||
return ( | ||
<CFHostDirectoriesInput | ||
key={index} | ||
index={index} | ||
formik={formik} | ||
disabled={disabled} | ||
/> | ||
); | ||
})} | ||
</div> | ||
</CFInfoBar> | ||
|
||
<CreateRobotFormAddButton | ||
onClick={() => { | ||
formik.setFieldValue("hostDirectories", [ | ||
...formik.values.hostDirectories, | ||
{ | ||
hostDirectory: "", | ||
mountPath: "", | ||
}, | ||
]); | ||
}} | ||
className="!mt-1" | ||
disabled={disabled} | ||
/> | ||
</div> | ||
); | ||
} |
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
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.