fix(ui): hide Plex alert after setup and add local login warning to local user modal (#1600)

pull/1542/head
TheCatLady 3 years ago committed by GitHub
parent 0c4fb6446b
commit 694d0ffcf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -262,25 +262,27 @@ const SettingsPlex: React.FC<SettingsPlexProps> = ({ onComplete }) => {
<p className="description">
{intl.formatMessage(messages.plexsettingsDescription)}
</p>
<div className="section">
<Alert
title={intl.formatMessage(messages.settingUpPlexDescription, {
RegisterPlexTVLink: function RegisterPlexTVLink(msg) {
return (
<a
href="https://plex.tv"
className="text-white transition duration-300 hover:underline"
target="_blank"
rel="noreferrer"
>
{msg}
</a>
);
},
})}
type="info"
/>
</div>
{!!onComplete && (
<div className="section">
<Alert
title={intl.formatMessage(messages.settingUpPlexDescription, {
RegisterPlexTVLink: function RegisterPlexTVLink(msg) {
return (
<a
href="https://plex.tv"
className="text-white transition duration-300 hover:underline"
target="_blank"
rel="noreferrer"
>
{msg}
</a>
);
},
})}
type="info"
/>
</div>
)}
</div>
<Formik
initialValues={{

@ -17,6 +17,7 @@ import * as Yup from 'yup';
import type { UserResultsResponse } from '../../../server/interfaces/api/userInterfaces';
import { UserSettingsNotificationsResponse } from '../../../server/interfaces/api/userSettingsInterfaces';
import { hasPermission } from '../../../server/lib/permissions';
import useSettings from '../../hooks/useSettings';
import { useUpdateQueryParams } from '../../hooks/useUpdateQueryParams';
import { Permission, User, UserType, useUser } from '../../hooks/useUser';
import globalMessages from '../../i18n/globalMessages';
@ -77,6 +78,8 @@ const messages = defineMessages({
sortUpdated: 'Last Updated',
sortDisplayName: 'Display Name',
sortRequests: 'Request Count',
localLoginDisabled:
'The <strong>Enable Local Sign-In</strong> setting is currently disabled.',
});
type Sort = 'created' | 'updated' | 'requests' | 'displayname';
@ -84,6 +87,7 @@ type Sort = 'created' | 'updated' | 'requests' | 'displayname';
const UserList: React.FC = () => {
const intl = useIntl();
const router = useRouter();
const settings = useSettings();
const { addToast } = useToasts();
const { user: currentUser, hasPermission: currentHasPermission } = useUser();
const [currentSort, setCurrentSort] = useState<Sort>('created');
@ -347,6 +351,20 @@ const UserList: React.FC = () => {
okButtonType="primary"
onCancel={() => setCreateModal({ isOpen: false })}
>
{!settings.currentSettings.localLogin && (
<Alert
title={intl.formatMessage(messages.localLoginDisabled, {
strong: function strong(msg) {
return (
<strong className="font-semibold text-yellow-100">
{msg}
</strong>
);
},
})}
type="warning"
/>
)}
{!notificationSettings?.emailEnabled && (
<Alert
title={intl.formatMessage(messages.passwordinfodescription)}

@ -701,6 +701,7 @@
"components.UserList.importfromplex": "Import Users from Plex",
"components.UserList.importfromplexerror": "Something went wrong while importing users from Plex.",
"components.UserList.lastupdated": "Last Updated",
"components.UserList.localLoginDisabled": "The <strong>Enable Local Sign-In</strong> setting is currently disabled.",
"components.UserList.localuser": "Local User",
"components.UserList.nouserstoimport": "No new users to import from Plex.",
"components.UserList.owner": "Owner",

Loading…
Cancel
Save