From 475cd2cf2f33d246be2bdbb8d1ac712780c6e85f Mon Sep 17 00:00:00 2001 From: Sander Vocke Date: Sat, 12 Sep 2020 16:46:34 +0200 Subject: [PATCH] Songs now also supported, fixed bug --- client/src/components/Window.tsx | 4 +- .../querybuilder/QBQueryLeafElem.tsx | 37 ++++++++++++++++--- client/src/lib/Query.tsx | 9 +++++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/client/src/components/Window.tsx b/client/src/components/Window.tsx index 49b0bc7..e022e92 100644 --- a/client/src/components/Window.tsx +++ b/client/src/components/Window.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { ThemeProvider, CssBaseline, createMuiTheme } from '@material-ui/core'; -import { QueryLeafElem, QueryLeafBy, QueryLeafOp, QueryElem, QueryNodeElem, queryOr, queryAnd } from '../lib/Query'; +import { QueryElem } from '../lib/Query'; import QueryBuilder from './querybuilder/QueryBuilder'; const darkTheme = createMuiTheme({ @@ -12,6 +12,8 @@ const darkTheme = createMuiTheme({ export default function Window(props: any) { const [query, setQuery] = useState(null); + console.log("Query:", query); + return {props.label} + return +} + export interface LeafProps { elem: QueryLeafElem onReplace: (q: QueryElem) => void } export function QBQueryElemArtistEquals(props: LeafProps) { - let e = props.elem; + return +} - const label = - By {e.b} - ; +export function QBQueryElemArtistLike(props: LeafProps) { + return +} - return +export function QBQueryElemTitleEquals(props: LeafProps) { + return +} + +export function QBQueryElemTitleLike(props: LeafProps) { + return } export function QBQueryLeafElem(props: LeafProps) { @@ -25,6 +40,18 @@ export function QBQueryLeafElem(props: LeafProps) { e.leafOp == QueryLeafOp.Equals && typeof e.b == "string") { return + } else if (e.a == QueryLeafBy.ArtistName && + e.leafOp == QueryLeafOp.Like && + typeof e.b == "string") { + return + } if (e.a == QueryLeafBy.SongTitle && + e.leafOp == QueryLeafOp.Equals && + typeof e.b == "string") { + return + } else if (e.a == QueryLeafBy.SongTitle && + e.leafOp == QueryLeafOp.Like && + typeof e.b == "string") { + return } else if (e.leafOp == QueryLeafOp.Placeholder) { return