From 9b2fecdfcb0def93a1f89ad83a0104b5ef466dc1 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Wed, 9 Aug 2023 22:16:57 +0200 Subject: [PATCH 01/24] =?UTF-8?q?=F0=9F=8C=90=20Replaced=20hardcoded=20tex?= =?UTF-8?q?t=20to=20use=20translation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/modules/bookmark.json | 23 ++++++++++- public/locales/en/modules/calendar.json | 16 +++++++- public/locales/en/modules/iframe.json | 3 +- .../en/modules/media-requests-list.json | 33 ++++++++++++++- .../en/modules/media-requests-stats.json | 6 ++- public/locales/en/modules/media-server.json | 1 + public/locales/en/modules/rss.json | 3 +- .../locales/en/modules/torrents-status.json | 3 +- public/locales/en/modules/usenet.json | 3 +- public/locales/en/modules/weather.json | 3 +- src/pages/404.tsx | 2 +- src/widgets/bookmark/BookmarkWidgetTile.tsx | 40 ++++++++----------- src/widgets/calendar/CalendarTile.tsx | 16 ++++---- src/widgets/iframe/IFrameTile.tsx | 2 +- .../media-requests/MediaRequestListTile.tsx | 9 +++-- .../media-requests/MediaRequestStatsTile.tsx | 4 +- .../media-server/DetailCollapseable.tsx | 34 ++++++++-------- src/widgets/media-server/MediaServerTile.tsx | 3 +- src/widgets/rss/RssWidgetTile.tsx | 1 + src/widgets/torrent/TorrentQueueItem.tsx | 5 +-- src/widgets/torrent/TorrentTile.tsx | 6 +-- src/widgets/useNet/UsenetQueueList.tsx | 4 +- src/widgets/weather/WeatherIcon.tsx | 4 +- src/widgets/weather/WeatherTile.tsx | 5 ++- 24 files changed, 148 insertions(+), 81 deletions(-) diff --git a/public/locales/en/modules/bookmark.json b/public/locales/en/modules/bookmark.json index 183ee3130..43ede12c2 100644 --- a/public/locales/en/modules/bookmark.json +++ b/public/locales/en/modules/bookmark.json @@ -12,7 +12,12 @@ "label": "Items" }, "layout": { - "label": "Layout" + "label": "Layout", + "data":{ + "autoGrid": "Auto Grid", + "horizontal": "Horizontal", + "vertical": "Vertical" + } } } }, @@ -21,5 +26,21 @@ "title": "Bookmark list empty", "text": "Add new items to this list in the edit mode" } + }, + "item": { + "validation": { + "length100": "Length must be between 1 and 100", + "length200": "Length must be between 1 and 200", + "length400": "Length must be between 1 and 400", + "invalidLink": "Not a valid link", + "errorMsg": "Did not save, because there were validation errors. Please adust your inputs" + }, + "name": "Name", + "url": "URL", + "newTab": "Open in new tab", + "hideHostname": "Hide Hostname", + "hideIcon": "Hide Icon", + "delete": "Delete" + } } diff --git a/public/locales/en/modules/calendar.json b/public/locales/en/modules/calendar.json index 8fcfdf442..1f261ade0 100644 --- a/public/locales/en/modules/calendar.json +++ b/public/locales/en/modules/calendar.json @@ -11,13 +11,25 @@ "label": "Start the week on Sunday" }, "radarrReleaseType": { - "label": "Radarr release type" + "label": "Radarr release type", + "data":{ + "inCinemas": "In Cinemas", + "physicalRelease": "Physical", + "digitalRelease": "Digital" + } }, "hideWeekDays": { "label": "Hide week days" }, "fontSize": { - "label": "Font Size" + "label": "Font Size", + "data":{ + "xs": "Extra Small", + "sm": "Small", + "md": "Medium", + "lg": "Large", + "xl": "Extra Large" + } } } } diff --git a/public/locales/en/modules/iframe.json b/public/locales/en/modules/iframe.json index 067cda28a..baa55e498 100644 --- a/public/locales/en/modules/iframe.json +++ b/public/locales/en/modules/iframe.json @@ -38,7 +38,8 @@ "noUrl": { "title": "Invalid URL", "text": "Ensure that you've entered a valid address in the configuration of your widget" - } + }, + "browserSupport": "Your Browser does not support iframes. Please update your browser." } } } diff --git a/public/locales/en/modules/media-requests-list.json b/public/locales/en/modules/media-requests-list.json index a1a2b6ab2..9016a0f0f 100644 --- a/public/locales/en/modules/media-requests-list.json +++ b/public/locales/en/modules/media-requests-list.json @@ -19,6 +19,37 @@ }, "tooltips": { "approve": "Approve requests", - "decline": "Decline requests" + "decline": "Decline requests", + "approving": "Approving Request..." + }, + "mutation": { + "approving": "Approving", + "declining": "Declining", + "request": "request...", + "approved": "Request was approved!", + "declined": "Request was declined!" + }, + "detail": { + "label": "Stats for nerds", + "id": "ID", + "device": "Device", + "video": { + "video":"Video", + "resolution": "Resolution", + "framerate": "Framerate", + "codec": "Video Codec" + }, + "audio": { + "audio": "Audio", + "channels": "Audio Channels", + "codec": "Audio Codec" + }, + "transcoding": { + "transcoding": "Transcoding", + "context": "Context", + "requested": "Hardware Encoding Requested", + "source": "Source Codec", + "target": "Target Codec" + } } } diff --git a/public/locales/en/modules/media-requests-stats.json b/public/locales/en/modules/media-requests-stats.json index a06a52860..3027c8e1c 100644 --- a/public/locales/en/modules/media-requests-stats.json +++ b/public/locales/en/modules/media-requests-stats.json @@ -5,7 +5,11 @@ "settings": { "title": "Media requests stats", "direction": { - "label": "Direction of the layout." + "label": "Direction of the layout.", + "data":{ + "row": "Horizontal", + "column": "Vertical" + } } } }, diff --git a/public/locales/en/modules/media-server.json b/public/locales/en/modules/media-server.json index 1b93eb4c2..52e7d4b1f 100644 --- a/public/locales/en/modules/media-server.json +++ b/public/locales/en/modules/media-server.json @@ -6,6 +6,7 @@ "title": "Settings for media server widget" } }, + "loading": "Homarr is loading streams...", "card": { "table": { "header": { diff --git a/public/locales/en/modules/rss.json b/public/locales/en/modules/rss.json index fc6907fb7..ee73f375b 100644 --- a/public/locales/en/modules/rss.json +++ b/public/locales/en/modules/rss.json @@ -12,7 +12,8 @@ "label": "Refresh interval (in minutes)" }, "dangerousAllowSanitizedItemContent": { - "label": "" + "label": "Allow HTML formatting (Dangerous)", + "info": "Allowing HTML formatting from outside could be dangerous.
Please make sure that the feed is from a trusted source." }, "textLinesClamp": { "label": "Text lines clamp" diff --git a/public/locales/en/modules/torrents-status.json b/public/locales/en/modules/torrents-status.json index cd2674b4d..5901c0e5e 100644 --- a/public/locales/en/modules/torrents-status.json +++ b/public/locales/en/modules/torrents-status.json @@ -63,7 +63,8 @@ } }, "loading": { - "title": "Loading..." + "title": "Loading...", + "description": "Homarr is establishing a connection..." }, "popover": { "introductionPrefix": "Managed by", diff --git a/public/locales/en/modules/usenet.json b/public/locales/en/modules/usenet.json index d21c37ff4..19b292811 100644 --- a/public/locales/en/modules/usenet.json +++ b/public/locales/en/modules/usenet.json @@ -31,7 +31,8 @@ "title": "Error", "message": "An error has occurred" }, - "paused": "Paused" + "paused": "Paused", + "notImplemented": "NOT IMPLEMENTED" }, "history": { "header": { diff --git a/public/locales/en/modules/weather.json b/public/locales/en/modules/weather.json index 16b034320..a8e5cefcc 100644 --- a/public/locales/en/modules/weather.json +++ b/public/locales/en/modules/weather.json @@ -32,5 +32,6 @@ "thunderstormWithHail": "Thunderstorm with hail", "unknown": "Unknown" } - } + }, + "error": "An error occured" } diff --git a/src/pages/404.tsx b/src/pages/404.tsx index fc9cfda5a..e0afe4192 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -49,6 +49,6 @@ export async function getStaticProps({ req, res, locale }: GetServerSidePropsCon const useStyles = createStyles(() => ({ image: { margin: '0 auto', - display: 'blcok', + display: 'block', }, })); diff --git a/src/widgets/bookmark/BookmarkWidgetTile.tsx b/src/widgets/bookmark/BookmarkWidgetTile.tsx index dd04b87ae..6969bc18d 100644 --- a/src/widgets/bookmark/BookmarkWidgetTile.tsx +++ b/src/widgets/bookmark/BookmarkWidgetTile.tsx @@ -74,6 +74,7 @@ const definition = defineWidget({ }; }, itemComponent({ data, onChange, delete: deleteData }) { + const { t } = useTranslation('modules/bookmark'); const form = useForm({ initialValues: data, validate: { @@ -83,15 +84,15 @@ const definition = defineWidget({ return undefined; } - return 'Length must be between 1 and 100'; + return t('item.validation.length100'); }, href: (value) => { if (!z.string().min(1).max(200).safeParse(value).success) { - return 'Length must be between 1 and 200'; + return t('item.validation.length200'); } if (!z.string().url().safeParse(value).success) { - return 'Not a valid link'; + return t('item.validation.invalidLink'); } return undefined; @@ -101,7 +102,7 @@ const definition = defineWidget({ return undefined; } - return 'Length must be between 1 and 100'; + return t('item.validation.length400'); }, }, validateInputOnChange: true, @@ -122,13 +123,13 @@ const definition = defineWidget({ } {...form.getInputProps('name')} - label="Name" + label={t('item.name')} withAsterisk /> } {...form.getInputProps('href')} - label="URL" + label={t('item.url')} withAsterisk /> {!form.isValid() && ( }> - Did not save, because there were validation errors. Please adust your inputs + {t('item.validation.errorMsg')} )} @@ -174,18 +175,9 @@ const definition = defineWidget({ layout: { type: 'select', data: [ - { - label: 'Auto Grid', - value: 'autoGrid', - }, - { - label: 'Horizontal', - value: 'horizontal', - }, - { - label: 'Vertical', - value: 'vertical', - }, + { value: 'autoGrid', }, + { value: 'horizontal', }, + { value: 'vertical', }, ], defaultValue: 'autoGrid', }, @@ -206,10 +198,10 @@ interface BookmarkWidgetTileProps { } function BookmarkWidgetTile({ widget }: BookmarkWidgetTileProps) { - const { t } = useTranslation('modules/bookmark'); const { classes } = useStyles(); const { enabled: isEditModeEnabled } = useEditModeStore(); const { fn, colors, colorScheme } = useMantineTheme(); + const { t } = useTranslation('modules/bookmark'); if (widget.properties.items.length === 0) { return ( diff --git a/src/widgets/calendar/CalendarTile.tsx b/src/widgets/calendar/CalendarTile.tsx index 501f5a4cd..ec421e191 100644 --- a/src/widgets/calendar/CalendarTile.tsx +++ b/src/widgets/calendar/CalendarTile.tsx @@ -33,20 +33,20 @@ const definition = defineWidget({ type: 'select', defaultValue: 'inCinemas', data: [ - { label: 'In Cinemas', value: 'inCinemas' }, - { label: 'Physical', value: 'physicalRelease' }, - { label: 'Digital', value: 'digitalRelease' }, + { value: 'inCinemas' }, + { value: 'physicalRelease' }, + { value: 'digitalRelease' }, ], }, fontSize: { type: 'select', defaultValue: 'xs', data: [ - { label: 'Extra Small', value: 'xs' }, - { label: 'Small', value: 'sm' }, - { label: 'Medium', value: 'md' }, - { label: 'Large', value: 'lg' }, - { label: 'Extra Large', value: 'xl' }, + { value: 'xs' }, + { value: 'sm' }, + { value: 'md' }, + { value: 'lg' }, + { value: 'xl' }, ], }, }, diff --git a/src/widgets/iframe/IFrameTile.tsx b/src/widgets/iframe/IFrameTile.tsx index 07bb951b3..86b32c89c 100644 --- a/src/widgets/iframe/IFrameTile.tsx +++ b/src/widgets/iframe/IFrameTile.tsx @@ -121,7 +121,7 @@ function IFrameTile({ widget }: IFrameTileProps) { title="widget iframe" allow={allowedPermissions.join(' ')} > - Your Browser does not support iframes. Please update your browser. + {t('card.errors.browserSupport')} ); diff --git a/src/widgets/media-requests/MediaRequestListTile.tsx b/src/widgets/media-requests/MediaRequestListTile.tsx index 512dbe45d..83eccc7a8 100644 --- a/src/widgets/media-requests/MediaRequestListTile.tsx +++ b/src/widgets/media-requests/MediaRequestListTile.tsx @@ -58,12 +58,13 @@ const useMediaRequestDecisionMutation = () => { utils.mediaRequest.all.invalidate(); }, }); + const { t } = useTranslation('modules/media-requests-list'); return async (variables: MediaRequestDecisionVariables) => { - const action = variables.isApproved ? 'Approving' : 'Declining'; + const action = variables.isApproved ? t('mutation.approving') : t('mutation.declining'); notifications.show({ id: `decide-${variables.request.id}`, color: 'yellow', - title: `${action} request...`, + title: `${action} ${t('mutation.request')}`, message: undefined, loading: true, }); @@ -75,7 +76,7 @@ const useMediaRequestDecisionMutation = () => { }, { onSuccess(_data, variables) { - const title = variables.isApproved ? 'Request was approved!' : 'Request was declined!'; + const title = variables.isApproved ? t('mutation.approved') : t('mutation.declined'); notifications.update({ id: `decide-${variables.id}`, color: 'teal', @@ -187,7 +188,7 @@ function MediaRequestListTile({ widget }: MediaRequestListWidgetProps) { notifications.show({ id: `approve ${item.id}`, color: 'yellow', - title: 'Approving request...', + title: t('tooltips.approving'), message: undefined, loading: true, }); diff --git a/src/widgets/media-requests/MediaRequestStatsTile.tsx b/src/widgets/media-requests/MediaRequestStatsTile.tsx index 2af61d3e3..a46bbe542 100644 --- a/src/widgets/media-requests/MediaRequestStatsTile.tsx +++ b/src/widgets/media-requests/MediaRequestStatsTile.tsx @@ -16,8 +16,8 @@ const definition = defineWidget({ type: 'select', defaultValue: 'row' as 'row' | 'column', data: [ - { label: 'Horizontal', value: 'row' }, - { label: 'Vertical', value: 'column' }, + { value: 'row' }, + { value: 'column' }, ], }, }, diff --git a/src/widgets/media-server/DetailCollapseable.tsx b/src/widgets/media-server/DetailCollapseable.tsx index 6c0cea44d..85aa18531 100644 --- a/src/widgets/media-server/DetailCollapseable.tsx +++ b/src/widgets/media-server/DetailCollapseable.tsx @@ -2,27 +2,29 @@ import { Card, Divider, Flex, Grid, Group, Text } from '@mantine/core'; import { IconDeviceMobile, IconId } from '@tabler/icons-react'; import { GenericSessionInfo } from '../../types/api/media-server/session-info'; +import { useTranslation } from 'react-i18next'; export const DetailCollapseable = ({ session }: { session: GenericSessionInfo }) => { let details: { title: string; metrics: { name: string; value: string | undefined }[] }[] = []; + const { t } = useTranslation('modules/media-server-list'); if (session.currentlyPlaying) { if (session.currentlyPlaying.metadata.video) { details = [ ...details, { - title: 'Video', + title: t('detail.video.'), metrics: [ { - name: 'Resolution', + name: t('detail.video.resolution'), value: `${session.currentlyPlaying.metadata.video.width}x${session.currentlyPlaying.metadata.video.height}`, }, { - name: 'Framerate', + name: t('detail.video.framerate'), value: session.currentlyPlaying.metadata.video.videoFrameRate, }, { - name: 'Codec', + name: t('detail.video.codec'), value: session.currentlyPlaying.metadata.video.videoCodec, }, { @@ -39,14 +41,14 @@ export const DetailCollapseable = ({ session }: { session: GenericSessionInfo }) details = [ ...details, { - title: 'Audio', + title: t('detail.audio.audio'), metrics: [ { - name: 'Audio channels', + name: t('detail.audio.channels'), value: `${session.currentlyPlaying.metadata.audio.audioChannels}`, }, { - name: 'Audio codec', + name: t('detail.audio.codec'), value: session.currentlyPlaying.metadata.audio.audioCodec, }, ], @@ -58,24 +60,24 @@ export const DetailCollapseable = ({ session }: { session: GenericSessionInfo }) details = [ ...details, { - title: 'Transcoding', + title: t('detail.transcoding.transcoding'), metrics: [ { - name: 'Resolution', + name: t('detail.video.resolution'), value: `${session.currentlyPlaying.metadata.transcoding.width}x${session.currentlyPlaying.metadata.transcoding.height}`, }, { - name: 'Context', + name: t('detail.transcoding.context'), value: session.currentlyPlaying.metadata.transcoding.context, }, { - name: 'Hardware encoding requested', + name: t('detail.transcoding.requested'), value: session.currentlyPlaying.metadata.transcoding.transcodeHwRequested ? 'yes' : 'no', }, { - name: 'Source codec', + name: t('detail.transcoding.source'), value: session.currentlyPlaying.metadata.transcoding.sourceAudioCodec || session.currentlyPlaying.metadata.transcoding.sourceVideoCodec @@ -83,7 +85,7 @@ export const DetailCollapseable = ({ session }: { session: GenericSessionInfo }) : undefined, }, { - name: 'Target codec', + name: t('detail.transcoding.target'), value: `${session.currentlyPlaying.metadata.transcoding.videoCodec} ${session.currentlyPlaying.metadata.transcoding.audioCodec}`, }, ], @@ -97,19 +99,19 @@ export const DetailCollapseable = ({ session }: { session: GenericSessionInfo }) - ID + {t('detail.id')} {session.id} - Device + {t('detail.device')} {session.sessionName} {details.length > 0 && ( - + )} {details.map((detail, index) => ( diff --git a/src/widgets/media-server/MediaServerTile.tsx b/src/widgets/media-server/MediaServerTile.tsx index c66d2f2e7..c2257ee49 100644 --- a/src/widgets/media-server/MediaServerTile.tsx +++ b/src/widgets/media-server/MediaServerTile.tsx @@ -42,7 +42,6 @@ interface MediaServerWidgetProps { function MediaServerTile({ widget }: MediaServerWidgetProps) { const { t } = useTranslation('modules/media-server'); const { config } = useConfigContext(); - const isEditMode = useEditModeStore((x) => x.enabled); const { data, isError, isFetching, isInitialLoading } = useGetMediaServers({ enabled: config !== undefined, @@ -72,7 +71,7 @@ function MediaServerTile({ widget }: MediaServerWidgetProps) { {t('descriptor.name')} - Homarr is loading streams... + {t('descriptor.loading')} ); diff --git a/src/widgets/rss/RssWidgetTile.tsx b/src/widgets/rss/RssWidgetTile.tsx index e9c9beec1..233b04dbd 100644 --- a/src/widgets/rss/RssWidgetTile.tsx +++ b/src/widgets/rss/RssWidgetTile.tsx @@ -42,6 +42,7 @@ const definition = defineWidget({ dangerousAllowSanitizedItemContent: { type: 'switch', defaultValue: false, + info: true, }, textLinesClamp: { type: 'slider', diff --git a/src/widgets/torrent/TorrentQueueItem.tsx b/src/widgets/torrent/TorrentQueueItem.tsx index 48d73a1ee..74600ca87 100644 --- a/src/widgets/torrent/TorrentQueueItem.tsx +++ b/src/widgets/torrent/TorrentQueueItem.tsx @@ -13,7 +13,7 @@ import { createStyles, useMantineTheme, } from '@mantine/core'; -import { useDisclosure, useElementSize } from '@mantine/hooks'; +import { useDisclosure } from '@mantine/hooks'; import { IconAffiliate, IconDatabase, @@ -37,9 +37,8 @@ interface TorrentQueueItemProps { width: number; } -export const BitTorrrentQueueItem = ({ torrent, width, app }: TorrentQueueItemProps) => { +export const BitTorrentQueueItem = ({ torrent, width, app }: TorrentQueueItemProps) => { const [popoverOpened, { open: openPopover, close: closePopover }] = useDisclosure(false); - const theme = useMantineTheme(); const { classes } = useStyles(); const { t } = useTranslation('modules/torrents-status'); diff --git a/src/widgets/torrent/TorrentTile.tsx b/src/widgets/torrent/TorrentTile.tsx index d5fa11c9a..70df20529 100644 --- a/src/widgets/torrent/TorrentTile.tsx +++ b/src/widgets/torrent/TorrentTile.tsx @@ -25,7 +25,7 @@ import { AppIntegrationType } from '../../types/app'; import { useGetDownloadClientsQueue } from '../download-speed/useGetNetworkSpeed'; import { defineWidget } from '../helper'; import { IWidget } from '../widgets'; -import { BitTorrrentQueueItem } from './TorrentQueueItem'; +import { BitTorrentQueueItem } from './TorrentQueueItem'; dayjs.extend(duration); dayjs.extend(relativeTime); @@ -108,7 +108,7 @@ function TorrentTile({ widget }: TorrentTileProps) { {t('card.loading.title')} - Homarr is establishing a connection... + {t('card.loading.description')} ); @@ -156,7 +156,7 @@ function TorrentTile({ widget }: TorrentTileProps) { {filteredTorrents.map((torrent, index) => ( - + ))} {filteredTorrents.length !== torrents.length && ( diff --git a/src/widgets/useNet/UsenetQueueList.tsx b/src/widgets/useNet/UsenetQueueList.tsx index f034d818b..cf38b1aed 100644 --- a/src/widgets/useNet/UsenetQueueList.tsx +++ b/src/widgets/useNet/UsenetQueueList.tsx @@ -109,13 +109,13 @@ export const UsenetQueueList: FunctionComponent = ({ appId {nzb.state === 'paused' ? ( - + ) : ( - + diff --git a/src/widgets/weather/WeatherIcon.tsx b/src/widgets/weather/WeatherIcon.tsx index f74175867..0ee71f70c 100644 --- a/src/widgets/weather/WeatherIcon.tsx +++ b/src/widgets/weather/WeatherIcon.tsx @@ -11,7 +11,6 @@ import { IconSun, } from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; -import { useElementSize } from '@mantine/hooks'; interface WeatherIconProps { code: number; @@ -25,8 +24,7 @@ interface WeatherIconProps { */ export const WeatherIcon = ({ code, size=50 }: WeatherIconProps) => { const { t } = useTranslation('modules/weather'); - const { width, ref } = useElementSize(); - + const { icon: Icon, name } = weatherDefinitions.find((wd) => wd.codes.includes(code)) ?? unknownWeather; diff --git a/src/widgets/weather/WeatherTile.tsx b/src/widgets/weather/WeatherTile.tsx index a4443d7cd..8514bbcfc 100644 --- a/src/widgets/weather/WeatherTile.tsx +++ b/src/widgets/weather/WeatherTile.tsx @@ -4,7 +4,6 @@ import { IconArrowDownRight, IconArrowUpRight, IconCloudRain, - IconCurrentLocation, IconMapPin, } from '@tabler/icons-react'; import { api } from '~/utils/api'; @@ -12,6 +11,7 @@ import { api } from '~/utils/api'; import { defineWidget } from '../helper'; import { IWidget } from '../widgets'; import { WeatherIcon } from './WeatherIcon'; +import { useTranslation } from 'react-i18next'; const definition = defineWidget({ id: 'weather', @@ -52,6 +52,7 @@ interface WeatherTileProps { function WeatherTile({ widget }: WeatherTileProps) { const { data: weather, isLoading, isError } = api.weather.at.useQuery(widget.properties.location); const { width, ref } = useElementSize(); + const { t } = useTranslation('modules/weather'); if (isLoading) { return ( @@ -77,7 +78,7 @@ function WeatherTile({ widget }: WeatherTileProps) { if (isError) { return (
- An error occured + {t('error')}
); } From 73cf109c72a9fd6ae7525a8d9d99b28f65c0c454 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Fri, 11 Aug 2023 21:08:42 +0200 Subject: [PATCH 02/24] =?UTF-8?q?=F0=9F=90=9B=20Remove=20not=20implemented?= =?UTF-8?q?=20action=20icons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/modules/usenet.json | 5 ++--- src/widgets/useNet/UsenetQueueList.tsx | 18 +----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/public/locales/en/modules/usenet.json b/public/locales/en/modules/usenet.json index 19b292811..e1b1060c6 100644 --- a/public/locales/en/modules/usenet.json +++ b/public/locales/en/modules/usenet.json @@ -31,8 +31,7 @@ "title": "Error", "message": "An error has occurred" }, - "paused": "Paused", - "notImplemented": "NOT IMPLEMENTED" + "paused": "Paused" }, "history": { "header": { @@ -47,4 +46,4 @@ }, "paused": "Paused" } -} +} \ No newline at end of file diff --git a/src/widgets/useNet/UsenetQueueList.tsx b/src/widgets/useNet/UsenetQueueList.tsx index cf38b1aed..125dd9df7 100644 --- a/src/widgets/useNet/UsenetQueueList.tsx +++ b/src/widgets/useNet/UsenetQueueList.tsx @@ -21,8 +21,8 @@ import duration from 'dayjs/plugin/duration'; import { useTranslation } from 'next-i18next'; import { FunctionComponent, useState } from 'react'; -import { useGetUsenetDownloads } from '../dashDot/api'; import { humanFileSize } from '../../tools/humanFileSize'; +import { useGetUsenetDownloads } from '../dashDot/api'; dayjs.extend(duration); @@ -91,7 +91,6 @@ export const UsenetQueueList: FunctionComponent = ({ appId - {sizeBreakpoint < width ? ( @@ -107,21 +106,6 @@ export const UsenetQueueList: FunctionComponent = ({ appId {data.items.map((nzb) => ( - From a9732657959a2a055ea67a2a045a50c2067ee10d Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 13 Aug 2023 22:24:46 +0200 Subject: [PATCH 07/24] =?UTF-8?q?=F0=9F=8C=90=20App=20validation=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/layout/modals/add-app.json | 8 +++++++- .../Dashboard/Modals/EditAppModal/EditAppModal.tsx | 12 ++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/public/locales/en/layout/modals/add-app.json b/public/locales/en/layout/modals/add-app.json index 6a7670617..683ba8724 100644 --- a/public/locales/en/layout/modals/add-app.json +++ b/public/locales/en/layout/modals/add-app.json @@ -99,6 +99,12 @@ } }, "validation": { - "popover": "Your form contains invalid data. Hence, it can't be saved. Please resolve all issues and click this button again to save your changes" + "popover": "Your form contains invalid data. Hence, it can't be saved. Please resolve all issues and click this button again to save your changes", + "name": "Name is required", + "noUrl": "Url is required", + "invalidUrl": "Value is not a valid url", + "noIconUrl": "This field is required", + "noExternalUri": "External URI is required", + "invalidExternalUri": "External URI is not a valid uri" } } diff --git a/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx b/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx index 34ab62500..782cc047e 100644 --- a/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx +++ b/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx @@ -47,14 +47,14 @@ export const EditAppModal = ({ const form = useForm({ initialValues: innerProps.app, validate: { - name: (name) => (!name ? 'Name is required' : null), + name: (name) => (!name ? t('validation.name') : null), url: (url) => { if (!url) { - return 'Url is required'; + return t('validation.noUrl'); } if (!url.match(appUrlRegex)) { - return 'Value is not a valid url'; + return t('validation.invalidUrl'); } return null; @@ -62,7 +62,7 @@ export const EditAppModal = ({ appearance: { iconUrl: (url: string) => { if (url.length < 1) { - return 'This field is required'; + return t('validation.noIconUrl'); } return null; @@ -71,11 +71,11 @@ export const EditAppModal = ({ behaviour: { externalUrl: (url: string) => { if (url === undefined || url.length < 1) { - return 'External URI is required'; + return t('validation.noExternalUri'); } if (!url.match(appUrlWithAnyProtocolRegex)) { - return 'External URI is not a valid uri'; + return t('validation.invalidExternalUri'); } return null; From d51bd439419dfd00efbf0bc2090e279d0c1c51ee Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 13 Aug 2023 22:56:41 +0200 Subject: [PATCH 08/24] =?UTF-8?q?=F0=9F=8C=90=20Add=20new=20tile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../en/layout/element-selector/selector.json | 14 ++++++++++++++ .../Overview/AvailableElementsOverview.tsx | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/public/locales/en/layout/element-selector/selector.json b/public/locales/en/layout/element-selector/selector.json index 7f7b0c778..3d2b934b0 100644 --- a/public/locales/en/layout/element-selector/selector.json +++ b/public/locales/en/layout/element-selector/selector.json @@ -7,5 +7,19 @@ "goBack": "Go back to the previous step", "actionIcon": { "tooltip": "Add a tile" + }, + "apps": "Apps", + "app": { + "defaultName": "Your App" + }, + "widgets": "Widgets", + "categories": "Categories", + "category": { + "newName": "Name of new category", + "defaultName": "New Category", + "created": { + "title": "Category created", + "message": "The category \"{{name}}\" has been created" + } } } diff --git a/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx b/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx index eb99dbcaa..3f386ff14 100644 --- a/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx +++ b/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx @@ -33,12 +33,12 @@ export const AvailableElementTypes = ({ const onClickCreateCategory = async () => { openContextModalGeneric({ modal: 'categoryEditModal', - title: 'Name of new category', + title: t('category.newName'), withCloseButton: false, innerProps: { category: { id: uuidv4(), - name: 'New category', + name: t('category.defaultName'), position: 0, // doesn't matter, is being overwritten }, onSuccess: async (category) => { @@ -65,8 +65,8 @@ export const AvailableElementTypes = ({ })).then(() => { closeModal(modalId); showNotification({ - title: 'Category created', - message: `The category ${category.name} has been created`, + title: t('category.created.title'), + message: t('category.created.message', { name: category.name}), color: 'teal', }); }); @@ -81,7 +81,7 @@ export const AvailableElementTypes = ({ } onClick={() => { openContextModalGeneric<{ app: AppType; allowAppNamePropagation: boolean }>({ @@ -89,7 +89,7 @@ export const AvailableElementTypes = ({ innerProps: { app: { id: uuidv4(), - name: 'Your app', + name: t('app.defaultName'), url: 'https://homarr.dev', appearance: { iconUrl: '/imgs/logo/logo.png', @@ -126,12 +126,12 @@ export const AvailableElementTypes = ({ }} /> } onClick={onOpenWidgets} /> } onClick={onClickCreateCategory} /> From 6ccc591bbfa3ad7d0d7bacfa14b0765c92cff964 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 13 Aug 2023 23:11:56 +0200 Subject: [PATCH 09/24] =?UTF-8?q?=F0=9F=8C=90=20Appearance=20Colors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/settings/customization/color-selector.json | 4 +++- src/components/Settings/Customization/Theme/ColorSelector.tsx | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/en/settings/customization/color-selector.json b/public/locales/en/settings/customization/color-selector.json index 19f42e95b..c0555e249 100644 --- a/public/locales/en/settings/customization/color-selector.json +++ b/public/locales/en/settings/customization/color-selector.json @@ -1,4 +1,6 @@ { "colors": "Colors", - "suffix": "{{color}} color" + "suffix": "{{color}} color", + "primary": "Primary", + "secondary": "Secondary" } \ No newline at end of file diff --git a/src/components/Settings/Customization/Theme/ColorSelector.tsx b/src/components/Settings/Customization/Theme/ColorSelector.tsx index c3ae8aae2..5c3941ace 100644 --- a/src/components/Settings/Customization/Theme/ColorSelector.tsx +++ b/src/components/Settings/Customization/Theme/ColorSelector.tsx @@ -99,9 +99,7 @@ export function ColorSelector({ type, defaultValue }: ColorControlProps) { - {t('suffix', { - color: type[0].toUpperCase() + type.slice(1), - })} + {t('suffix', {color: t(type)})} ); From 9f80f05ef6716e6d9ad09629796978c8203a2765 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Mon, 14 Aug 2023 19:25:53 +0200 Subject: [PATCH 10/24] =?UTF-8?q?=F0=9F=8C=90=20Removing=20"Homarr"=20and?= =?UTF-8?q?=20"..."=20when=20unnecessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/modules/media-server.json | 2 +- public/locales/en/modules/torrents-status.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/en/modules/media-server.json b/public/locales/en/modules/media-server.json index 52e7d4b1f..4dd399283 100644 --- a/public/locales/en/modules/media-server.json +++ b/public/locales/en/modules/media-server.json @@ -6,7 +6,7 @@ "title": "Settings for media server widget" } }, - "loading": "Homarr is loading streams...", + "loading": "Loading streams", "card": { "table": { "header": { diff --git a/public/locales/en/modules/torrents-status.json b/public/locales/en/modules/torrents-status.json index 5901c0e5e..3f83a6396 100644 --- a/public/locales/en/modules/torrents-status.json +++ b/public/locales/en/modules/torrents-status.json @@ -59,12 +59,12 @@ }, "generic": { "title": "An unexpected error occurred", - "text": "Homarr was unable to communicate with your Torrent clients. Please check your configuration" + "text": "Unable to communicate with your Torrent clients. Please check your configuration" } }, "loading": { - "title": "Loading...", - "description": "Homarr is establishing a connection..." + "title": "Loading", + "description": "Establishing a connection" }, "popover": { "introductionPrefix": "Managed by", From bc4009bd8bdf0450e5a376c2c28ec6e7a2aad758 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 20 Aug 2023 18:08:31 +0200 Subject: [PATCH 11/24] =?UTF-8?q?=F0=9F=90=9B=20Added=20movie=20in=20icon?= =?UTF-8?q?=20list=20for=20currently=20playing=20(#1303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/media-server/NowPlayingDisplay.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widgets/media-server/NowPlayingDisplay.tsx b/src/widgets/media-server/NowPlayingDisplay.tsx index ddab8f9d0..d03e4935c 100644 --- a/src/widgets/media-server/NowPlayingDisplay.tsx +++ b/src/widgets/media-server/NowPlayingDisplay.tsx @@ -3,6 +3,7 @@ import { Icon, IconDeviceTv, IconHeadphones, + IconMovie, IconQuestionMark, IconVideo, } from '@tabler/icons-react'; @@ -23,6 +24,8 @@ export const NowPlayingDisplay = ({ session }: { session: GenericSessionInfo }) return IconHeadphones; case 'tv': return IconDeviceTv; + case 'movie': + return IconMovie; case 'video': return IconVideo; default: From d1873ebd247ccad37bd9594ba3618dc5e795ff56 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 20 Aug 2023 20:02:50 +0200 Subject: [PATCH 12/24] =?UTF-8?q?=F0=9F=90=9B=20Plex=20tv-show=20formattin?= =?UTF-8?q?g=20like=20jellyfin=20(#1304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tools/server/sdk/plex/plexClient.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/server/sdk/plex/plexClient.ts b/src/tools/server/sdk/plex/plexClient.ts index 2600bf2e2..f6bff9565 100644 --- a/src/tools/server/sdk/plex/plexClient.ts +++ b/src/tools/server/sdk/plex/plexClient.ts @@ -35,6 +35,7 @@ export class PlexClient { const playerElement = this.findElement('Player', videoElement.elements); const mediaElement = this.findElement('Media', videoElement.elements); const sessionElement = this.findElement('Session', videoElement.elements); + const transcodingElement = this.findElement('TranscodeSession', videoElement.elements); if (!playerElement || !mediaElement) { return undefined; @@ -43,7 +44,6 @@ export class PlexClient { const { videoCodec, videoFrameRate, audioCodec, audioChannels, height, width, bitrate } = mediaElement; - const transcodingElement = this.findElement('TranscodeSession', videoElement.elements); return { id: sessionElement?.id as string | undefined, @@ -51,7 +51,10 @@ export class PlexClient { userProfilePicture: userElement?.thumb as string | undefined, sessionName: `${playerElement.product} (${playerElement.title})`, currentlyPlaying: { - name: videoElement.attributes?.title as string, + name: `${videoElement.attributes?.grandparentTitle ?? videoElement.attributes?.title}`, + seasonName: videoElement.attributes?.parentTitle, + episodeName: videoElement.attributes?.title, + episodeCount: videoElement.attributes?.index ?? undefined, type: this.getCurrentlyPlayingType(videoElement.attributes?.type as string), metadata: { video: { From 7ae0f9a7c67081d45f0562c3feea505aa1613377 Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 21 Aug 2023 17:59:01 +0200 Subject: [PATCH 13/24] =?UTF-8?q?=F0=9F=8C=90=20Add=20Hungarian=20language?= =?UTF-8?q?=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next-i18next.config.js | 1 + src/tools/language.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/next-i18next.config.js b/next-i18next.config.js index eed2cdc6e..f6f772e9d 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -29,6 +29,7 @@ module.exports = { 'no', 'tr', 'lv', + 'hu', 'hr' ], diff --git a/src/tools/language.ts b/src/tools/language.ts index e885e1500..e78c9efb4 100644 --- a/src/tools/language.ts +++ b/src/tools/language.ts @@ -188,6 +188,14 @@ export const languages: Language[] = [ emoji: '🇭🇷', locale: 'hr', }, + // Hungarian + { + shortName: 'hu', + originalName: 'Magyar', + translatedName: 'Hungarian', + emoji: '🇭🇺', + locale: 'hu', + }, ]; export const getLanguageByCode = (code: string | null) => From a98630e2c4851db9b7b08699f840f576b039a5ac Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 21 Aug 2023 18:01:58 +0200 Subject: [PATCH 14/24] =?UTF-8?q?=F0=9F=92=A1=20Add=20comment=20about=20en?= =?UTF-8?q?viron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/routers/notebook.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/api/routers/notebook.ts b/src/server/api/routers/notebook.ts index d7eb065cb..057c64031 100644 --- a/src/server/api/routers/notebook.ts +++ b/src/server/api/routers/notebook.ts @@ -12,6 +12,7 @@ export const notebookRouter = createTRPCRouter({ update: publicProcedure .input(z.object({ widgetId: z.string(), content: z.string(), configName: z.string() })) .mutation(async ({ input }) => { + //TODO: #1305 Remove use of DISABLE_EDIT_MODE for auth update if (!process.env.DISABLE_EDIT_MODE) { throw new TRPCError({ code: 'METHOD_NOT_SUPPORTED', From 21d81cbb7e35abccb5aea85553d5ba3916222f35 Mon Sep 17 00:00:00 2001 From: Thomas Camlong <49837342+ajnart@users.noreply.github.com> Date: Mon, 21 Aug 2023 21:52:27 +0200 Subject: [PATCH 15/24] Remove test- prefix in manually deployed versions --- .github/workflows/docker_dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 5c507e327..49045d806 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -86,7 +86,7 @@ jobs: # generate Docker tags based on the following events/attributes tags: | type=ref,event=pr - type=raw,value=${{ github.event.inputs.tag }}, prefix=test-,enable=${{ github.event.inputs.tag != '' }} + type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event.inputs.tag != '' }} tpye=raw,value=dev,priority=1,enable=${{ github.event.inputs.tag == '' }} - name: Set up QEMU @@ -153,4 +153,4 @@ jobs: - name: Build next.js app # change this if your site requires a custom build command - run: yarn turbo build \ No newline at end of file + run: yarn turbo build From 88129e9c25d2db2fc1a882110a5222c6ba2012e8 Mon Sep 17 00:00:00 2001 From: Thomas Camlong <49837342+ajnart@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:13:17 +0200 Subject: [PATCH 16/24] Remove analyze in Docker actions --- .github/workflows/docker_dev.yml | 40 -------------------------------- 1 file changed, 40 deletions(-) diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 49045d806..ca8b16563 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -114,43 +114,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - - analyze: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Restore next build - uses: actions/cache@v3 - id: restore-build-cache - env: - cache-name: cache-next-build - with: - # if you use a custom build directory, replace all instances of `.next` in this file with your build directory - # ex: if your app builds to `dist`, replace `.next` with `dist` - path: .next/cache - # change this if you prefer a more strict cache - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - run: yarn install - - - name: Build next.js app - # change this if your site requires a custom build command - run: yarn turbo build From 608cc78966340215281716d28529c217ccb665a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:17:56 +0000 Subject: [PATCH 17/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency?= =?UTF-8?q?=20@react-native-async-storage/async-storage=20to=20v1.19.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7902e41c6..1bd850b58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,13 +1588,13 @@ __metadata: linkType: hard "@react-native-async-storage/async-storage@npm:^1.18.1": - version: 1.19.1 - resolution: "@react-native-async-storage/async-storage@npm:1.19.1" + version: 1.19.2 + resolution: "@react-native-async-storage/async-storage@npm:1.19.2" dependencies: merge-options: ^3.0.4 peerDependencies: react-native: ^0.0.0-0 || 0.60 - 0.72 || 1000.0.0 - checksum: 7367210e16f788999ca8ff96bd04bbd345f44c186cec7c50903d55637f572c73b8a79f9c948a549329ad489c08d77dd49367971691ed54dbc3839285e0194431 + checksum: d2f3b1f7048eb1205ef620aff9f3b26691b69770e9e5f34e84f6fe79ed73c11ea80894d99192f9d78305a8289f7c4e989a0cced1493775d8a32281a6446f2314 languageName: node linkType: hard From a52e110ef453b12257f984db1fa729fe2cc62391 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 20:56:44 +0000 Subject: [PATCH 18/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency?= =?UTF-8?q?=20@types/react=20to=20v18.2.21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1bd850b58..e590903e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2611,13 +2611,13 @@ __metadata: linkType: hard "@types/react@npm:*, @types/react@npm:^18.2.11": - version: 18.2.20 - resolution: "@types/react@npm:18.2.20" + version: 18.2.21 + resolution: "@types/react@npm:18.2.21" dependencies: "@types/prop-types": "*" "@types/scheduler": "*" csstype: ^3.0.2 - checksum: 30f699c60e5e4bfef273ce64d320651cdd60f5c6a08361c6c7eca8cebcccda1ac953d2ee57c9f321b5ae87f8a62c72b6d35ca42df0e261d337849952daab2141 + checksum: ffed203bfe7aad772b8286f7953305c9181ac3a8f27d3f5400fbbc2a8e27ca8e5bbff818ee014f39ca0d19d2b3bb154e5bdbec7e232c6f80b59069375aa78349 languageName: node linkType: hard From b1b12d1906b7022e2423ab4664594916b8144a26 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 23:31:25 +0000 Subject: [PATCH 19/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency?= =?UTF-8?q?=20prettier=20to=20v3.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e590903e0..9de411519 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7941,11 +7941,11 @@ __metadata: linkType: hard "prettier@npm:^3.0.0": - version: 3.0.1 - resolution: "prettier@npm:3.0.1" + version: 3.0.2 + resolution: "prettier@npm:3.0.2" bin: prettier: bin/prettier.cjs - checksum: e1f3f16c7fe0495de3faa182597871f74927d787cce3c52095a66ff5d7eacc05173371d5f58bf12141a0a1b6bfe739a338531d6cf18b92c7256c1319f2c84e73 + checksum: 118b59ddb6c80abe2315ab6d0f4dd1b253be5cfdb20622fa5b65bb1573dcd362e6dd3dcf2711dd3ebfe64aecf7bdc75de8a69dc2422dcd35bdde7610586b677a languageName: node linkType: hard From 02cf4711a43ca4c8a70c3b5ca8ac09761c0257b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 01:23:27 +0000 Subject: [PATCH 20/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency?= =?UTF-8?q?=20video.js=20to=20v8.5.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9de411519..f794c6ac3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2892,21 +2892,21 @@ __metadata: languageName: node linkType: hard -"@videojs/http-streaming@npm:3.3.1": - version: 3.3.1 - resolution: "@videojs/http-streaming@npm:3.3.1" +"@videojs/http-streaming@npm:3.5.3": + version: 3.5.3 + resolution: "@videojs/http-streaming@npm:3.5.3" dependencies: "@babel/runtime": ^7.12.5 "@videojs/vhs-utils": 4.0.0 aes-decrypter: 4.0.1 global: ^4.4.0 - m3u8-parser: ^6.0.0 + m3u8-parser: ^7.1.0 mpd-parser: ^1.1.1 - mux.js: 6.3.0 + mux.js: 7.0.0 video.js: ^7 || ^8 peerDependencies: video.js: ^7 || ^8 - checksum: 8feb13bd075d3c425a5140e559f89dcb1ac3e2918ecc6c7e2738c5834cf36f629bdd76639364d79f217eafc73646f5554b8d06439c665ba1fe612e8a3fb9a112 + checksum: 8150ea62a240219fd6596793882f66c4125f885eb667604086b483d7be91a7e42d29e939eb9a6fa172170705a897b3d294aab7c388f243f4ec8d813d71c003de languageName: node linkType: hard @@ -6936,6 +6936,17 @@ __metadata: languageName: node linkType: hard +"m3u8-parser@npm:^7.1.0": + version: 7.1.0 + resolution: "m3u8-parser@npm:7.1.0" + dependencies: + "@babel/runtime": ^7.12.5 + "@videojs/vhs-utils": ^3.0.5 + global: ^4.4.0 + checksum: c7aa6faaf5ebbbbf4b6afe538da7c583bad8d17c1f80d17d9d17bb03df470d80d2c053620c439df38750b013d155eacfa83014f423f7df3a78acaf2efd2bdb76 + languageName: node + linkType: hard + "magic-string@npm:^0.30.1": version: 0.30.2 resolution: "magic-string@npm:0.30.2" @@ -7297,7 +7308,19 @@ __metadata: languageName: node linkType: hard -"mux.js@npm:6.3.0, mux.js@npm:^6.2.0": +"mux.js@npm:7.0.0": + version: 7.0.0 + resolution: "mux.js@npm:7.0.0" + dependencies: + "@babel/runtime": ^7.11.2 + global: ^4.4.0 + bin: + muxjs-transmux: bin/transmux.js + checksum: 37a8bb469222d26937b45540601afd43c6556d13df98621e34c378c27e99528af019f664f7b61fbf1a5861ed6f96c207db7f6414d0df126c6f512a1e7ed0bfbb + languageName: node + linkType: hard + +"mux.js@npm:^6.2.0": version: 6.3.0 resolution: "mux.js@npm:6.3.0" dependencies: @@ -9977,11 +10000,11 @@ __metadata: linkType: hard "video.js@npm:^7 || ^8, video.js@npm:^8.0.3": - version: 8.5.1 - resolution: "video.js@npm:8.5.1" + version: 8.5.2 + resolution: "video.js@npm:8.5.2" dependencies: "@babel/runtime": ^7.12.5 - "@videojs/http-streaming": 3.3.1 + "@videojs/http-streaming": 3.5.3 "@videojs/vhs-utils": ^4.0.0 "@videojs/xhr": 2.6.0 aes-decrypter: ^4.0.1 @@ -9994,7 +10017,7 @@ __metadata: videojs-contrib-quality-levels: 4.0.0 videojs-font: 4.1.0 videojs-vtt.js: 0.15.5 - checksum: 2ee3b41282f6b1a423d93fdf90f3f0834a948514dc4b36543456643064bf22d300349c6dec4c662da88c86921a5b170cfebda987e8f2d79aff3eb4a8ea51798b + checksum: 2415cd7f08f1cff84c71d0a001455a0f489d9a554180f4cb408f5d83c5f0a32581ac10229b4d2990206ab49ce479f0e049c8627ee081330c55458eeed674bc0a languageName: node linkType: hard From b567dab4b42aa1c42bb810c9cf1add0648da292c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 04:12:36 +0000 Subject: [PATCH 21/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20nextjs=20mo?= =?UTF-8?q?norepo=20to=20v13.4.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 121 +++++++++++++++++++++++++-------------------------- 2 files changed, 60 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index 86fa44b8d..3b5b2f68b 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "i18next": "^22.5.1", "immer": "^10.0.2", "js-file-download": "^0.4.12", - "next": "13.4.10", + "next": "13.4.19", "next-i18next": "^13.0.0", "nzbget-api": "^0.0.3", "prismjs": "^1.29.0", diff --git a/yarn.lock b/yarn.lock index f794c6ac3..4ffdf8c5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1141,89 +1141,89 @@ __metadata: linkType: hard "@next/bundle-analyzer@npm:^13.0.0": - version: 13.4.13 - resolution: "@next/bundle-analyzer@npm:13.4.13" + version: 13.4.19 + resolution: "@next/bundle-analyzer@npm:13.4.19" dependencies: webpack-bundle-analyzer: 4.7.0 - checksum: 2e6f32410fbb98c497a6b52dbd201e35f35c3fc2cbbe935e04559f8dfc9011ccc6bf08608e40a115ac06562a0d14212b347b527729db228ff6db9daa3b238d71 + checksum: 562ff4c21ae0b2a8061b7a5faac282319e8d197678138442151ab0de4af5a6e27b0900b5779d24df5758a9da45c5d5445e1ba3a35ea7507288965fa9fdcec53b languageName: node linkType: hard -"@next/env@npm:13.4.10": - version: 13.4.10 - resolution: "@next/env@npm:13.4.10" - checksum: a3e1ca0fe2e58288a9747a279d168a5d2cdda68bd72174d4c8b6746e5172f261174401d787ec356ac424504f967f0a47bffeffcfdabd6fa73a9e2bd0ff851a73 +"@next/env@npm:13.4.19": + version: 13.4.19 + resolution: "@next/env@npm:13.4.19" + checksum: ace4f82890954ade0164fbe2b7ff988268d2b99b2e80caa6707c51fa4cbfaaa31e48fbbcecd4fd142af3503c544e1b4c91e8185d4af253c8fb46550e9e70ad7e languageName: node linkType: hard -"@next/eslint-plugin-next@npm:13.4.13, @next/eslint-plugin-next@npm:^13.4.5": - version: 13.4.13 - resolution: "@next/eslint-plugin-next@npm:13.4.13" +"@next/eslint-plugin-next@npm:13.4.19, @next/eslint-plugin-next@npm:^13.4.5": + version: 13.4.19 + resolution: "@next/eslint-plugin-next@npm:13.4.19" dependencies: glob: 7.1.7 - checksum: cd1e9c2a2bcda62ac28dc0bb5d19f8d74b31ac85adbd5e101c1c854480bcff3dfc7bc11be12d386898e61f0256e6d8c33022cfcf288a2bd5c4d061ab473c336f + checksum: d60c136e4a8d156b50d4b248eef9918bbf4bd7da293487cdf1f7bc172b07beeae4a2822798942d2f87999af86c53d871ebea592f3d6099ae23a0746d2abf7c73 languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-darwin-arm64@npm:13.4.10" +"@next/swc-darwin-arm64@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-darwin-arm64@npm:13.4.19" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-darwin-x64@npm:13.4.10" +"@next/swc-darwin-x64@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-darwin-x64@npm:13.4.19" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-linux-arm64-gnu@npm:13.4.10" +"@next/swc-linux-arm64-gnu@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-linux-arm64-gnu@npm:13.4.19" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-linux-arm64-musl@npm:13.4.10" +"@next/swc-linux-arm64-musl@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-linux-arm64-musl@npm:13.4.19" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-linux-x64-gnu@npm:13.4.10" +"@next/swc-linux-x64-gnu@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-linux-x64-gnu@npm:13.4.19" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-linux-x64-musl@npm:13.4.10" +"@next/swc-linux-x64-musl@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-linux-x64-musl@npm:13.4.19" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-win32-arm64-msvc@npm:13.4.10" +"@next/swc-win32-arm64-msvc@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-win32-arm64-msvc@npm:13.4.19" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-win32-ia32-msvc@npm:13.4.10" +"@next/swc-win32-ia32-msvc@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-win32-ia32-msvc@npm:13.4.19" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:13.4.10": - version: 13.4.10 - resolution: "@next/swc-win32-x64-msvc@npm:13.4.10" +"@next/swc-win32-x64-msvc@npm:13.4.19": + version: 13.4.19 + resolution: "@next/swc-win32-x64-msvc@npm:13.4.19" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -4796,10 +4796,10 @@ __metadata: linkType: hard "eslint-config-next@npm:^13.4.5": - version: 13.4.13 - resolution: "eslint-config-next@npm:13.4.13" + version: 13.4.19 + resolution: "eslint-config-next@npm:13.4.19" dependencies: - "@next/eslint-plugin-next": 13.4.13 + "@next/eslint-plugin-next": 13.4.19 "@rushstack/eslint-patch": ^1.1.3 "@typescript-eslint/parser": ^5.4.2 || ^6.0.0 eslint-import-resolver-node: ^0.3.6 @@ -4807,14 +4807,14 @@ __metadata: eslint-plugin-import: ^2.26.0 eslint-plugin-jsx-a11y: ^6.5.1 eslint-plugin-react: ^7.31.7 - eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705 + eslint-plugin-react-hooks: ^4.5.0 || 5.0.0-canary-7118f5dd7-20230705 peerDependencies: eslint: ^7.23.0 || ^8.0.0 typescript: ">=3.3.1" peerDependenciesMeta: typescript: optional: true - checksum: 992f98cef6b2c00220ee642df82333b03566042a6c9115a57041884fc22284c6f89f2fc2ea30a1355b73dc3e2124047de2cf64cf1bf5ed041d998f436e98a894 + checksum: 2b2e527facf98326486b2ce806043f41d1f5a969405d2e546d4726462de3fdd05f720ec97d27952abacb09c34e31f3896da05c0c135e65f587376db9ddd71424 languageName: node linkType: hard @@ -4922,7 +4922,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react-hooks@npm:5.0.0-canary-7118f5dd7-20230705": +"eslint-plugin-react-hooks@npm:^4.5.0 || 5.0.0-canary-7118f5dd7-20230705": version: 5.0.0-canary-7118f5dd7-20230705 resolution: "eslint-plugin-react-hooks@npm:5.0.0-canary-7118f5dd7-20230705" peerDependencies: @@ -5935,7 +5935,7 @@ __metadata: i18next: ^22.5.1 immer: ^10.0.2 js-file-download: ^0.4.12 - next: 13.4.10 + next: 13.4.19 next-i18next: ^13.0.0 node-mocks-http: ^1.12.2 nzbget-api: ^0.0.3 @@ -7389,20 +7389,20 @@ __metadata: languageName: node linkType: hard -"next@npm:13.4.10": - version: 13.4.10 - resolution: "next@npm:13.4.10" +"next@npm:13.4.19": + version: 13.4.19 + resolution: "next@npm:13.4.19" dependencies: - "@next/env": 13.4.10 - "@next/swc-darwin-arm64": 13.4.10 - "@next/swc-darwin-x64": 13.4.10 - "@next/swc-linux-arm64-gnu": 13.4.10 - "@next/swc-linux-arm64-musl": 13.4.10 - "@next/swc-linux-x64-gnu": 13.4.10 - "@next/swc-linux-x64-musl": 13.4.10 - "@next/swc-win32-arm64-msvc": 13.4.10 - "@next/swc-win32-ia32-msvc": 13.4.10 - "@next/swc-win32-x64-msvc": 13.4.10 + "@next/env": 13.4.19 + "@next/swc-darwin-arm64": 13.4.19 + "@next/swc-darwin-x64": 13.4.19 + "@next/swc-linux-arm64-gnu": 13.4.19 + "@next/swc-linux-arm64-musl": 13.4.19 + "@next/swc-linux-x64-gnu": 13.4.19 + "@next/swc-linux-x64-musl": 13.4.19 + "@next/swc-win32-arm64-msvc": 13.4.19 + "@next/swc-win32-ia32-msvc": 13.4.19 + "@next/swc-win32-x64-msvc": 13.4.19 "@swc/helpers": 0.5.1 busboy: 1.6.0 caniuse-lite: ^1.0.30001406 @@ -7412,7 +7412,6 @@ __metadata: zod: 3.21.4 peerDependencies: "@opentelemetry/api": ^1.1.0 - fibers: ">= 3.1.0" react: ^18.2.0 react-dom: ^18.2.0 sass: ^1.3.0 @@ -7438,13 +7437,11 @@ __metadata: peerDependenciesMeta: "@opentelemetry/api": optional: true - fibers: - optional: true sass: optional: true bin: next: dist/bin/next - checksum: 823ec02325fc6d5cad055a596df8ba84066d9c259abf94755eeda4c8846e5b56fe244d0362d5f5a1182a29d9a62bebf1f428a2f79c338a07086a8cf3620778f7 + checksum: f4873dab8888ed4dae14d36d7cf8dc54cd042695cf7ee41d05e8757f463d11952a594eb066143cc2f7253ea1d41c6efe681cdc3ab8c2fa6eb0815fa5a94de3dc languageName: node linkType: hard From b5227a6a8c4bc5d1fb1e78d8bf2a24bb4ceaafc0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 06:21:28 +0000 Subject: [PATCH 22/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency?= =?UTF-8?q?=20@tabler/icons-react=20to=20v2.32.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4ffdf8c5b..42cbd8590 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1749,21 +1749,21 @@ __metadata: linkType: hard "@tabler/icons-react@npm:^2.20.0": - version: 2.30.0 - resolution: "@tabler/icons-react@npm:2.30.0" + version: 2.32.0 + resolution: "@tabler/icons-react@npm:2.32.0" dependencies: - "@tabler/icons": 2.30.0 + "@tabler/icons": 2.32.0 prop-types: ^15.7.2 peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 - checksum: 2d137865d24b2034820e5edcb99d938a899b29d31613671d9b574823a614f460d90cdd4efd39c1571b7244225e339a722daddc58921569079b4ed530162354b6 + checksum: 84ad274623ae442ef8d6ff1344f15d4ce804f902eca93a44f0dcf0bf3e89f0c1e5b9b1d1400bf9248afeb1d8a10f6bbef672edb9c509527250ed956669dc7d45 languageName: node linkType: hard -"@tabler/icons@npm:2.30.0": - version: 2.30.0 - resolution: "@tabler/icons@npm:2.30.0" - checksum: d89255ea6bb0a5280f9d23ab85005ef0f7c7c0198904db7d7d6cbc0289c7ba108c433c6f9fb6531fc127619ed61452c6c5832e7c7cc49a5889faad412636e618 +"@tabler/icons@npm:2.32.0": + version: 2.32.0 + resolution: "@tabler/icons@npm:2.32.0" + checksum: e30639cbb88b4a8f7bb8216aa9f34836205d3e09509d3b1acaf526e5cb7cbd61a79f35e694adaf2d63054942a2beca4cdfb14bfb1e1526b7604c66c06cf36f99 languageName: node linkType: hard From e08f1afded24d20ca8f08f237ecf0e3d496f3a84 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:45:25 +0000 Subject: [PATCH 23/24] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency?= =?UTF-8?q?=20@types/node=20to=20v18.17.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3b5b2f68b..e33efadde 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@testing-library/react": "^14.0.0", "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/dockerode": "^3.3.9", - "@types/node": "18.16.19", + "@types/node": "18.17.8", "@types/prismjs": "^1.26.0", "@types/react": "^18.2.11", "@types/uuid": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 42cbd8590..3c9b5e4ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2536,10 +2536,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:18.16.19": - version: 18.16.19 - resolution: "@types/node@npm:18.16.19" - checksum: 63c31f09616508aa7135380a4c79470a897b75f9ff3a70eb069e534dfabdec3f32fb0f9df5939127f1086614d980ddea0fa5e8cc29a49103c4f74cd687618aaf +"@types/node@npm:18.17.8": + version: 18.17.8 + resolution: "@types/node@npm:18.17.8" + checksum: ebb71526368c9c58f03e2c2408bfda4aa686c13d84226e2c9b48d9c4aee244fb82e672aaf4aa8ccb6e4993b4274d5f4b2b3d52d0a2e57ab187ae653903376411 languageName: node linkType: hard @@ -5904,7 +5904,7 @@ __metadata: "@trpc/react-query": ^10.29.1 "@trpc/server": ^10.29.1 "@types/dockerode": ^3.3.9 - "@types/node": 18.16.19 + "@types/node": 18.17.8 "@types/prismjs": ^1.26.0 "@types/react": ^18.2.11 "@types/uuid": ^9.0.0 From 4ddad33128683f754374cf074bec55d0a317b913 Mon Sep 17 00:00:00 2001 From: ajnart Date: Wed, 23 Aug 2023 18:07:56 +0200 Subject: [PATCH 24/24] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Disable=20anti-reloa?= =?UTF-8?q?d=20in=20`dev`=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/header/Actions/ToggleEditMode/ToggleEditMode.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layout/header/Actions/ToggleEditMode/ToggleEditMode.tsx b/src/components/layout/header/Actions/ToggleEditMode/ToggleEditMode.tsx index 3103b8ee4..96db8742e 100644 --- a/src/components/layout/header/Actions/ToggleEditMode/ToggleEditMode.tsx +++ b/src/components/layout/header/Actions/ToggleEditMode/ToggleEditMode.tsx @@ -33,7 +33,7 @@ export const ToggleEditModeAction = () => { useHotkeys([['mod+E', toggleEditMode]]); useWindowEvent('beforeunload', (event: BeforeUnloadEvent) => { - if (enabled) { + if (enabled && process.env.NODE_ENV !== 'development') { // eslint-disable-next-line no-param-reassign event.returnValue = beforeUnloadEventText; return beforeUnloadEventText;
{t('queue.header.name')}{t('queue.header.size')}
- {nzb.state === 'paused' ? ( - - - - - - ) : ( - - - - - - )} - Date: Sat, 12 Aug 2023 23:23:04 +0200 Subject: [PATCH 03/24] fix: allow note only in edit mode --- src/server/api/routers/notebook.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/api/routers/notebook.ts b/src/server/api/routers/notebook.ts index c0df1beb1..d7eb065cb 100644 --- a/src/server/api/routers/notebook.ts +++ b/src/server/api/routers/notebook.ts @@ -12,13 +12,20 @@ export const notebookRouter = createTRPCRouter({ update: publicProcedure .input(z.object({ widgetId: z.string(), content: z.string(), configName: z.string() })) .mutation(async ({ input }) => { + if (!process.env.DISABLE_EDIT_MODE) { + throw new TRPCError({ + code: 'METHOD_NOT_SUPPORTED', + message: 'Edit is not allowed, because edit mode is disabled' + }); + } + const config = getConfig(input.configName); const widget = config.widgets.find((widget) => widget.id === input.widgetId) as | INotebookWidget | undefined; if (!widget) { - return new TRPCError({ + throw new TRPCError({ code: 'BAD_REQUEST', message: 'Specified widget was not found', }); From 81305044309a3d45edbbd53481870a1a56b471b2 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 13 Aug 2023 21:46:19 +0200 Subject: [PATCH 04/24] =?UTF-8?q?=F0=9F=8C=90=20Category=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/layout/common.json | 7 ++++++ .../Wrappers/Category/CategoryEditMenu.tsx | 22 ++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/public/locales/en/layout/common.json b/public/locales/en/layout/common.json index f06543f33..b676bd888 100644 --- a/public/locales/en/layout/common.json +++ b/public/locales/en/layout/common.json @@ -14,5 +14,12 @@ "category": { "openAllInNewTab": "Open all in new tab" } + }, + "menu": { + "moveUp": "Move up", + "moveDown": "Move down", + "addCategory": "Add category", + "addAbove": "above", + "addBelow": "below" } } \ No newline at end of file diff --git a/src/components/Dashboard/Wrappers/Category/CategoryEditMenu.tsx b/src/components/Dashboard/Wrappers/Category/CategoryEditMenu.tsx index fa279766b..2f5557088 100644 --- a/src/components/Dashboard/Wrappers/Category/CategoryEditMenu.tsx +++ b/src/components/Dashboard/Wrappers/Category/CategoryEditMenu.tsx @@ -12,6 +12,7 @@ import { import { useConfigContext } from '../../../../config/provider'; import { CategoryType } from '../../../../types/category'; import { useCategoryActions } from './useCategoryActions'; +import { useTranslation } from 'next-i18next'; interface CategoryEditMenuProps { category: CategoryType; @@ -21,6 +22,7 @@ export const CategoryEditMenu = ({ category }: CategoryEditMenuProps) => { const { name: configName } = useConfigContext(); const { addCategoryAbove, addCategoryBelow, moveCategoryUp, moveCategoryDown, edit, remove } = useCategoryActions(configName, category); + const { t } = useTranslation(['layout/common','common']); return ( @@ -31,24 +33,28 @@ export const CategoryEditMenu = ({ category }: CategoryEditMenuProps) => { } onClick={edit}> - Edit + {t('common:edit')} } onClick={remove}> - Remove + {t('common:remove')} - Change positon + + {t('common:changePosition')} + } onClick={moveCategoryUp}> - Move up + {t('menu.moveUp')} } onClick={moveCategoryDown}> - Move down + {t('menu.moveDown')} - Add category + + {t('menu.addCategory')} + } onClick={addCategoryAbove}> - Add category above + {t('menu.addCategory') + ' ' + t('menu.addAbove')} } onClick={addCategoryBelow}> - Add category below + {t('menu.addCategory') + ' ' + t('menu.addBelow')} From b62b6b9ee7b3e87b55c29d8722e0f1c5eaeae04b Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 13 Aug 2023 21:47:50 +0200 Subject: [PATCH 05/24] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20locale=20on=20Cale?= =?UTF-8?q?ndar=20+=20moment=20to=20dayjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +-- src/pages/_app.tsx | 11 ++++-- src/tools/language.ts | 52 +++++++++++++-------------- src/widgets/calendar/CalendarTile.tsx | 9 +++-- src/widgets/date/DateTile.tsx | 38 +++++++++++--------- yarn.lock | 18 ---------- 6 files changed, 63 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index 4d5538520..86fa44b8d 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,6 @@ "i18next": "^22.5.1", "immer": "^10.0.2", "js-file-download": "^0.4.12", - "moment": "^2.29.4", - "moment-timezone": "^0.5.43", "next": "13.4.10", "next-i18next": "^13.0.0", "nzbget-api": "^0.0.3", @@ -230,4 +228,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index bcfcf4e42..c62bbbee4 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -8,7 +8,9 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client'; import Consola from 'consola'; import { getCookie } from 'cookies-next'; -import moment from 'moment-timezone'; +import dayjs from 'dayjs'; +import locale from 'dayjs/plugin/localeData' +import utc from 'dayjs/plugin/utc' import { GetServerSidePropsContext } from 'next'; import { appWithTranslation } from 'next-i18next'; import { AppProps } from 'next/app'; @@ -39,6 +41,9 @@ import { } from '../tools/server/getPackageVersion'; import { theme } from '../tools/server/theme/theme'; +dayjs.extend(locale); +dayjs.extend(utc); + function App( this: any, props: AppProps<{ @@ -54,8 +59,8 @@ function App( const { Component, pageProps } = props; // TODO: make mapping from our locales to moment locales const language = getLanguageByCode(pageProps.locale); - require('moment/locale/' + language.momentLocale); - moment.locale(language.momentLocale); + require(`dayjs/locale/${language.locale}.js`); + dayjs.locale(language.locale); const [primaryColor, setPrimaryColor] = useState( props.pageProps.config?.settings.customization.colors.primary || 'red' diff --git a/src/tools/language.ts b/src/tools/language.ts index 10978d707..e885e1500 100644 --- a/src/tools/language.ts +++ b/src/tools/language.ts @@ -3,7 +3,7 @@ export type Language = { originalName: string; translatedName: string; emoji: string; - momentLocale: string; + locale: string; }; export const languages: Language[] = [ @@ -12,14 +12,14 @@ export const languages: Language[] = [ originalName: 'Deutsch', translatedName: 'German', emoji: '🇩🇪', - momentLocale: 'de', + locale: 'de', }, { shortName: 'en', originalName: 'English', translatedName: 'English', emoji: '🇬🇧', - momentLocale: 'en-gb', + locale: 'en-gb', }, // Danish { @@ -27,7 +27,7 @@ export const languages: Language[] = [ originalName: 'Dansk', translatedName: 'Danish', emoji: '🇩🇰', - momentLocale: 'da', + locale: 'da', }, // Hebrew { @@ -35,49 +35,49 @@ export const languages: Language[] = [ originalName: 'עברית', translatedName: 'Hebrew', emoji: '🇮🇱', - momentLocale: 'he', + locale: 'he', }, { shortName: 'es', originalName: 'Español', translatedName: 'Spanish', emoji: '🇪🇸', - momentLocale: 'es', + locale: 'es', }, { shortName: 'fr', originalName: 'Français', translatedName: 'French', emoji: '🇫🇷', - momentLocale: 'fr', + locale: 'fr', }, { shortName: 'it', originalName: 'Italiano', translatedName: 'Italian', emoji: '🇮🇹', - momentLocale: 'it', + locale: 'it', }, { shortName: 'ja', originalName: '日本語', translatedName: 'Japanese', emoji: '🇯🇵', - momentLocale: 'ja', + locale: 'ja', }, { shortName: 'ko', originalName: '한국어', translatedName: 'Korean', emoji: '🇰🇷', - momentLocale: 'ko', + locale: 'ko', }, { shortName: 'lol', originalName: 'LOLCAT', translatedName: 'LOLCAT', emoji: '🐱', - momentLocale: 'en-gb', + locale: 'en-gb', }, // Norwegian { @@ -85,7 +85,7 @@ export const languages: Language[] = [ originalName: 'Norsk', translatedName: 'Norwegian', emoji: '🇳🇴', - momentLocale: 'nb', + locale: 'nb', }, // Slovak { @@ -93,42 +93,42 @@ export const languages: Language[] = [ originalName: 'Slovenčina', translatedName: 'Slovak', emoji: '🇸🇰', - momentLocale: 'sk', + locale: 'sk', }, { shortName: 'nl', originalName: 'Nederlands', translatedName: 'Dutch', emoji: '🇳🇱', - momentLocale: 'nl', + locale: 'nl', }, { shortName: 'pl', originalName: 'Polski', translatedName: 'Polish', emoji: '🇵🇱', - momentLocale: 'pl', + locale: 'pl', }, { shortName: 'pt', originalName: 'Português', translatedName: 'Portuguese', emoji: '🇵🇹', - momentLocale: 'pt', + locale: 'pt', }, { shortName: 'ru', originalName: 'Русский', translatedName: 'Russian', emoji: '🇷🇺', - momentLocale: 'ru', + locale: 'ru', }, { shortName: 'sl', originalName: 'Slovenščina', translatedName: 'Slovenian', emoji: '🇸🇮', - momentLocale: 'sl', + locale: 'sl', }, { @@ -136,14 +136,14 @@ export const languages: Language[] = [ originalName: 'Svenska', translatedName: 'Swedish', emoji: '🇸🇪', - momentLocale: 'sv', + locale: 'sv', }, { shortName: 'uk', originalName: 'Українська', translatedName: 'Ukrainian', emoji: '🇺🇦', - momentLocale: 'uk', + locale: 'uk', }, // Vietnamese { @@ -151,42 +151,42 @@ export const languages: Language[] = [ originalName: 'Tiếng Việt', translatedName: 'Vietnamese', emoji: '🇻🇳', - momentLocale: 'vi', + locale: 'vi', }, { shortName: 'zh', originalName: '中文', translatedName: 'Chinese', emoji: '🇨🇳', - momentLocale: 'zh-cn', + locale: 'zh-cn', }, { shortName: 'el', originalName: 'Ελληνικά', translatedName: 'Greek', emoji: '🇬🇷', - momentLocale: 'el', + locale: 'el', }, { shortName: 'tr', originalName: 'Türkçe', translatedName: 'Turkish', emoji: '🇹🇷', - momentLocale: 'tr', + locale: 'tr', }, { shortName: 'lv', originalName: 'Latvian', translatedName: 'Latvian', emoji: '🇱🇻', - momentLocale: 'lv', + locale: 'lv', }, { shortName: 'hr', originalName: 'Hrvatski', translatedName: 'Croatian', emoji: '🇭🇷', - momentLocale: 'hr', + locale: 'hr', }, ]; diff --git a/src/widgets/calendar/CalendarTile.tsx b/src/widgets/calendar/CalendarTile.tsx index ec421e191..bf1016968 100644 --- a/src/widgets/calendar/CalendarTile.tsx +++ b/src/widgets/calendar/CalendarTile.tsx @@ -1,8 +1,9 @@ import { useMantineTheme } from '@mantine/core'; import { Calendar } from '@mantine/dates'; import { IconCalendarTime } from '@tabler/icons-react'; -import { i18n } from 'next-i18next'; import { useState } from 'react'; +import { useRouter } from 'next/router'; +import { getLanguageByCode } from '~/tools/language'; import { api } from '~/utils/api'; import { useEditModeStore } from '../../components/Dashboard/Views/useEditModeStore'; @@ -66,11 +67,15 @@ interface CalendarTileProps { } function CalendarTile({ widget }: CalendarTileProps) { + const { locale } = useRouter(); const { colorScheme, radius } = useMantineTheme(); const { name: configName } = useConfigContext(); const [month, setMonth] = useState(new Date()); const isEditMode = useEditModeStore((x) => x.enabled); + const language = getLanguageByCode(locale ?? 'en'); + require(`dayjs/locale/${language.locale}.js`); + const { data: medias } = api.calendar.medias.useQuery( { configName: configName!, @@ -90,7 +95,7 @@ function CalendarTile({ widget }: CalendarTileProps) { onPreviousMonth={setMonth} onNextMonth={setMonth} size={widget.properties.fontSize} - locale={i18n?.resolvedLanguage ?? 'en'} + locale={language.locale} firstDayOfWeek={widget.properties.sundayStart ? 0 : 1} hideWeekdays={widget.properties.hideWeekDays} style={{ position: 'relative' }} diff --git a/src/widgets/date/DateTile.tsx b/src/widgets/date/DateTile.tsx index c9ea0d645..faa479ed9 100644 --- a/src/widgets/date/DateTile.tsx +++ b/src/widgets/date/DateTile.tsx @@ -1,16 +1,21 @@ import { Stack, Text, createStyles } from '@mantine/core'; import { useElementSize } from '@mantine/hooks'; import { IconClock } from '@tabler/icons-react'; -import moment from 'moment-timezone'; import { useRouter } from 'next/router'; import { useEffect, useRef, useState } from 'react'; import { getLanguageByCode } from '~/tools/language'; import { api } from '~/utils/api'; +import dayjs from 'dayjs'; +import timezones from 'dayjs/plugin/timezone' +import utc from 'dayjs/plugin/utc' import { useSetSafeInterval } from '../../hooks/useSetSafeInterval'; import { defineWidget } from '../helper'; import { IWidget } from '../widgets'; +dayjs.extend(utc); +dayjs.extend(timezones); + const definition = defineWidget({ id: 'date', icon: IconClock, @@ -24,14 +29,14 @@ const definition = defineWidget({ defaultValue: 'dddd, MMMM D', data: () => [ { value: 'hide' }, - { value: 'dddd, MMMM D', label: moment().format('dddd, MMMM D') }, - { value: 'dddd, D MMMM', label: moment().format('dddd, D MMMM') }, - { value: 'MMM D', label: moment().format('MMM D') }, - { value: 'D MMM', label: moment().format('D MMM') }, - { value: 'DD/MM/YYYY', label: moment().format('DD/MM/YYYY') }, - { value: 'MM/DD/YYYY', label: moment().format('MM/DD/YYYY') }, - { value: 'DD/MM', label: moment().format('DD/MM') }, - { value: 'MM/DD', label: moment().format('MM/DD') }, + { value: 'dddd, MMMM D', label: dayjs().format('dddd, MMMM D') }, + { value: 'dddd, D MMMM', label: dayjs().format('dddd, D MMMM') }, + { value: 'MMM D', label: dayjs().format('MMM D') }, + { value: 'D MMM', label: dayjs().format('D MMM') }, + { value: 'DD/MM/YYYY', label: dayjs().format('DD/MM/YYYY') }, + { value: 'MM/DD/YYYY', label: dayjs().format('MM/DD/YYYY') }, + { value: 'DD/MM', label: dayjs().format('DD/MM') }, + { value: 'MM/DD', label: dayjs().format('MM/DD') }, ], }, enableTimezone: { @@ -84,11 +89,11 @@ function DateTile({ widget }: DateTileProps) { className={cx(classes.extras, 'dashboard-tile-clock-city')} > {widget.properties.timezoneLocation.name} - {widget.properties.titleState === 'both' && moment(date).format(' (z)')} + {widget.properties.titleState === 'both' && dayjs(date).format(' (z)')} )} - {moment(date).format(formatString)} + {dayjs(date).format(formatString)} {!widget.properties.dateFormat.includes('hide') && ( - {moment(date).format(widget.properties.dateFormat)} + {dayjs(date).format(widget.properties.dateFormat)} )} @@ -139,7 +144,7 @@ const useDateState = (location?: { latitude: number; longitude: number }) => { const timeoutRef = useRef(); // reference for initial timeout until first minute change useEffect(() => { const language = getLanguageByCode(locale ?? 'en'); - moment.locale(language.momentLocale); + dayjs.locale(language.locale); setDate(getNewDate(timezone)); timeoutRef.current = setTimeout( () => { @@ -150,9 +155,8 @@ const useDateState = (location?: { latitude: number; longitude: number }) => { }, 1000 * 60); //1 minute - current seconds and milliseconds count }, - 1000 * 60 - (1000 * moment().seconds() + moment().milliseconds()) + 1000 * 60 - (1000 * dayjs().second() + dayjs().millisecond()) ); - return () => timeoutRef.current && clearTimeout(timeoutRef.current); }, [timezone, locale]); @@ -162,9 +166,9 @@ const useDateState = (location?: { latitude: number; longitude: number }) => { //Returns a local date if no inputs or returns date from input zone const getNewDate = (timezone?: string) => { if (timezone) { - return moment().tz(timezone); + return dayjs().tz(timezone); } - return moment(); + return dayjs(); }; export default definition; diff --git a/yarn.lock b/yarn.lock index ccf3a52cb..7902e41c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5935,8 +5935,6 @@ __metadata: i18next: ^22.5.1 immer: ^10.0.2 js-file-download: ^0.4.12 - moment: ^2.29.4 - moment-timezone: ^0.5.43 next: 13.4.10 next-i18next: ^13.0.0 node-mocks-http: ^1.12.2 @@ -7254,22 +7252,6 @@ __metadata: languageName: node linkType: hard -"moment-timezone@npm:^0.5.43": - version: 0.5.43 - resolution: "moment-timezone@npm:0.5.43" - dependencies: - moment: ^2.29.4 - checksum: 8075c897ed8a044f992ef26fe8cdbcad80caf974251db424cae157473cca03be2830de8c74d99341b76edae59f148c9d9d19c1c1d9363259085688ec1cf508d0 - languageName: node - linkType: hard - -"moment@npm:^2.29.4": - version: 2.29.4 - resolution: "moment@npm:2.29.4" - checksum: 0ec3f9c2bcba38dc2451b1daed5daded747f17610b92427bebe1d08d48d8b7bdd8d9197500b072d14e326dd0ccf3e326b9e3d07c5895d3d49e39b6803b76e80e - languageName: node - linkType: hard - "mpd-parser@npm:^1.0.1, mpd-parser@npm:^1.1.1": version: 1.1.1 resolution: "mpd-parser@npm:1.1.1" From 7c898379e89d03247fdcafbfa9694cd556530f50 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sun, 13 Aug 2023 22:10:59 +0200 Subject: [PATCH 06/24] =?UTF-8?q?=F0=9F=8C=90=20About=20keybind=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/layout/modals/about.json | 7 +++++++ src/components/Dashboard/Modals/AboutModal/AboutModal.tsx | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/public/locales/en/layout/modals/about.json b/public/locales/en/layout/modals/about.json index 83109b624..01a8f5d09 100644 --- a/public/locales/en/layout/modals/about.json +++ b/public/locales/en/layout/modals/about.json @@ -6,6 +6,12 @@ "key": "Shortcut key", "action": "Action", "keybinds": "Keybinds", + "actions": { + "toggleTheme": "Toggle light/dark mode", + "focusSearchBar": "Focus on search bar", + "openDocker": "Open docker Widget", + "toggleEdit": "Toggle Edit Mode" + }, "metrics": { "configurationSchemaVersion": "Configuration schema version", "configurationsCount": "Available configurations", @@ -15,4 +21,5 @@ "locales": "Configured I18n locales", "experimental_disableEditMode": "EXPERIMENTAL: Disable edit mode" } + } \ No newline at end of file diff --git a/src/components/Dashboard/Modals/AboutModal/AboutModal.tsx b/src/components/Dashboard/Modals/AboutModal/AboutModal.tsx index c5c70e641..64174046d 100644 --- a/src/components/Dashboard/Modals/AboutModal/AboutModal.tsx +++ b/src/components/Dashboard/Modals/AboutModal/AboutModal.tsx @@ -55,10 +55,10 @@ export const AboutModal = ({ opened, closeModal, newVersionAvailable }: AboutMod const { t } = useTranslation(['common', 'layout/modals/about']); const keybinds = [ - { key: 'Mod + J', shortcut: 'Toggle light/dark mode' }, - { key: 'Mod + K', shortcut: 'Focus on search bar' }, - { key: 'Mod + B', shortcut: 'Open docker widget' }, - { key: 'Mod + E', shortcut: 'Toggle Edit mode' }, + { key: 'Mod + J', shortcut: t('layout/modals/about:actions.toggleTheme') }, + { key: 'Mod + K', shortcut: t('layout/modals/about:actions.focusSearchBar') }, + { key: 'Mod + B', shortcut: t('layout/modals/about:actions.openDocker') }, + { key: 'Mod + E', shortcut: t('layout/modals/about:actions.toggleEdit') }, ]; const rows = keybinds.map((element) => (