From 59068a0c1985fdee9f51ba29cb64f2e3ddf4b836 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Wed, 7 Jul 2021 18:07:00 +0200 Subject: [PATCH] F OpenNebula/one#5422: Remove unused file --- .../components/Tabs/Common/Permission copy.js | 167 ------------------ 1 file changed, 167 deletions(-) delete mode 100644 src/fireedge/src/client/components/Tabs/Common/Permission copy.js diff --git a/src/fireedge/src/client/components/Tabs/Common/Permission copy.js b/src/fireedge/src/client/components/Tabs/Common/Permission copy.js deleted file mode 100644 index 3e6a5dda7d..0000000000 --- a/src/fireedge/src/client/components/Tabs/Common/Permission copy.js +++ /dev/null @@ -1,167 +0,0 @@ -import React, { memo, useState } from 'react' -import PropTypes from 'prop-types' - -import clsx from 'clsx' -import { List, ListItem, Typography, Grid, Paper, Divider } from '@material-ui/core' -import { - Check as CheckIcon, - Square as BlankSquareIcon, - EyeEmpty as EyeIcon -} from 'iconoir-react' - -import { useProviderApi } from 'client/features/One' -import { Action } from 'client/components/Cards/SelectCard' -import { Tr } from 'client/components/HOC' -import { T } from 'client/constants' - -import useStyles from 'client/containers/Providers/Sections/styles' - -const Info = memo(({ fetchProps }) => { - const classes = useStyles() - const { getProviderConnection } = useProviderApi() - - const [showConnection, setShowConnection] = useState(undefined) - - const { ID, NAME, GNAME, UNAME, PERMISSIONS, TEMPLATE } = fetchProps?.data - const { - connection, - description, - provider: providerName, - registration_time: time - } = TEMPLATE?.PROVISION_BODY - - const hasConnection = connection && Object.keys(connection).length > 0 - - const isChecked = checked => - checked === '1' ? : - - const ConnectionButton = () => ( - } - cy='provider-connection' - handleClick={() => getProviderConnection(ID).then(setShowConnection)} - /> - ) - - return ( - - - - - - {Tr(T.Information)} - - - - {'ID'} - {ID} - - - {Tr(T.Name)} - {NAME} - - - {Tr(T.Description)} - {description} - - - {Tr(T.Provider)} - {providerName} - - - {Tr(T.RegistrationTime)} - - {new Date(time * 1000).toLocaleString()} - - - - - {hasConnection && ( - - - - {Tr(T.Credentials)} - - {!showConnection && } - - - - {Object.entries(connection)?.map(([key, value]) => - typeof value === 'string' && ( - - {key} - - {showConnection?.[key] ?? value} - - - ))} - - - )} - - - - - - {Tr(T.Permissions)} - {Tr(T.Use)} - {Tr(T.Manage)} - {Tr(T.Admin)} - - - - {Tr(T.Owner)} - {isChecked(PERMISSIONS.OWNER_U)} - {isChecked(PERMISSIONS.OWNER_M)} - {isChecked(PERMISSIONS.OWNER_A)} - - - {Tr(T.Group)} - {isChecked(PERMISSIONS.GROUP_U)} - {isChecked(PERMISSIONS.GROUP_M)} - {isChecked(PERMISSIONS.GROUP_A)} - - - {Tr(T.Other)} - {isChecked(PERMISSIONS.OTHER_U)} - {isChecked(PERMISSIONS.OTHER_M)} - {isChecked(PERMISSIONS.OTHER_A)} - - - - - - - {Tr(T.Ownership)} - - - - {Tr(T.Owner)} - {UNAME} - - - {Tr(T.Group)} - {GNAME} - - - - - - ) -}) - -Info.propTypes = { - fetchProps: PropTypes.shape({ - data: PropTypes.object.isRequired - }).isRequired -} - -Info.defaultProps = { - fetchProps: { - data: {} - } -} - -Info.displayName = 'Info' - -export default Info