Forward card

master
Tudor Stanciu 2021-05-16 04:17:04 +03:00
parent c71b1925c3
commit 8c9606d683
5 changed files with 66 additions and 15 deletions

View File

@ -36,13 +36,15 @@
"LogRows": "Log rows", "LogRows": "Log rows",
"LogSize": "Log size", "LogSize": "Log size",
"Forwards": { "Forwards": {
"Title": "Forwards", "Title": "Forwards"
"From": "From",
"To": "To"
} }
}, },
"Forward": { "Forward": {
"Title": "Forward from {{from}} to {{to}}", "Title": "Forward {{forwardId}}",
"Label": "Forward",
"Subtitle": "from {{from}} to {{to}}",
"From": "From",
"To": "To",
"Options": { "Options": {
"Title": "Options", "Title": "Options",
"Name": "Name", "Name": "Name",

View File

@ -27,13 +27,15 @@
"LogRows": "Linii log", "LogRows": "Linii log",
"LogSize": "Dimensiune log", "LogSize": "Dimensiune log",
"Forwards": { "Forwards": {
"Title": "Redirectări", "Title": "Redirectări"
"From": "De la",
"To": "Către"
} }
}, },
"Forward": { "Forward": {
"Title": "Redirecționare de la {{from}} către {{to}}", "Title": "Redirecționare {{forwardId}}",
"Label": "Redirecționare",
"Subtitle": "de la {{from}} către {{to}}",
"From": "De la",
"To": "Către",
"Options": { "Options": {
"Title": "Opțiuni", "Title": "Opțiuni",
"Name": "Denumire", "Name": "Denumire",

View File

@ -1,9 +1,27 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import ExpandableCard from "../../../../components/common/ExpandableCard";
import ForwardOptionsAdvancedContainer from "../../options/components/advanced/ForwardOptionsAdvancedContainer"; import ForwardOptionsAdvancedContainer from "../../options/components/advanced/ForwardOptionsAdvancedContainer";
import { useTranslation } from "react-i18next";
import ForwardIcon from "@material-ui/icons/Forward";
import ForwardSummary from "./ForwardSummary";
const ForwardComponent = ({ forward }) => { const ForwardComponent = ({ forward }) => {
return <ForwardOptionsAdvancedContainer optionsId={forward.optionId} />; const { t } = useTranslation();
return (
<>
<ExpandableCard
Icon={<ForwardIcon />}
title={t("Forward.Label", forward)}
subtitle={t("Forward.Subtitle", forward)}
Summary={<ForwardSummary forward={forward} />}
Content={<div>...</div>}
/>
<br />
<ForwardOptionsAdvancedContainer optionsId={forward.optionId} />
</>
);
}; };
ForwardComponent.propTypes = { ForwardComponent.propTypes = {

View File

@ -0,0 +1,33 @@
import React from "react";
import PropTypes from "prop-types";
import { Grid } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import { useTranslation } from "react-i18next";
import styles from "../../../../components/common/styles/gridStyles";
const useStyles = makeStyles(styles);
const ForwardSummary = ({ forward }) => {
const classes = useStyles();
const { t } = useTranslation();
return (
<Grid container>
<Grid item xs={6} sm={3} md={3}>
{`${t("Forward.From")}: `}
<span className={classes.value}>{forward.from}</span>
</Grid>
<Grid item xs={6} sm={3} md={3}>
{`${t("Forward.To")}: `}
<span className={classes.value}>{forward.to}</span>
</Grid>
</Grid>
);
};
ForwardSummary.propTypes = {
forward: PropTypes.object.isRequired
};
export default ForwardSummary;

View File

@ -55,12 +55,8 @@ const SessionForwardsComponent = ({
<TableHead> <TableHead>
<TableRow> <TableRow>
<StyledTableCell /> <StyledTableCell />
<StyledTableCell> <StyledTableCell>{t("Forward.From")}</StyledTableCell>
{t("Session.Forwards.From")} <StyledTableCell>{t("Forward.To")}</StyledTableCell>
</StyledTableCell>
<StyledTableCell>
{t("Session.Forwards.To")}
</StyledTableCell>
<StyledTableCell align="right"> <StyledTableCell align="right">
{t("Forward.Options.Title")} {t("Forward.Options.Title")}
</StyledTableCell> </StyledTableCell>