Skip to content

Commit

Permalink
New: Show artist names after task name when applicable
Browse files Browse the repository at this point in the history
(cherry picked from commit 6d552f2a60f44052079b5e8944f5e1bbabac56e0)

Closes #4678
  • Loading branch information
markus101 authored and mynameisbogdan committed Mar 14, 2024
1 parent b81170d commit 873a225
Show file tree
Hide file tree
Showing 17 changed files with 419 additions and 459 deletions.
2 changes: 2 additions & 0 deletions frontend/src/App/State/AppState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AlbumAppState from './AlbumAppState';
import ArtistAppState, { ArtistIndexAppState } from './ArtistAppState';
import CalendarAppState from './CalendarAppState';
import CommandAppState from './CommandAppState';
import HistoryAppState from './HistoryAppState';
import QueueAppState from './QueueAppState';
import SettingsAppState from './SettingsAppState';
Expand Down Expand Up @@ -54,6 +55,7 @@ interface AppState {
artist: ArtistAppState;
artistIndex: ArtistIndexAppState;
calendar: CalendarAppState;
commands: CommandAppState;
history: HistoryAppState;
queue: QueueAppState;
settings: SettingsAppState;
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/App/State/CommandAppState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import AppSectionState from 'App/State/AppSectionState';
import Command from 'Commands/Command';

export type CommandAppState = AppSectionState<Command>;

export default CommandAppState;
1 change: 1 addition & 0 deletions frontend/src/Commands/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface CommandBody {
trigger: string;
suppressMessages: boolean;
artistId?: number;
artistIds?: number[];
}

interface Command extends ModelBase {
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/Helpers/Hooks/useModalOpenState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useCallback, useState } from 'react';

export default function useModalOpenState(
initialState: boolean
): [boolean, () => void, () => void] {
const [isOpen, setOpen] = useState(initialState);

const setModalOpen = useCallback(() => {
setOpen(true);
}, [setOpen]);

const setModalClosed = useCallback(() => {
setOpen(false);
}, [setOpen]);

return [isOpen, setModalOpen, setModalClosed];
}
14 changes: 14 additions & 0 deletions frontend/src/Store/Selectors/createMultiArtistsSelector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createSelector } from 'reselect';
import AppState from 'App/State/AppState';

function createMultiArtistsSelector(artistIds: number[]) {
return createSelector(
(state: AppState) => state.artist.itemMap,
(state: AppState) => state.artist.items,
(itemMap, allArtists) => {
return artistIds.map((artistId) => allArtists[itemMap[artistId]]);
}
);
}

export default createMultiArtistsSelector;
9 changes: 0 additions & 9 deletions frontend/src/System/Tasks/Queued/QueuedTaskRow.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
width: 100%;
}

.commandName {
display: inline-block;
min-width: 220px;
}

.userAgent {
color: #b0b0b0;
}

.queued,
.started,
.ended {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/System/Tasks/Queued/QueuedTaskRow.css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
// Please do not change this file!
interface CssExports {
'actions': string;
'commandName': string;
'duration': string;
'ended': string;
'queued': string;
'started': string;
'trigger': string;
'triggerContent': string;
'userAgent': string;
}
export const cssExports: CssExports;
export default cssExports;
279 changes: 0 additions & 279 deletions frontend/src/System/Tasks/Queued/QueuedTaskRow.js

This file was deleted.

0 comments on commit 873a225

Please sign in to comment.