Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move dashboard help links to header icon #6254

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/apps/dashboard/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useLocale } from 'hooks/useLocale';

import AppTabs from './components/AppTabs';
import AppDrawer from './components/drawer/AppDrawer';
import HelpButton from './components/toolbar/HelpButton';
import { DASHBOARD_APP_PATHS } from './routes/routes';

import './AppOverrides.scss';
Expand Down Expand Up @@ -68,6 +69,9 @@ export const Component: FC = () => {
isDrawerAvailable={!isMediumScreen && isDrawerAvailable}
isDrawerOpen={isDrawerOpen}
onDrawerButtonClick={onToggleDrawer}
buttons={
<HelpButton />
}
>
<AppTabs isDrawerOpen={isDrawerOpen} />
</AppToolbar>
Expand Down
36 changes: 36 additions & 0 deletions src/apps/dashboard/components/toolbar/HelpButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import HelpOutline from '@mui/icons-material/HelpOutline';
import IconButton from '@mui/material/IconButton/IconButton';
import Tooltip from '@mui/material/Tooltip/Tooltip';
import React from 'react';
import { Route, Routes } from 'react-router-dom';

import { HelpLinks } from 'apps/dashboard/constants/helpLinks';
import globalize from 'lib/globalize';

const HelpButton = () => (
<Routes>
{
HelpLinks.map(({ paths, url }) => paths.map(path => (
<Route
key={[url, path].join('-')}
path={path}
element={
<Tooltip title={globalize.translate('Help')}>
<IconButton
href={url}
rel='noopener noreferrer'
target='_blank'
size='large'
color='inherit'
>
<HelpOutline />
</IconButton>
</Tooltip>
}
/>
))).flat()
}
</Routes>
);

export default HelpButton;
51 changes: 51 additions & 0 deletions src/apps/dashboard/constants/helpLinks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
export const HelpLinks = [
{
paths: ['/dashboard/devices'],
url: 'https://jellyfin.org/docs/general/server/devices'
}, {
paths: ['/dashboard/libraries'],
url: 'https://jellyfin.org/docs/general/server/libraries'
}, {
paths: [
'/dashboard/livetv',
'/dashboard/livetv/tuner',
'/dashboard/recordings'
],
url: 'https://jellyfin.org/docs/general/server/live-tv/'
}, {
paths: ['/dashboard/livetv/guide'],
url: 'https://jellyfin.org/docs/general/server/live-tv/setup-guide#adding-guide-data'
}, {
paths: ['/dashboard/networking'],
url: 'https://jellyfin.org/docs/general/networking/'
}, {
paths: ['/dashboard/playback/transcoding'],
url: 'https://jellyfin.org/docs/general/server/transcoding'
}, {
paths: [
'/dashboard/plugins',
'/dashboard/plugins/catalog'
],
url: 'https://jellyfin.org/docs/general/server/plugins/'
}, {
paths: ['/dashboard/plugins/repositories'],
url: 'https://jellyfin.org/docs/general/server/plugins/#repositories'
}, {
paths: ['/dashboard/settings'],
url: 'https://jellyfin.org/docs/general/server/settings'
}, {
paths: ['/dashboard/tasks'],
url: 'https://jellyfin.org/docs/general/server/tasks'
}, {
paths: ['/dashboard/users'],
url: 'https://jellyfin.org/docs/general/server/users/adding-managing-users'
}, {
paths: [
'/dashboard/users/access',
'/dashboard/users/parentalcontrol',
'/dashboard/users/password',
'/dashboard/users/profile'
],
url: 'https://jellyfin.org/docs/general/server/users/'
}
];
1 change: 0 additions & 1 deletion src/apps/dashboard/routes/playback/trickplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ const PlaybackTrickplay: FC = () => {
<div className='verticalSection'>
<SectionTitleContainer
title={globalize.translate('Trickplay')}
isLinkVisible={false}
/>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/apps/dashboard/routes/users/access.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
loadMediaFolders(user, mediaFolders);
loadDevices(user, devices);
loading.hide();
}, [loadChannels, loadDevices, loadMediaFolders]);

