parent
0e1138cba1
commit
e19ebeffaa
10 changed files with 184 additions and 73 deletions
@ -1,13 +1,13 @@ |
||||
import React, { useEffect, useState } from 'react'; |
||||
import { Box, Typography, IconButton, CircularProgress } from '@material-ui/core'; |
||||
import AlbumIcon from '@material-ui/icons/Album'; |
||||
import * as serverApi from '../../api'; |
||||
import { WindowState } from './Windows'; |
||||
import StoreLinkIcon, { whichStore } from '../common/StoreLinkIcon'; |
||||
import EditableText from '../common/EditableText'; |
||||
import SubmitChangesButton from '../common/SubmitChangesButton'; |
||||
import SongTable, { SongGetters } from '../tables/ResultsTable'; |
||||
import { saveAlbumChanges } from '../../lib/saveChanges'; |
||||
import * as serverApi from '../../../api'; |
||||
import { WindowState } from '../Windows'; |
||||
import StoreLinkIcon, { whichStore } from '../../common/StoreLinkIcon'; |
||||
import EditableText from '../../common/EditableText'; |
||||
import SubmitChangesButton from '../../common/SubmitChangesButton'; |
||||
import SongTable, { SongGetters } from '../../tables/ResultsTable'; |
||||
import { saveAlbumChanges } from '../../../lib/saveChanges'; |
||||
var _ = require('lodash'); |
||||
|
||||
export type AlbumMetadata = serverApi.AlbumDetails; |
@ -1,13 +1,13 @@ |
||||
import React, { useEffect, useState } from 'react'; |
||||
import { Box, Typography, IconButton, Button, CircularProgress } from '@material-ui/core'; |
||||
import PersonIcon from '@material-ui/icons/Person'; |
||||
import * as serverApi from '../../api'; |
||||
import { WindowState } from './Windows'; |
||||
import StoreLinkIcon, { whichStore } from '../common/StoreLinkIcon'; |
||||
import EditableText from '../common/EditableText'; |
||||
import SubmitChangesButton from '../common/SubmitChangesButton'; |
||||
import SongTable, { SongGetters } from '../tables/ResultsTable'; |
||||
import { saveArtistChanges } from '../../lib/saveChanges'; |
||||
import * as serverApi from '../../../api'; |
||||
import { WindowState } from '../Windows'; |
||||
import StoreLinkIcon, { whichStore } from '../../common/StoreLinkIcon'; |
||||
import EditableText from '../../common/EditableText'; |
||||
import SubmitChangesButton from '../../common/SubmitChangesButton'; |
||||
import SongTable, { SongGetters } from '../../tables/ResultsTable'; |
||||
import { saveArtistChanges } from '../../../lib/saveChanges'; |
||||
var _ = require('lodash'); |
||||
|
||||
export type ArtistMetadata = serverApi.ArtistDetails; |
@ -0,0 +1,61 @@ |
||||
import React, { useState } from 'react'; |
||||
import { Menu, MenuItem, TextField, Input } from '@material-ui/core'; |
||||
import NestedMenuItem from "material-ui-nested-menu-item"; |
||||
|
||||
export function MenuEditText(props: { |
||||
label: string, |
||||
onSubmit: (s: string) => void, |
||||
}) { |
||||
const [input, setInput] = useState(""); |
||||
|
||||
return <TextField |
||||
label={props.label} |
||||
variant="outlined" |
||||
value={input} |
||||
onChange={(e: any) => setInput(e.target.value)} |
||||
onKeyDown={(e: any) => { |
||||
// Prevent the event from propagating, because
|
||||
// that would trigger keyboard navigation of the menu.
|
||||
e.stopPropagation(); |
||||
if (e.key === 'Enter') { |
||||
// User submitted free-form value.
|
||||
props.onSubmit(input); |
||||
} |
||||
}} |
||||
/> |
||||
} |
||||
|
||||
export interface IProps { |
||||
anchorEl: null | HTMLElement, |
||||
onClose: () => void, |
||||
onRename: (s: string) => void, |
||||
tag: any, |
||||
} |
||||
|
||||
export default function ManageTagMenu(props: IProps) { |
||||
const anchorEl = props.anchorEl; |
||||
|
||||
const onRename = (name: string) => { |
||||
|
||||
} |
||||
|
||||
return <Menu |
||||
anchorEl={anchorEl} |
||||
keepMounted |
||||
open={Boolean(props.anchorEl)} |
||||
onClose={props.onClose} |
||||
> |
||||
<NestedMenuItem |
||||
parentMenuOpen={Boolean(anchorEl)} |
||||
label="Rename" |
||||
> |
||||
<MenuEditText |
||||
label="New name" |
||||
onSubmit={(s: string) => { |
||||
props.onClose(); |
||||
props.onRename(s); |
||||
}} |
||||
/> |
||||
</NestedMenuItem> |
||||
</Menu> |
||||
} |
@ -1,13 +1,13 @@ |
||||
import React, { useEffect } from 'react'; |
||||
import { createMuiTheme, Box, LinearProgress } from '@material-ui/core'; |
||||
import { QueryElem, toApiQuery } from '../../lib/query/Query'; |
||||
import QueryBuilder from '../querybuilder/QueryBuilder'; |
||||
import * as serverApi from '../../api'; |
||||
import SongTable from '../tables/ResultsTable'; |
||||
import { songGetters } from '../../lib/songGetters'; |
||||
import { getArtists, getSongTitles, getAlbums, getTags } from '../../lib/query/Getters'; |
||||
import { QueryElem, toApiQuery } from '../../../lib/query/Query'; |
||||
import QueryBuilder from '../../querybuilder/QueryBuilder'; |
||||
import * as serverApi from '../../../api'; |
||||
import SongTable from '../../tables/ResultsTable'; |
||||
import { songGetters } from '../../../lib/songGetters'; |
||||
import { getArtists, getSongTitles, getAlbums, getTags } from '../../../lib/query/Getters'; |
||||
import { grey } from '@material-ui/core/colors'; |
||||
import { WindowState } from './Windows'; |
||||
import { WindowState } from '../Windows'; |
||||
var _ = require('lodash'); |
||||
|
||||
const darkTheme = createMuiTheme({ |
@ -1,13 +1,13 @@ |
||||
import React, { useEffect, useState } from 'react'; |
||||
import { Box, Typography, IconButton, CircularProgress } from '@material-ui/core'; |
||||
import LocalOfferIcon from '@material-ui/icons/LocalOffer'; |
||||
import * as serverApi from '../../api'; |
||||
import { WindowState } from './Windows'; |
||||
import StoreLinkIcon, { whichStore } from '../common/StoreLinkIcon'; |
||||
import EditableText from '../common/EditableText'; |
||||
import SubmitChangesButton from '../common/SubmitChangesButton'; |
||||
import SongTable, { SongGetters } from '../tables/ResultsTable'; |
||||
import { saveTagChanges } from '../../lib/saveChanges'; |
||||
import * as serverApi from '../../../api'; |
||||
import { WindowState } from '../Windows'; |
||||
import StoreLinkIcon, { whichStore } from '../../common/StoreLinkIcon'; |
||||
import EditableText from '../../common/EditableText'; |
||||
import SubmitChangesButton from '../../common/SubmitChangesButton'; |
||||
import SongTable, { SongGetters } from '../../tables/ResultsTable'; |
||||
import { saveTagChanges } from '../../../lib/saveChanges'; |
||||
var _ = require('lodash'); |
||||
|
||||
export interface FullTagMetadata extends serverApi.TagDetails { |
Loading…
Reference in new issue