-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Show author names after task name when applicable
(cherry picked from commit 6d552f2a60f44052079b5e8944f5e1bbabac56e0) Closes #3361
- Loading branch information
1 parent
77f1e8f
commit 93ee466
Showing
19 changed files
with
494 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import AppSectionState, { | ||
AppSectionDeleteState, | ||
AppSectionSaveState, | ||
} from 'App/State/AppSectionState'; | ||
import Author from 'Author/Author'; | ||
|
||
interface AuthorsAppState | ||
extends AppSectionState<Author>, | ||
AppSectionDeleteState, | ||
AppSectionSaveState { | ||
itemMap: Record<number, number>; | ||
|
||
deleteOptions: { | ||
addImportListExclusion: boolean; | ||
}; | ||
} | ||
|
||
export default AuthorsAppState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import ModelBase from 'App/ModelBase'; | ||
|
||
interface Author extends ModelBase { | ||
added: string; | ||
genres: string[]; | ||
monitored: boolean; | ||
overview: string; | ||
path: string; | ||
qualityProfileId: number; | ||
metadataProfileId: number; | ||
rootFolderPath: string; | ||
sortName: string; | ||
tags: number[]; | ||
authorName: string; | ||
isSaving?: boolean; | ||
} | ||
|
||
export default Author; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import ModelBase from 'App/ModelBase'; | ||
|
||
export interface CommandBody { | ||
sendUpdatesToClient: boolean; | ||
updateScheduledTask: boolean; | ||
completionMessage: string; | ||
requiresDiskAccess: boolean; | ||
isExclusive: boolean; | ||
isLongRunning: boolean; | ||
name: string; | ||
lastExecutionTime: string; | ||
lastStartTime: string; | ||
trigger: string; | ||
suppressMessages: boolean; | ||
authorId?: number; | ||
authorIds?: number[]; | ||
} | ||
|
||
interface Command extends ModelBase { | ||
name: string; | ||
commandName: string; | ||
message: string; | ||
body: CommandBody; | ||
priority: string; | ||
status: string; | ||
result: string; | ||
queued: string; | ||
started: string; | ||
ended: string; | ||
duration: string; | ||
trigger: string; | ||
stateChangeTime: string; | ||
sendUpdatesToClient: boolean; | ||
updateScheduledTask: boolean; | ||
lastExecutionTime: string; | ||
} | ||
|
||
export default Command; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
14
frontend/src/Store/Selectors/createMultiAuthorsSelector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 createMultiAuthorsSelector(authorIds: number[]) { | ||
return createSelector( | ||
(state: AppState) => state.authors.itemMap, | ||
(state: AppState) => state.authors.items, | ||
(itemMap, allAuthors) => { | ||
return authorIds.map((authorId) => allAuthors[itemMap[authorId]]); | ||
} | ||
); | ||
} | ||
|
||
export default createMultiAuthorsSelector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.