Translate settings page to danish
This commit is contained in:
parent
84cb8c3c09
commit
12df24f366
|
@ -2,6 +2,14 @@
|
||||||
"albums_page": {
|
"albums_page": {
|
||||||
"title": "Album"
|
"title": "Album"
|
||||||
},
|
},
|
||||||
|
"general": {
|
||||||
|
"action": {
|
||||||
|
"add": "Tilføj",
|
||||||
|
"cancel": "Annuller",
|
||||||
|
"remove": "Slet",
|
||||||
|
"save": "Gem"
|
||||||
|
}
|
||||||
|
},
|
||||||
"loading": {
|
"loading": {
|
||||||
"paginate": {
|
"paginate": {
|
||||||
"media": "Loader flere medier"
|
"media": "Loader flere medier"
|
||||||
|
@ -15,12 +23,12 @@
|
||||||
},
|
},
|
||||||
"initial_setup": {
|
"initial_setup": {
|
||||||
"field": {
|
"field": {
|
||||||
"photo_path": "Billedesti"
|
"photo_path": {
|
||||||
},
|
"label": "Billedesti",
|
||||||
"field-photo_path": {
|
|
||||||
"placeholder": "/sti/til/billeder"
|
"placeholder": "/sti/til/billeder"
|
||||||
},
|
},
|
||||||
"field-submit": "Opsæt Photoview",
|
"submit": "Opsæt Photoview"
|
||||||
|
},
|
||||||
"title": "Førstegangsopsætning"
|
"title": "Førstegangsopsætning"
|
||||||
},
|
},
|
||||||
"welcome": "Velkommen til Photoview"
|
"welcome": "Velkommen til Photoview"
|
||||||
|
@ -49,10 +57,47 @@
|
||||||
"description": "Vil scanne alle brugere for nye eller opdaterede medier",
|
"description": "Vil scanne alle brugere for nye eller opdaterede medier",
|
||||||
"scan_all_users": "Scan alle brugere",
|
"scan_all_users": "Scan alle brugere",
|
||||||
"title": "Scanner"
|
"title": "Scanner"
|
||||||
|
},
|
||||||
|
"users": {
|
||||||
|
"add_user": {
|
||||||
|
"submit": "Tilføj bruger"
|
||||||
|
},
|
||||||
|
"confirm_delete_user": {
|
||||||
|
"action": "Slet {user}",
|
||||||
|
"description": "<0>Er du sikker på at du vil slette <1></1>?</0><p>Denne handling kan ikke fortrydes</p>",
|
||||||
|
"title": "Slet bruger"
|
||||||
|
},
|
||||||
|
"password_reset": {
|
||||||
|
"description": "Ændre adgangskode for <1></1>",
|
||||||
|
"form": {
|
||||||
|
"label": "Ny adgangskode",
|
||||||
|
"placeholder": "adgangskode",
|
||||||
|
"submit": "Ændre adgangskode"
|
||||||
|
},
|
||||||
|
"title": "Ændre adgangskode"
|
||||||
|
},
|
||||||
|
"table": {
|
||||||
|
"column_names": {
|
||||||
|
"action": "Handling",
|
||||||
|
"admin": "Admin",
|
||||||
|
"photo_path": "Billedesti",
|
||||||
|
"username": "Brugernavn"
|
||||||
|
},
|
||||||
|
"new_user": "Ny bruger",
|
||||||
|
"row": {
|
||||||
|
"action": {
|
||||||
|
"change_password": "Ændre adgangskode",
|
||||||
|
"delete": "Slet",
|
||||||
|
"edit": "Rediger",
|
||||||
|
"scan": "Scan"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"title": "Brugere"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidemenu": {
|
"sidemenu": {
|
||||||
"albums": null,
|
"albums": "Albums",
|
||||||
"logout": "Log af",
|
"logout": "Log af",
|
||||||
"people": "Personer",
|
"people": "Personer",
|
||||||
"photos": "Billeder",
|
"photos": "Billeder",
|
||||||
|
|
|
@ -2,6 +2,14 @@
|
||||||
"albums_page": {
|
"albums_page": {
|
||||||
"title": "Albums"
|
"title": "Albums"
|
||||||
},
|
},
|
||||||
|
"general": {
|
||||||
|
"action": {
|
||||||
|
"add": "Add",
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"remove": "Remove",
|
||||||
|
"save": "Save"
|
||||||
|
}
|
||||||
|
},
|
||||||
"loading": {
|
"loading": {
|
||||||
"paginate": {
|
"paginate": {
|
||||||
"media": "Loading more media"
|
"media": "Loading more media"
|
||||||
|
@ -15,12 +23,12 @@
|
||||||
},
|
},
|
||||||
"initial_setup": {
|
"initial_setup": {
|
||||||
"field": {
|
"field": {
|
||||||
"photo_path": "Photo path"
|
"photo_path": {
|
||||||
},
|
"label": "Photo path",
|
||||||
"field-photo_path": {
|
|
||||||
"placeholder": "/path/to/photos"
|
"placeholder": "/path/to/photos"
|
||||||
},
|
},
|
||||||
"field-submit": "Setup Photoview",
|
"submit": "Setup Photoview"
|
||||||
|
},
|
||||||
"title": "Initial Setup"
|
"title": "Initial Setup"
|
||||||
},
|
},
|
||||||
"welcome": "Welcome to Photoview"
|
"welcome": "Welcome to Photoview"
|
||||||
|
@ -49,6 +57,43 @@
|
||||||
"description": "Will scan all users for new or updated media",
|
"description": "Will scan all users for new or updated media",
|
||||||
"scan_all_users": "Scan all users",
|
"scan_all_users": "Scan all users",
|
||||||
"title": "Scanner"
|
"title": "Scanner"
|
||||||
|
},
|
||||||
|
"users": {
|
||||||
|
"add_user": {
|
||||||
|
"submit": "Add user"
|
||||||
|
},
|
||||||
|
"confirm_delete_user": {
|
||||||
|
"action": "Delete {user}",
|
||||||
|
"description": "<0>Are you sure, you want to delete <1></1>?</0><p>This action cannot be undone</p>",
|
||||||
|
"title": "Delete user"
|
||||||
|
},
|
||||||
|
"password_reset": {
|
||||||
|
"description": "Change password for <1></1>",
|
||||||
|
"form": {
|
||||||
|
"label": "New password",
|
||||||
|
"placeholder": "password",
|
||||||
|
"submit": "Change password"
|
||||||
|
},
|
||||||
|
"title": "Change password"
|
||||||
|
},
|
||||||
|
"table": {
|
||||||
|
"column_names": {
|
||||||
|
"action": "Action",
|
||||||
|
"admin": "Admin",
|
||||||
|
"photo_path": "Photo path",
|
||||||
|
"username": "Username"
|
||||||
|
},
|
||||||
|
"new_user": "New user",
|
||||||
|
"row": {
|
||||||
|
"action": {
|
||||||
|
"change_password": "Change password",
|
||||||
|
"delete": "Delete",
|
||||||
|
"edit": "Edit",
|
||||||
|
"scan": "Scan"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"title": "Users"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sidemenu": {
|
"sidemenu": {
|
||||||
|
|
|
@ -111,11 +111,14 @@ const InitialSetupPage = () => {
|
||||||
</Form.Field>
|
</Form.Field>
|
||||||
<Form.Field>
|
<Form.Field>
|
||||||
<label>
|
<label>
|
||||||
{t('login_page.initial_setup.field.photo_path', 'Photo path')}
|
{t(
|
||||||
|
'login_page.initial_setup.field.photo_path.label',
|
||||||
|
'Photo path'
|
||||||
|
)}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
placeholder={t(
|
placeholder={t(
|
||||||
'login_page.initial_setup.field-photo_path.placeholder',
|
'login_page.initial_setup.field.photo_path.placeholder',
|
||||||
'/path/to/photos'
|
'/path/to/photos'
|
||||||
)}
|
)}
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -124,7 +127,7 @@ const InitialSetupPage = () => {
|
||||||
</Form.Field>
|
</Form.Field>
|
||||||
<Message error content={errorMessage} />
|
<Message error content={errorMessage} />
|
||||||
<Button type="submit">
|
<Button type="submit">
|
||||||
{t('login_page.initial_setup.field-submit', 'Setup Photoview')}
|
{t('login_page.initial_setup.field.submit', 'Setup Photoview')}
|
||||||
</Button>
|
</Button>
|
||||||
</Form>
|
</Form>
|
||||||
</Container>
|
</Container>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { gql, useMutation } from '@apollo/client'
|
import { gql, useMutation } from '@apollo/client'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Button, Checkbox, Input, Table } from 'semantic-ui-react'
|
import { Button, Checkbox, Input, Table } from 'semantic-ui-react'
|
||||||
|
|
||||||
const createUserMutation = gql`
|
const createUserMutation = gql`
|
||||||
|
@ -30,6 +31,7 @@ const initialState = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddUserRow = ({ setShow, show, onUserAdded }) => {
|
const AddUserRow = ({ setShow, show, onUserAdded }) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const [state, setState] = useState(initialState)
|
const [state, setState] = useState(initialState)
|
||||||
|
|
||||||
const [addRootPath, { loading: addRootPathLoading }] = useMutation(
|
const [addRootPath, { loading: addRootPathLoading }] = useMutation(
|
||||||
|
@ -81,14 +83,17 @@ const AddUserRow = ({ setShow, show, onUserAdded }) => {
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<Input
|
<Input
|
||||||
placeholder="Username"
|
placeholder={t('login_page.field.username', 'Username')}
|
||||||
value={state.username}
|
value={state.username}
|
||||||
onChange={e => updateInput(e, 'username')}
|
onChange={e => updateInput(e, 'username')}
|
||||||
/>
|
/>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<Input
|
<Input
|
||||||
placeholder="/path/to/photos"
|
placeholder={t(
|
||||||
|
'login_page.initial_setup.field.photo_path.placeholder',
|
||||||
|
'/path/to/photos'
|
||||||
|
)}
|
||||||
value={state.rootPath}
|
value={state.rootPath}
|
||||||
onChange={e => updateInput(e, 'rootPath')}
|
onChange={e => updateInput(e, 'rootPath')}
|
||||||
/>
|
/>
|
||||||
|
@ -108,7 +113,7 @@ const AddUserRow = ({ setShow, show, onUserAdded }) => {
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<Button.Group>
|
<Button.Group>
|
||||||
<Button negative onClick={() => setShow(false)}>
|
<Button negative onClick={() => setShow(false)}>
|
||||||
Cancel
|
{t('general.action.cancel', 'Cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
@ -124,7 +129,7 @@ const AddUserRow = ({ setShow, show, onUserAdded }) => {
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add User
|
{t('settings.users.add_user.submit', 'Add user')}
|
||||||
</Button>
|
</Button>
|
||||||
</Button.Group>
|
</Button.Group>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Button, Checkbox, Input, Table } from 'semantic-ui-react'
|
import { Button, Checkbox, Input, Table } from 'semantic-ui-react'
|
||||||
import { EditRootPaths } from './EditUserRowRootPaths'
|
import { EditRootPaths } from './EditUserRowRootPaths'
|
||||||
import { UserRowProps } from './UserRow'
|
import { UserRowProps } from './UserRow'
|
||||||
|
@ -10,6 +11,7 @@ const EditUserRow = ({
|
||||||
updateUser,
|
updateUser,
|
||||||
updateUserLoading,
|
updateUserLoading,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
function updateInput(event, key) {
|
function updateInput(event, key) {
|
||||||
setState(state => ({
|
setState(state => ({
|
||||||
...state,
|
...state,
|
||||||
|
@ -52,7 +54,7 @@ const EditUserRow = ({
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Cancel
|
{t('general.action.cancel', 'Cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
loading={updateUserLoading}
|
loading={updateUserLoading}
|
||||||
|
@ -68,7 +70,7 @@ const EditUserRow = ({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Save
|
{t('general.action.save', 'Save')}
|
||||||
</Button>
|
</Button>
|
||||||
</Button.Group>
|
</Button.Group>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { gql, useMutation } from '@apollo/client'
|
||||||
import { Button, Icon, Input } from 'semantic-ui-react'
|
import { Button, Icon, Input } from 'semantic-ui-react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import { USERS_QUERY } from './UsersTable'
|
import { USERS_QUERY } from './UsersTable'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const userAddRootPathMutation = gql`
|
const userAddRootPathMutation = gql`
|
||||||
mutation userAddRootPath($id: ID!, $rootPath: String!) {
|
mutation userAddRootPath($id: ID!, $rootPath: String!) {
|
||||||
|
@ -28,6 +29,7 @@ const RootPathListItem = styled.li`
|
||||||
`
|
`
|
||||||
|
|
||||||
const EditRootPath = ({ album, user }) => {
|
const EditRootPath = ({ album, user }) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const [removeAlbumPath, { loading }] = useMutation(
|
const [removeAlbumPath, { loading }] = useMutation(
|
||||||
userRemoveAlbumPathMutation,
|
userRemoveAlbumPathMutation,
|
||||||
{
|
{
|
||||||
|
@ -55,7 +57,7 @@ const EditRootPath = ({ album, user }) => {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Icon name="remove" />
|
<Icon name="remove" />
|
||||||
Remove
|
{t('general.action.remove', 'Remove')}
|
||||||
</Button>
|
</Button>
|
||||||
</RootPathListItem>
|
</RootPathListItem>
|
||||||
)
|
)
|
||||||
|
@ -72,6 +74,7 @@ const NewRootPathInput = styled(Input)`
|
||||||
`
|
`
|
||||||
|
|
||||||
const EditNewRootPath = ({ userID }) => {
|
const EditNewRootPath = ({ userID }) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const [value, setValue] = useState('')
|
const [value, setValue] = useState('')
|
||||||
const [addRootPath, { loading }] = useMutation(userAddRootPathMutation, {
|
const [addRootPath, { loading }] = useMutation(userAddRootPathMutation, {
|
||||||
refetchQueries: [
|
refetchQueries: [
|
||||||
|
@ -91,7 +94,7 @@ const EditNewRootPath = ({ userID }) => {
|
||||||
action={{
|
action={{
|
||||||
positive: true,
|
positive: true,
|
||||||
icon: 'add',
|
icon: 'add',
|
||||||
content: 'Add',
|
content: t('general.action.add', 'Add'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setValue('')
|
setValue('')
|
||||||
addRootPath({
|
addRootPath({
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React, { useState } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { gql, useMutation } from '@apollo/client'
|
import { gql, useMutation } from '@apollo/client'
|
||||||
import { Button, Form, Input, Modal } from 'semantic-ui-react'
|
import { Button, Form, Input, Modal } from 'semantic-ui-react'
|
||||||
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const changeUserPasswordMutation = gql`
|
const changeUserPasswordMutation = gql`
|
||||||
mutation changeUserPassword($userId: ID!, $password: String!) {
|
mutation changeUserPassword($userId: ID!, $password: String!) {
|
||||||
|
@ -12,6 +13,7 @@ const changeUserPasswordMutation = gql`
|
||||||
`
|
`
|
||||||
|
|
||||||
const ChangePasswordModal = ({ onClose, user, ...props }) => {
|
const ChangePasswordModal = ({ onClose, user, ...props }) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const [passwordInput, setPasswordInput] = useState('')
|
const [passwordInput, setPasswordInput] = useState('')
|
||||||
|
|
||||||
const [changePassword] = useMutation(changeUserPasswordMutation, {
|
const [changePassword] = useMutation(changeUserPasswordMutation, {
|
||||||
|
@ -22,16 +24,25 @@ const ChangePasswordModal = ({ onClose, user, ...props }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal {...props}>
|
<Modal {...props}>
|
||||||
<Modal.Header>Change password</Modal.Header>
|
<Modal.Header>
|
||||||
|
{t('settings.users.password_reset.title', 'Change password')}
|
||||||
|
</Modal.Header>
|
||||||
<Modal.Content>
|
<Modal.Content>
|
||||||
<p>
|
<p>
|
||||||
|
<Trans t={t} i18nKey="settings.users.password_reset.description">
|
||||||
Change password for <b>{user.username}</b>
|
Change password for <b>{user.username}</b>
|
||||||
|
</Trans>
|
||||||
</p>
|
</p>
|
||||||
<Form>
|
<Form>
|
||||||
<Form.Field>
|
<Form.Field>
|
||||||
<label>New password</label>
|
<label>
|
||||||
|
{t('settings.users.password_reset.form.label', 'New password')}
|
||||||
|
</label>
|
||||||
<Input
|
<Input
|
||||||
placeholder="password"
|
placeholder={t(
|
||||||
|
'settings.users.password_reset.form.placeholder',
|
||||||
|
'password'
|
||||||
|
)}
|
||||||
onChange={e => setPasswordInput(e.target.value)}
|
onChange={e => setPasswordInput(e.target.value)}
|
||||||
type="password"
|
type="password"
|
||||||
/>
|
/>
|
||||||
|
@ -39,7 +50,9 @@ const ChangePasswordModal = ({ onClose, user, ...props }) => {
|
||||||
</Form>
|
</Form>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
<Modal.Actions>
|
||||||
<Button onClick={() => onClose && onClose()}>Cancel</Button>
|
<Button onClick={() => onClose && onClose()}>
|
||||||
|
{t('general.action.cancel', 'Cancel')}
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
positive
|
positive
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -51,7 +64,7 @@ const ChangePasswordModal = ({ onClose, user, ...props }) => {
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Change password
|
{t('settings.users.password_reset.form.submit', 'Change password')}
|
||||||
</Button>
|
</Button>
|
||||||
</Modal.Actions>
|
</Modal.Actions>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { useQuery, gql } from '@apollo/client'
|
||||||
import UserRow from './UserRow'
|
import UserRow from './UserRow'
|
||||||
import AddUserRow from './AddUserRow'
|
import AddUserRow from './AddUserRow'
|
||||||
import { SectionTitle } from '../SettingsPage'
|
import { SectionTitle } from '../SettingsPage'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export const USERS_QUERY = gql`
|
export const USERS_QUERY = gql`
|
||||||
query settingsUsersQuery {
|
query settingsUsersQuery {
|
||||||
|
@ -22,6 +23,7 @@ export const USERS_QUERY = gql`
|
||||||
`
|
`
|
||||||
|
|
||||||
const UsersTable = () => {
|
const UsersTable = () => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const [showAddUser, setShowAddUser] = useState(false)
|
const [showAddUser, setShowAddUser] = useState(false)
|
||||||
|
|
||||||
const { loading, error, data, refetch } = useQuery(USERS_QUERY)
|
const { loading, error, data, refetch } = useQuery(USERS_QUERY)
|
||||||
|
@ -39,15 +41,23 @@ const UsersTable = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SectionTitle>Users</SectionTitle>
|
<SectionTitle>{t('settings.users.title', 'Users')}</SectionTitle>
|
||||||
<Loader active={loading} />
|
<Loader active={loading} />
|
||||||
<Table celled>
|
<Table celled>
|
||||||
<Table.Header>
|
<Table.Header>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.HeaderCell>Username</Table.HeaderCell>
|
<Table.HeaderCell>
|
||||||
<Table.HeaderCell>Photo path</Table.HeaderCell>
|
{t('settings.users.table.column_names.username', 'Username')}
|
||||||
<Table.HeaderCell>Admin</Table.HeaderCell>
|
</Table.HeaderCell>
|
||||||
<Table.HeaderCell>Action</Table.HeaderCell>
|
<Table.HeaderCell>
|
||||||
|
{t('settings.users.table.column_names.photo_path', 'Photo path')}
|
||||||
|
</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell>
|
||||||
|
{t('settings.users.table.column_names.admin', 'Admin')}
|
||||||
|
</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell>
|
||||||
|
{t('settings.users.table.column_names.action', 'Action')}
|
||||||
|
</Table.HeaderCell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
</Table.Header>
|
</Table.Header>
|
||||||
|
|
||||||
|
@ -73,7 +83,7 @@ const UsersTable = () => {
|
||||||
onClick={() => setShowAddUser(true)}
|
onClick={() => setShowAddUser(true)}
|
||||||
>
|
>
|
||||||
<Icon name="add" />
|
<Icon name="add" />
|
||||||
New user
|
{t('settings.users.table.new_user', 'New user')}
|
||||||
</Button>
|
</Button>
|
||||||
</Table.HeaderCell>
|
</Table.HeaderCell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { Button, Icon, Table, Modal } from 'semantic-ui-react'
|
import { Button, Icon, Table, Modal } from 'semantic-ui-react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import ChangePasswordModal from './UserChangePassword'
|
import ChangePasswordModal from './UserChangePassword'
|
||||||
|
@ -22,6 +23,7 @@ const ViewUserRow = ({
|
||||||
showChangePassword,
|
showChangePassword,
|
||||||
showConfirmDelete,
|
showConfirmDelete,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const paths = (
|
const paths = (
|
||||||
<PathList>
|
<PathList>
|
||||||
{user.rootAlbums.map(album => (
|
{user.rootAlbums.map(album => (
|
||||||
|
@ -45,18 +47,21 @@ const ViewUserRow = ({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon name="edit" />
|
<Icon name="edit" />
|
||||||
Edit
|
{t('settings.users.table.row.action.edit', 'Edit')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={scanUserCalled}
|
disabled={scanUserCalled}
|
||||||
onClick={() => scanUser({ variables: { userId: user.id } })}
|
onClick={() => scanUser({ variables: { userId: user.id } })}
|
||||||
>
|
>
|
||||||
<Icon name="sync" />
|
<Icon name="sync" />
|
||||||
Scan
|
{t('settings.users.table.row.action.scan', 'Scan')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={() => setChangePassword(true)}>
|
<Button onClick={() => setChangePassword(true)}>
|
||||||
<Icon name="key" />
|
<Icon name="key" />
|
||||||
Change password
|
{t(
|
||||||
|
'settings.users.table.row.action.change_password',
|
||||||
|
'Change password'
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
<ChangePasswordModal
|
<ChangePasswordModal
|
||||||
user={user}
|
user={user}
|
||||||
|
@ -70,19 +75,28 @@ const ViewUserRow = ({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon name="delete" />
|
<Icon name="delete" />
|
||||||
Delete
|
{t('settings.users.table.row.action.delete', 'Delete')}
|
||||||
</Button>
|
</Button>
|
||||||
<Modal open={showConfirmDelete}>
|
<Modal open={showConfirmDelete}>
|
||||||
<Modal.Header>Delete user</Modal.Header>
|
<Modal.Header>
|
||||||
|
{t('settings.users.confirm_delete_user.title', 'Delete user')}
|
||||||
|
</Modal.Header>
|
||||||
<Modal.Content>
|
<Modal.Content>
|
||||||
|
<Trans
|
||||||
|
t={t}
|
||||||
|
i18nKey="settings.users.confirm_delete_user.description"
|
||||||
|
>
|
||||||
<p>
|
<p>
|
||||||
{`Are you sure, you want to delete `}
|
{`Are you sure, you want to delete `}
|
||||||
<b>{user.username}</b>?
|
<b>{user.username}</b>?
|
||||||
</p>
|
</p>
|
||||||
<p>{`This action cannot be undone`}</p>
|
<p>{`This action cannot be undone`}</p>
|
||||||
|
</Trans>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
<Modal.Actions>
|
||||||
<Button onClick={() => setConfirmDelete(false)}>Cancel</Button>
|
<Button onClick={() => setConfirmDelete(false)}>
|
||||||
|
{t('general.action.cancel', 'Cancel')}
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
negative
|
negative
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -94,7 +108,11 @@ const ViewUserRow = ({
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Delete {user.username}
|
{t(
|
||||||
|
'settings.users.confirm_delete_user.action',
|
||||||
|
'Delete {{user}}',
|
||||||
|
{ user: user.username }
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</Modal.Actions>
|
</Modal.Actions>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
Loading…
Reference in New Issue