mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-25 20:46:13 +00:00
styling added to addworkspacemodal
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
@import '../../../variables.module.scss'
|
||||
|
||||
.workspace__name
|
||||
width: 58%
|
||||
|
||||
.searchNamespace
|
||||
width: 32%
|
||||
|
||||
.headline
|
||||
color: $font-color
|
@@ -1,27 +1,62 @@
|
||||
import React, { FC, useEffect, useState } from 'react';
|
||||
import { useCommonStyles } from '../../../helpers/commonStyle';
|
||||
import ConfirmationModal from '../../UI/Modals/ConfirmationModal';
|
||||
import SelectList from '../../UI/SelectList';
|
||||
import './AddWorkspaceModal.sass'
|
||||
// import './AddUserModal.sass';
|
||||
|
||||
export type WorkspaceData = {
|
||||
name:string;
|
||||
namespaces: string[];
|
||||
}
|
||||
|
||||
interface AddWorkspaceModal {
|
||||
isOpen : boolean,
|
||||
onCloseModal: () => void
|
||||
onCloseModal: () => void,
|
||||
workspaceData: WorkspaceData
|
||||
}
|
||||
|
||||
const AddWorkspaceModal: FC<AddWorkspaceModal> = ({isOpen,onCloseModal,children}) => {
|
||||
const AddWorkspaceModal: FC<AddWorkspaceModal> = ({isOpen,onCloseModal, workspaceData ={}}) => {
|
||||
|
||||
const [isOpenModal,setIsOpen] = useState(isOpen)
|
||||
const [isOpenModal,setIsOpen] = useState(isOpen);
|
||||
const [workspaceDataModel, setUserData] = useState(workspaceData as WorkspaceData);
|
||||
const [searchValue, setSearchValue] = useState("");
|
||||
const classes = useCommonStyles()
|
||||
const [namespaces, SetNamespaces] = useState({})
|
||||
|
||||
useEffect(() => {
|
||||
setIsOpen(isOpen)
|
||||
},[isOpen])
|
||||
|
||||
const onClose = () => {}
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
const namespacesList = {"default": false, "blabla": false, "test":true};
|
||||
SetNamespaces(namespacesList)
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
})();
|
||||
},[])
|
||||
|
||||
const onConfirm = () => {}
|
||||
|
||||
return (<>
|
||||
<ConfirmationModal isOpen={isOpenModal} onClose={onClose} onConfirm={onConfirm} title=''>
|
||||
{children}
|
||||
<ConfirmationModal isOpen={isOpenModal} onClose={onCloseModal} onConfirm={onConfirm} title='Add Workspace'>
|
||||
<h3 className='headline'>DETAILS</h3>
|
||||
<div>
|
||||
<input type="text" value={workspaceDataModel?.name ?? ""} className={classes.textField + " workspace__name"} placeholder={"Workspace Name"}
|
||||
onChange={(e) => {}}></input>
|
||||
</div>
|
||||
<h3 className='headline'>TAP SETTINGS</h3>
|
||||
<div className="namespacesSettingsContainer">
|
||||
<div>
|
||||
<input className={classes.textField + " searchNamespace"} placeholder="Search" value={searchValue}
|
||||
onChange={(event) => setSearchValue(event.target.value)}/>
|
||||
</div>
|
||||
<SelectList valuesListInput={namespaces} tableName={"Namespaces"} multiSelect={true} searchValue={searchValue} setValues={setUserData} tabelClassName={undefined}></SelectList>
|
||||
</div>
|
||||
</ConfirmationModal>
|
||||
</>);
|
||||
};
|
||||
|
@@ -2,7 +2,7 @@ import "../UserSettings/UserSettings.sass"
|
||||
import {ColsType, FilterableTableAction} from "../UI/FilterableTableAction"
|
||||
// import Api from "../../helpers/api"
|
||||
import { useEffect, useState } from "react";
|
||||
import AddWorkspaceModal from "../Modals/AddWorkspaceModal/AddWorkspaceModal";
|
||||
import AddWorkspaceModal, { WorkspaceData } from "../Modals/AddWorkspaceModal/AddWorkspaceModal";
|
||||
import SelectList from "../UI/SelectList";
|
||||
|
||||
interface Props {}
|
||||
@@ -12,11 +12,10 @@ interface Props {}
|
||||
export const WorkspaceSettings : React.FC<Props> = ({}) => {
|
||||
|
||||
const [workspacesRows, setWorkspaces] = useState([]);
|
||||
const [workspaceData,SetWorkspaceData] = useState({} as WorkspaceData);
|
||||
const [isOpenModal,setIsOpen] = useState(false);
|
||||
const cols : ColsType[] = [{field : "id",header:"Id"},{field : "name",header:"Name"}];
|
||||
|
||||
const namespaces = {"default": false, "blabla": false, "test":true};
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
@@ -50,10 +49,8 @@ export const WorkspaceSettings : React.FC<Props> = ({}) => {
|
||||
<FilterableTableAction onRowEdit={onRowEdit} onRowDelete={onRowDelete} searchConfig={searchConfig}
|
||||
buttonConfig={buttonConfig} rows={workspacesRows} cols={cols}>
|
||||
</FilterableTableAction>
|
||||
<AddWorkspaceModal isOpen={isOpenModal} onCloseModal={() => { setIsOpen(false); } }>
|
||||
<SelectList valuesListInput={namespaces} tableName={"Namespaces"} multiSelect={false} setValues={function (newValues: any): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} } tabelClassName={undefined}></SelectList>
|
||||
<AddWorkspaceModal isOpen={isOpenModal} workspaceData={workspaceData} onCloseModal={() => { setIsOpen(false); } } >
|
||||
|
||||
|
||||
</AddWorkspaceModal>
|
||||
</>);
|
||||
|
Reference in New Issue
Block a user