Check warning on line 141 in src/apps/dashboard/routes/users/access.tsx

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

React Hook useCallback has a missing dependency: 'libraryMenu'. Either include it or remove the dependency array

const loadData = useCallback(() => {
loading.show();
Expand Down Expand Up @@ -236,7 +236,7 @@
});

(page.querySelector('.userLibraryAccessForm') as HTMLFormElement).addEventListener('submit', onSubmit);
}, [loadData]);

Check warning on line 239 in src/apps/dashboard/routes/users/access.tsx

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

React Hook useEffect has a missing dependency: 'userId'. Either include it or remove the dependency array

return (
<Page
Expand All @@ -247,7 +247,6 @@
<div className='verticalSection'>
<SectionTitleContainer
title={userName}
url='https://jellyfin.org/docs/general/server/users/'
/>
</div>
<SectionTabs activeTab='userlibraryaccess'/>
Expand Down
1 change: 0 additions & 1 deletion src/apps/dashboard/routes/users/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ const UserNew = () => {
<div className='verticalSection'>
<SectionTitleContainer
title={globalize.translate('HeaderAddUser')}
url='https://jellyfin.org/docs/general/server/users/'
/>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/apps/dashboard/routes/users/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ const UserProfiles = () => {
btnClassName='fab submit sectionTitleButton'
btnTitle='ButtonAddUser'
btnIcon='add'
url='https://jellyfin.org/docs/general/server/users/adding-managing-users'
/>
</div>

Expand Down
4 changes: 0 additions & 4 deletions src/apps/dashboard/routes/users/parentalcontrol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ const UserParentalControl = () => {
<div className='verticalSection'>
<SectionTitleContainer
title={userName}
url='https://jellyfin.org/docs/general/server/users/'
/>
</div>
<SectionTabs activeTab='userparentalcontrol'/>
Expand Down Expand Up @@ -406,7 +405,6 @@ const UserParentalControl = () => {
btnClassName='fab submit sectionTitleButton'
btnTitle='Add'
btnIcon='add'
isLinkVisible={false}
/>
<div className='fieldDescription'>
{globalize.translate('AllowContentWithTagsHelp')}
Expand All @@ -431,7 +429,6 @@ const UserParentalControl = () => {
btnClassName='fab submit sectionTitleButton'
btnTitle='Add'
btnIcon='add'
isLinkVisible={false}
/>
<div className='fieldDescription'>
{globalize.translate('BlockContentWithTagsHelp')}
Expand All @@ -455,7 +452,6 @@ const UserParentalControl = () => {
btnClassName='fab submit sectionTitleButton'
btnTitle='Add'
btnIcon='add'
isLinkVisible={false}
/>
<p>{globalize.translate('HeaderAccessScheduleHelp')}</p>
<div className='accessScheduleList paperList'>
Expand Down
1 change: 0 additions & 1 deletion src/apps/dashboard/routes/users/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const UserPassword = () => {
<div className='verticalSection'>
<SectionTitleContainer
title={userName}
url='https://jellyfin.org/docs/general/server/users/'
/>
</div>
<SectionTabs activeTab='userpassword'/>
Expand Down
1 change: 0 additions & 1 deletion src/apps/dashboard/routes/users/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
(page.querySelector('#txtMaxActiveSessions') as HTMLInputElement).value = String(user.Policy?.MaxActiveSessions) || '0';
(page.querySelector('#selectSyncPlayAccess') as HTMLSelectElement).value = String(user.Policy?.SyncPlayAccess);
loading.hide();
}, [loadAuthProviders, loadPasswordResetProviders, loadDeleteFolders ]);

Check warning on line 176 in src/apps/dashboard/routes/users/profile.tsx

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

React Hook useCallback has a missing dependency: 'libraryMenu'. Either include it or remove the dependency array

const loadData = useCallback(() => {
loading.show();
Expand All @@ -182,7 +182,7 @@
}).catch(err => {
console.error('[useredit] failed to load data', err);
});
}, [loadUser]);

Check warning on line 185 in src/apps/dashboard/routes/users/profile.tsx

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

React Hook useCallback has a missing dependency: 'getUser'. Either include it or remove the dependency array

useEffect(() => {
const page = element.current;
Expand Down Expand Up @@ -261,7 +261,7 @@
(page.querySelector('#btnCancel') as HTMLButtonElement).addEventListener('click', function() {
window.history.back();
});
}, [loadData]);

Check warning on line 264 in src/apps/dashboard/routes/users/profile.tsx

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

React Hook useEffect has a missing dependency: 'getUser'. Either include it or remove the dependency array

const optionLoginProvider = authProviders.map((provider) => {
const selected = provider.Id === authenticationProviderId || authProviders.length < 2 ? ' selected' : '';
Expand Down Expand Up @@ -290,7 +290,6 @@
<div className='verticalSection'>
<SectionTitleContainer
title={userDto?.Name || ''}
url='https://jellyfin.org/docs/general/server/users/'
/>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/components/tvproviders/schedulesdirect.template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h1 class="sectionTitle">Schedules Direct</h1>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/live-tv/setup-guide#adding-guide-data">${Help}</a>
</div>
<p class="createAccountHelp"></p>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/tvproviders/xmltv.template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h1 class="sectionTitle">Xml TV</h1>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/live-tv/setup-guide#adding-guide-data">${Help}</a>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/controllers/dashboard/devices/device.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="verticalSection verticalSection-extrabottompadding">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle reportedName"></h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/devices">${Help}</a>
</div>

<div class="inputContainer">
Expand Down
11 changes: 9 additions & 2 deletions src/controllers/dashboard/devices/devices.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
<div class="verticalSection verticalSection">
<div class="sectionTitleContainer sectionTitleContainer-cards flex align-items-center">
<h2 class="sectionTitle sectionTitle-cards">${HeaderDevices}</h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/devices">${Help}</a>
<button id="deviceDeleteAll" is="emby-button" type="button" class="raised button-alt headerHelpButton">${DeleteAll}</button>
<button
id="deviceDeleteAll"
is="emby-button"
type="button"
class="raised button-alt"
style="margin-left: 1.25em !important; padding-bottom: 0.4em !important; padding-top: 0.4em !important;"
>
${DeleteAll}
</button>
</div>
</div>
<div is="emby-itemscontainer" class="devicesList vertical-wrap" data-multiselect="false"></div>
Expand Down
1 change: 0 additions & 1 deletion src/controllers/dashboard/encodingsettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${Transcoding}</h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/transcoding">${Help}</a>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/controllers/dashboard/general.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${Settings}</h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/settings">${Help}</a>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/controllers/dashboard/library.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<span>${ButtonScanAllLibraries}</span>
</button>
<progress max="100" min="0" style="display: inline-block; vertical-align: middle;" class="refreshProgress"></progress>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt" target="_blank" href="https://jellyfin.org/docs/general/server/libraries">${Help}</a>
</div>

<div id="divVirtualFolders"></div>
Expand Down
1 change: 0 additions & 1 deletion src/controllers/dashboard/networking.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="verticalSection verticalSection-extrabottompadding">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${TabNetworking}</h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/networking/">${Help}</a>
</div>

<fieldset class='verticalSection verticalSection-extrabottompadding'>
Expand Down
3 changes: 0 additions & 3 deletions src/controllers/dashboard/plugins/available/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ <h2 class="sectionTitle">${TabCatalog}</h2>
<a is="emby-linkbutton" class="fab" href="#/dashboard/plugins/repositories" style="margin-left:1em;" title="${Settings}">
<span class="material-icons settings" aria-hidden="true"></span>
</a>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/plugins/">
${Help}
</a>
</div>
<div class="inputContainer">
<input id="txtSearchPlugins" name="txtSearchPlugins" type="text" is="emby-input" label="${Search}" />
Expand Down
3 changes: 0 additions & 3 deletions src/controllers/dashboard/plugins/installed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<div class="content-primary">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${TabMyPlugins}</h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/plugins/">
${Help}
</a>
</div>
<div class="inputContainer">
<input id="txtSearchPlugins" name="txtSearchPlugins" type="text" is="emby-input" label="${Search}" />
Expand Down
3 changes: 0 additions & 3 deletions src/controllers/dashboard/plugins/repositories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ <h2 class="sectionTitle">${TabRepositories}</h2>
<button is="emby-button" type="button" class="fab btnNewRepository submit" style="margin-left:1em;" title="${Add}">
<span class="material-icons add" aria-hidden="true"></span>
</button>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/plugins/#repositories">
${Help}
</a>
</div>

<div id="repositories"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle taskName"></h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/tasks">${Help}</a>
</div>
<p id="pTaskDescription"></p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ function populateList(page, tasks) {

let currentCategory;
let html = '';
for (let i = 0; i < tasks.length; i++) {
const task = tasks[i];
for (const task of tasks) {
if (task.Category != currentCategory) {
currentCategory = task.Category;
if (currentCategory) {
Expand All @@ -46,9 +45,6 @@ function populateList(page, tasks) {
html += '<h2 class="sectionTitle">';
html += currentCategory;
html += '</h2>';
if (i === 0) {
html += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/tasks">' + globalize.translate('Help') + '</a>';
}
html += '</div>';
html += '<div class="paperList">';
}
Expand Down
1 change: 0 additions & 1 deletion src/controllers/livetvsettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${HeaderDVR}</h2>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/live-tv/">${Help}</a>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion src/controllers/livetvstatus.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ <h2 class="sectionTitle sectionTitle-cards">
<button is="emby-button" type="button" class="fab btnAddDevice submit sectionTitleButton" style="margin-left:1em;" title="${Add}">
<span class="material-icons add" aria-hidden="true"></span>
</button>
<a is="emby-linkbutton" rel="noopener noreferrer" style="margin-left:2em!important;" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/live-tv/">${Help}</a>
</div>
<div class="devicesList itemsContainer vertical-wrap" data-hovermenu="false" data-multiselect="false" style="margin-top: .5em;"></div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/controllers/livetvtuner.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h1 class="sectionTitle">${HeaderLiveTvTunerSetup}</h1>
<a is="emby-linkbutton" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.org/docs/general/server/live-tv/">${Help}</a>
</div>
</div>

Expand Down
14 changes: 1 addition & 13 deletions src/elements/SectionTitleContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { FunctionComponent } from 'react';
import IconButtonElement from './IconButtonElement';
import LinkButton from './emby-button/LinkButton';
import globalize from 'lib/globalize';

type IProps = {
SectionClassName?: string;
Expand All @@ -11,10 +9,8 @@ type IProps = {
btnClassName?: string;
btnTitle?: string;
btnIcon?: string;
isLinkVisible?: boolean;
url?: string;
};
const SectionTitleContainer: FunctionComponent<IProps> = ({ SectionClassName, title, isBtnVisible = false, btnId, btnClassName, btnTitle, btnIcon, isLinkVisible = true, url }: IProps) => {
const SectionTitleContainer: FunctionComponent<IProps> = ({ SectionClassName, title, isBtnVisible = false, btnId, btnClassName, btnTitle, btnIcon }: IProps) => {
return (
<div className={`${SectionClassName} sectionTitleContainer flex align-items-center`}>
<h2 className='sectionTitle'>
Expand All @@ -29,14 +25,6 @@ const SectionTitleContainer: FunctionComponent<IProps> = ({ SectionClassName, ti
icon={btnIcon}
/>}

{isLinkVisible && <LinkButton
className='raised button-alt headerHelpButton'
target='_blank'
rel='noopener noreferrer'
href={url}>
{globalize.translate('Help')}
</LinkButton>}

</div>
);
};
Expand Down
6 changes: 0 additions & 6 deletions src/styles/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ form {
}
}

.headerHelpButton {
margin-left: 1.25em !important;
padding-bottom: 0.4em !important;
padding-top: 0.4em !important;
}

.mediaInfoContent {
margin-left: auto;
margin-right: auto;
Expand Down
Loading