Skip to content

Commit

Permalink
Add instance admin to instance info table
Browse files Browse the repository at this point in the history
  • Loading branch information
Neloop committed Mar 30, 2019
1 parent d3aac77 commit 880f99e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
16 changes: 14 additions & 2 deletions src/components/Instances/InstanceDetail/InstanceInfoTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Table } from 'react-bootstrap';
import Box from '../../widgets/Box';
import Markdown from '../../widgets/Markdown';
import { getLocalizedDescription } from '../../../helpers/localizedData';
import UsersNameContainer from '../../../containers/UsersNameContainer';

const getDescription = (localizedTexts, locale) => {
const description = getLocalizedDescription({ localizedTexts }, locale);
Expand All @@ -27,6 +28,7 @@ const InstanceInfoTable = ({
hasValidLicence,
isOpen,
isAllowed,
adminId,
rootGroup: { localizedTexts },
},
locale,
Expand All @@ -40,7 +42,16 @@ const InstanceInfoTable = ({
noPadding
unlimitedHeight>
<Table>
<tbody />
<tbody>
<tr>
<th>
<FormattedMessage id="app.instanceDetail.admin" defaultMessage="Instance Admin" />:
</th>
<td>
<UsersNameContainer userId={adminId} />
</td>
</tr>
</tbody>
</Table>
</Box>
</div>
Expand All @@ -52,8 +63,9 @@ InstanceInfoTable.propTypes = {
hasValidLicence: PropTypes.bool.isRequired,
isOpen: PropTypes.bool.isRequired,
isAllowed: PropTypes.bool.isRequired,
adminId: PropTypes.string.isRequired,
rootGroup: PropTypes.shape({
localizedTexts: PropTypes.object.isRequired,
localizedTexts: PropTypes.array.isRequired,
}),
}),
locale: PropTypes.string.isRequired,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Instances/InstancesTable/InstancesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ const InstancesTable = ({ instances, links: { INSTANCE_URI_FACTORY }, intl }) =>
<tbody>
{instances
.sort((a, b) => a.name.localeCompare(b.name, intl.locale))
.map(({ id, name, admin, hasValidLicence }) => (
.map(({ id, name, adminId, hasValidLicence }) => (
<tr key={id}>
<td>
<Link to={INSTANCE_URI_FACTORY(id)}>{name}</Link>
</td>
<td>
<UsersNameContainer userId={admin} />
<UsersNameContainer userId={adminId} />
</td>
<td>
<SuccessOrFailureIcon success={hasValidLicence} />
Expand Down
8 changes: 5 additions & 3 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -801,13 +801,15 @@
"app.homepage.whereToReportBugs": "Kde mohu nahlásit chyby?",
"app.homepage.whereToReportBugsText": "Každé softwarové dílo obsahuje chyby a my jsme si toho vědomi. Čas od času můžete narazit na chybu, kterou nám nikdo před Vámi nereportoval a která dosud nebyla vyřešena. Hlašte nám prosím všechny chyby do issue trackeru na GitHubu - stačí založit novou issue a dát jí tag 'bug'. Budeme se snažit chybu prošetřit a vyřešit a nasadit opravu co nejdříve bude možné.",
"app.instance.description": "Přehled instance",
"app.instance.detailTitle": "Popis instance",
"app.instance.edit": "Úprava instance",
"app.instance.edit": "Upravit instanci",
"app.instance.groups.noGroups": "Žádné skupiny v této instanci pro vás nejsou viditelné.",
"app.instance.groupsTitle": "Hierarchie skupin",
"app.instance.hasValidLicence": "{name} má platnou licenci:",
"app.instance.licencesTitle": "Licence",
"app.instance.title": "Instance",
"app.instanceDetail.admin": "Admin instance",
"app.instanceDetail.description": "Popis instance",
"app.instanceDetail.noDescription": "Instance nemá žádný popis v žádném jazyce.",
"app.instances.description": "Správa všech instancí",
"app.instances.listTitle": "Seznam instancí",
"app.instances.title": "Instance",
Expand Down Expand Up @@ -1193,7 +1195,7 @@
"app.submitSolution.validating": "Předběžná kontrola nahraných souborů...",
"app.sudebar.menu.admin.title": "Administrátor",
"app.supplementaryFiles.deleteConfirm": "Opravdu si přejete tento soubor smazat? Tato operace nemůže být vrácena.",
"app.supplementaryFilesTable.description": "Soubory úlohy jsou soubory, které mohou být použity v nastavení úlohy (jako vstupní soubory, vzorové výstupní soubory, přídavné soubory pro kompilaci, vlastní sudí, ...).",
"app.supplementaryFilesTable.description": "Soubory úlohy jsou soubory, které mohou být použity v nastavení úlohy (jako vstupní soubory, vzorové výstupní soubory, přídavné soubory pro kompilaci, vlastní sudí, ...).",
"app.supplementaryFilesTable.title": "Soubory úlohy",
"app.tabbedArrayField.empty": "Nyní zde nejsou žádné záložky.",
"app.tabbedArrayField.reallyRemoveQuestion": "Opravdu chcete tuto záložku odstranit?",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -801,13 +801,15 @@
"app.homepage.whereToReportBugs": "Where can I report bugs?",
"app.homepage.whereToReportBugsText": "Every software contains bugs and we are well avare of this fact. From time to time you might find a bug that nobody else has reported and which has not been fixed yet. Please report all bugs to our issue tracker on GitHub - just file a new issue and give it a label 'bug'. We will try to investigate and release a bugfix as soon as possible.",
"app.instance.description": "Instance overview",
"app.instance.detailTitle": "Instance Description",
"app.instance.edit": "Edit instance",
"app.instance.groups.noGroups": "There are no groups in this ReCodEx instance currently visible to you",
"app.instance.groupsTitle": "Groups Hierarchy",
"app.instance.hasValidLicence": "{name} has a valid licence:",
"app.instance.licencesTitle": "Licences",
"app.instance.title": "Instance",
"app.instanceDetail.admin": "Instance Admin",
"app.instanceDetail.description": "Instance Description",
"app.instanceDetail.noDescription": "The instance has no description in any language.",
"app.instances.description": "Management of all instances",
"app.instances.listTitle": "List of instances",
"app.instances.title": "Instances",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/whitelist_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -801,13 +801,15 @@
"app.homepage.whereToReportBugs",
"app.homepage.whereToReportBugsText",
"app.instance.description",
"app.instance.detailTitle",
"app.instance.edit",
"app.instance.groups.noGroups",
"app.instance.groupsTitle",
"app.instance.hasValidLicence",
"app.instance.licencesTitle",
"app.instance.title",
"app.instanceDetail.admin",
"app.instanceDetail.description",
"app.instanceDetail.noDescription",
"app.instances.description",
"app.instances.listTitle",
"app.instances.title",
Expand Down
7 changes: 3 additions & 4 deletions src/pages/Instance/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { LinkContainer } from 'react-router-bootstrap';
import { defaultMemoize } from 'reselect';

import Box from '../../components/widgets/Box';
import Markdown from '../../components/widgets/Markdown';
import GroupTree from '../../components/Groups/GroupTree';
import Button from '../../components/widgets/FlatButton';
import Page from '../../components/layout/Page';
Expand Down Expand Up @@ -83,8 +82,8 @@ class Instance extends Component {
]}>
{data => (
<div>
{/* TODO: not editable right now due differences in api and web-app
{isSuperAdmin && (
{/* TODO: not editable right now due differences in api and web-app */}
{false && isSuperAdmin && (
<Row>
<Col sm={12} md={6}>
<p>
Expand All @@ -97,7 +96,7 @@ class Instance extends Component {
</p>
</Col>
</Row>
)} */}
)}

<Row>
<Col sm={12} md={6}>
Expand Down

0 comments on commit 880f99e

Please sign in to comment.