cleanup: merge types & add graphql-codegen-cli

This commit is contained in:
Jordan Knott
2020-04-09 22:27:57 -05:00
parent 9611105364
commit 0766565dc7
21 changed files with 2336 additions and 326 deletions

View File

@ -33,8 +33,8 @@ export const Default = () => {
const $ref = useRef<HTMLDivElement>(null);
return (
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description=""
ref={$ref}
title="Hello, world"
@ -48,8 +48,8 @@ export const Labels = () => {
const $ref = useRef<HTMLDivElement>(null);
return (
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description=""
ref={$ref}
title="Hello, world"
@ -64,8 +64,8 @@ export const Badges = () => {
const $ref = useRef<HTMLDivElement>(null);
return (
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$ref}
title="Hello, world"
@ -82,8 +82,8 @@ export const PastDue = () => {
const $ref = useRef<HTMLDivElement>(null);
return (
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$ref}
title="Hello, world"
@ -100,8 +100,8 @@ export const Everything = () => {
const $ref = useRef<HTMLDivElement>(null);
return (
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$ref}
title="Hello, world"

View File

@ -33,8 +33,8 @@ type Checklist = {
type Props = {
title: string;
description: string;
cardId: string;
listId: string;
taskID: string;
taskGroupID: string;
onContextMenu: (e: ContextMenuEvent) => void;
onClick: (e: React.MouseEvent<HTMLDivElement>) => void;
dueDate?: DueDate;
@ -49,8 +49,8 @@ const Card = React.forwardRef(
{
wrapperProps,
onContextMenu,
cardId,
listId,
taskID,
taskGroupID,
onClick,
labels,
title,
@ -69,8 +69,8 @@ const Card = React.forwardRef(
onContextMenu({
top: pos.top,
left: pos.left,
listId,
cardId,
taskGroupID,
taskID,
});
}
};

View File

@ -35,8 +35,8 @@ const createCard = () => {
const $ref = createRef<HTMLDivElement>();
return (
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$ref}
title="Hello, world"
@ -113,8 +113,8 @@ export const WithCard = () => {
>
<ListCards>
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$cardRef}
title="Hello, world"
@ -151,8 +151,8 @@ export const WithCardAndComposer = () => {
>
<ListCards>
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$cardRef}
title="Hello, world"

View File

@ -53,7 +53,7 @@ interface Columns {
[key: string]: TaskGroup;
}
interface Tasks {
[key: string]: RemoteTask;
[key: string]: Task;
}
type Props = {
@ -139,7 +139,7 @@ const Lists = ({ columns, tasks, onCardDrop, onListDrop, onCardCreate, onQuickEd
<Droppable type="tasks" droppableId={column.taskGroupID}>
{columnDropProvided => (
<ListCards ref={columnDropProvided.innerRef} {...columnDropProvided.droppableProps}>
{columnCards.map((task: RemoteTask, taskIndex: any) => {
{columnCards.map((task: Task, taskIndex: any) => {
return (
<Draggable key={task.taskID} draggableId={task.taskID} index={taskIndex}>
{taskProvided => {
@ -150,8 +150,8 @@ const Lists = ({ columns, tasks, onCardDrop, onListDrop, onCardCreate, onQuickEd
...taskProvided.dragHandleProps,
}}
ref={taskProvided.innerRef}
cardId={task.taskID}
listId={column.taskGroupID}
taskID={task.taskID}
taskGroupID={column.taskGroupID}
description=""
title={task.name}
labels={task.labels}

View File

@ -42,8 +42,8 @@ export const Default = () => {
{isEditorOpen && (
<QuickCardEditor
isOpen={isEditorOpen}
listId="1"
cardId="1"
taskGroupID="1"
taskID="1"
cardTitle="Hello, world"
onCloseEditor={() => setEditorOpen(false)}
onEditCard={action('edit card')}
@ -64,8 +64,8 @@ export const Default = () => {
>
<ListCards>
<Card
cardId="1"
listId="1"
taskID="1"
taskGroupID="1"
description="hello!"
ref={$cardRef}
title="Hello, world"

View File

@ -15,13 +15,13 @@ import {
} from './Styles';
type Props = {
listId: string;
cardId: string;
taskID: string;
taskGroupID: string;
cardTitle: string;
onCloseEditor: () => void;
onEditCard: (listId: string, cardId: string, cardName: string) => void;
onEditCard: (taskGroupID: string, taskID: string, cardName: string) => void;
onOpenPopup: (popupType: number, top: number, left: number) => void;
onArchiveCard: (listId: string, cardId: string) => void;
onArchiveCard: (taskGroupID: string, taskID: string) => void;
labels?: Label[];
isOpen: boolean;
top: number;
@ -29,8 +29,8 @@ type Props = {
};
const QuickCardEditor = ({
listId,
cardId,
taskGroupID,
taskID,
cardTitle,
onCloseEditor,
onOpenPopup,
@ -57,7 +57,7 @@ const QuickCardEditor = ({
const handleKeyDown = (e: any) => {
if (e.key === 'Enter') {
e.preventDefault();
onEditCard(listId, cardId, currentCardTitle);
onEditCard(taskGroupID, taskID, currentCardTitle);
onCloseEditor();
}
};
@ -89,7 +89,7 @@ const QuickCardEditor = ({
/>
</EditorDetails>
</Editor>
<SaveButton onClick={e => onEditCard(listId, cardId, currentCardTitle)}>Save</SaveButton>
<SaveButton onClick={e => onEditCard(taskGroupID, taskID, currentCardTitle)}>Save</SaveButton>
<EditorButtons>
<EditorButton
ref={$labelsRef}
@ -104,7 +104,7 @@ const QuickCardEditor = ({
<EditorButton
onClick={e => {
e.stopPropagation();
onArchiveCard(listId, cardId);
onArchiveCard(taskGroupID, taskID);
onCloseEditor();
}}
>