mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 04:50:12 +02:00
add support for full playlist re-order (#1327)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { Modal as MantineModal, ModalProps as MantineModalProps } from '@mantine/core';
|
||||
import { closeAllModals, ContextModalProps } from '@mantine/modals';
|
||||
import {
|
||||
closeAllModals as closeAllModalsMantine,
|
||||
ContextModalProps,
|
||||
ModalsProvider as MantineModalsProvider,
|
||||
ModalsProviderProps as MantineModalsProviderProps,
|
||||
openModal as openModalMantine,
|
||||
} from '@mantine/modals';
|
||||
import React, { ReactNode } from 'react';
|
||||
|
||||
@@ -15,6 +17,10 @@ import { Icon } from '/@/shared/components/icon/icon';
|
||||
import { ScrollArea } from '/@/shared/components/scroll-area/scroll-area';
|
||||
import { Stack } from '/@/shared/components/stack/stack';
|
||||
|
||||
export const openModal = openModalMantine;
|
||||
|
||||
export const closeAllModals = closeAllModalsMantine;
|
||||
|
||||
export interface ModalProps extends Omit<MantineModalProps, 'onClose'> {
|
||||
children?: ReactNode;
|
||||
handlers: {
|
||||
@@ -106,7 +112,7 @@ export const ConfirmModal = ({
|
||||
<Stack>
|
||||
<Flex>{children}</Flex>
|
||||
<Group justify="flex-end">
|
||||
<Button onClick={handleCancel} variant="default">
|
||||
<Button disabled={loading} onClick={handleCancel} variant="default">
|
||||
{labels?.cancel ? labels.cancel : 'Cancel'}
|
||||
</Button>
|
||||
<Button
|
||||
|
||||
@@ -957,6 +957,22 @@ export type RemoveFromPlaylistQuery = {
|
||||
// Remove from playlist
|
||||
export type RemoveFromPlaylistResponse = null | undefined;
|
||||
|
||||
export type ReplacePlaylistArgs = BaseEndpointArgs & {
|
||||
body: ReplacePlaylistBody;
|
||||
query: ReplacePlaylistQuery;
|
||||
};
|
||||
|
||||
export type ReplacePlaylistBody = {
|
||||
songId: string[];
|
||||
};
|
||||
|
||||
export type ReplacePlaylistQuery = {
|
||||
id: string;
|
||||
};
|
||||
|
||||
// Replace playlist
|
||||
export type ReplacePlaylistResponse = null | undefined;
|
||||
|
||||
export type SetRatingArgs = BaseEndpointArgs & { query: RatingQuery };
|
||||
|
||||
export type ShareItemArgs = BaseEndpointArgs & { body: ShareItemBody };
|
||||
@@ -1284,6 +1300,7 @@ export type ControllerEndpoint = {
|
||||
getUserList?: (args: UserListArgs) => Promise<UserListResponse>;
|
||||
movePlaylistItem?: (args: MoveItemArgs) => Promise<void>;
|
||||
removeFromPlaylist: (args: RemoveFromPlaylistArgs) => Promise<RemoveFromPlaylistResponse>;
|
||||
replacePlaylist: (args: ReplacePlaylistArgs) => Promise<ReplacePlaylistResponse>;
|
||||
scrobble: (args: ScrobbleArgs) => Promise<ScrobbleResponse>;
|
||||
search: (args: SearchArgs) => Promise<SearchResponse>;
|
||||
setRating?: (args: SetRatingArgs) => Promise<RatingResponse>;
|
||||
@@ -1379,6 +1396,9 @@ export type InternalControllerEndpoint = {
|
||||
removeFromPlaylist: (
|
||||
args: ReplaceApiClientProps<RemoveFromPlaylistArgs>,
|
||||
) => Promise<RemoveFromPlaylistResponse>;
|
||||
replacePlaylist: (
|
||||
args: ReplaceApiClientProps<ReplacePlaylistArgs>,
|
||||
) => Promise<ReplacePlaylistResponse>;
|
||||
scrobble: (args: ReplaceApiClientProps<ScrobbleArgs>) => Promise<ScrobbleResponse>;
|
||||
search: (args: ReplaceApiClientProps<SearchArgs>) => Promise<SearchResponse>;
|
||||
setRating?: (args: ReplaceApiClientProps<SetRatingArgs>) => Promise<RatingResponse>;
|
||||
|
||||
@@ -177,6 +177,7 @@ export enum TableColumn {
|
||||
OWNER = 'username',
|
||||
PATH = 'path',
|
||||
PLAY_COUNT = 'playCount',
|
||||
PLAYLIST_REORDER = 'playlistReorder',
|
||||
RELEASE_DATE = 'releaseDate',
|
||||
ROW_INDEX = 'rowIndex',
|
||||
SIZE = 'size',
|
||||
|
||||
Reference in New Issue
Block a user