-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tasks): use FormBuilder to create and edit tasks. (#5897)
* feat(tasks): add tasks creation action * feat(tasks): WIP - use FormBuilder in tasks * feat(tasks): use FormBuilder in tasks, fix remount issues * feat(tasks): add missing fields to tasks * feat(tasks): add custom title field * feat(tasks): add mention options and fix assigned to field * feat(tasks): wip implementation - use tasks reference with search * fix: fix build issues * fix(tasks): styling tasks create form * fix(tasks): assign target content when a task is created with a document in view * fix(tasks): update title styling * fix(tasks): update focus visible on intent link * fix(tasks): use commentInput in tasks description * fix(tasks): update style for targetField placeholder * {wip} saved 2024-02-27 15:41 * feat(tasks): start form edit work * fix(tasks): move selected document logic * feat(tasks): add wip activity log * fix(tasks): update tasks ui * feat(tasks): integrate remove tasks into the new edit form * feat(tasks): add support for drafts and tasks duplication * fix(tasks): updates post rebase with base branch * fix(tasks): update tasks workspace provider, small fixes * fix: remove unnecessary import * fix(tasks): update assignee form field * fix(tasks): add subscriptions to tasks * fix(tasks): code cleanup * fix(tasks): show subscribed tasks in subscribe tab * fix(tasks): set creator of task as subscriber * fix(tasks): not show avatars if no subscribers * feat(tasks): add subscribers when editing and creating a task * fix(tasks): update assignee fields, and add animation to subscribers * chore(tasks): move target content field to the top * fix(tasks): add assigned user to subscribers * feat(tasks): add listener for query params, handle copy link * fix(tasks): fix issue in which the tasks created were not saving the created value * fix(tasks): rename mention user folder * fix(tasks): add date field in edit form * fix(tasks): add discard draft action * feat(tasks): add comments * fix(tasks): add activities to the activity log (#5929) * fix(tasks): add activities to the activity log * fix(tasks): fix string logic of activities * fix(tasks): update activity components * fix(tasks): remove activity log dummy data * fix(tasks): update activity logs to work with comments --------- Co-authored-by: Pedro Bonamin <[email protected]> * fix(tasks): update tasks activity log UI * chore(tasks): simplify form, reorganise files * chore(tasks): update tasks header * fix(tasks): ui tweaks (#5947) * feat(tasks): add create task action from document (#5950) * feat(tasks): responsive sidebar (#5949) * fix(tasks): enable check for document action (#5958) * fix(tasks): update remove task dialog text, update task list item ui * fix(tasks): use TaskIcon from @sanity/icons * fix(tasks): support for disabling tasks, add default value to useProviders, move useTasksOperations * fix(tasks): hide active tab navigation when it's empty * fix(tasks): sidebar z-index * fix(tasks): turn on by default tasks config flag * fix(tasks): add support for mobile footer action --------- Co-authored-by: Nina Andal Aarvik <[email protected]> Co-authored-by: Herman Wikner <[email protected]>
- Loading branch information
1 parent
be49900
commit 908577e
Showing
82 changed files
with
3,400 additions
and
955 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
2 changes: 1 addition & 1 deletion
2
packages/sanity/src/core/form/studio/__snapshots__/FormBuilder.test.tsx.snap
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`FormBuilder should render a studio form 1`] = `"<div data-as=\\"div\\" data-ui=\\"Stack\\" data-testid=\\"field-title\\" data-level=\\"0\\"><div data-as=\\"div\\" data-ui=\\"Flex\\"><div data-as=\\"div\\" data-ui=\\"Box\\"><div data-as=\\"div\\" data-ui=\\"Stack\\"><div data-as=\\"div\\" data-ui=\\"Flex\\"><label data-ui=\\"Text\\" for=\\"title\\"><span>Title</span></label></div></div></div></div><div><div><div data-testid=\\"change-bar-wrapper\\"><div data-testid=\\"change-bar__field-wrapper\\"><span data-as=\\"span\\" data-ui=\\"TextInput\\" data-scheme=\\"light\\" data-tone=\\"default\\"><span><input data-as=\\"input\\" data-scheme=\\"light\\" data-tone=\\"default\\" id=\\"title\\" type=\\"text\\" value=\\"\\"><span data-border=\\"\\" data-scheme=\\"light\\" data-tone=\\"default\\"></span></span></span></div></div></div></div></div>"`; | ||
exports[`FormBuilder should render a studio form 1`] = `"<div data-as=\\"div\\" data-ui=\\"Stack\\" data-testid=\\"field-title\\" data-level=\\"0\\"><div data-as=\\"div\\" data-ui=\\"Flex\\"><div data-as=\\"div\\" data-ui=\\"fieldHeaderContentBox\\\"><div data-as=\\"div\\" data-ui=\\"Stack\\"><div data-as=\\"div\\" data-ui=\\"Flex\\"><label data-ui=\\"Text\\" for=\\"title\\"><span>Title</span></label></div></div></div></div><div><div><div data-testid=\\"change-bar-wrapper\\"><div data-testid=\\"change-bar__field-wrapper\\"><span data-as=\\"span\\" data-ui=\\"TextInput\\" data-scheme=\\"light\\" data-tone=\\"default\\"><span><input data-as=\\"input\\" data-scheme=\\"light\\" data-tone=\\"default\\" id=\\"title\\" type=\\"text\\" value=\\"\\"><span data-border=\\"\\" data-scheme=\\"light\\" data-tone=\\"default\\"></span></span></span></div></div></div></div></div>"`; |
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
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
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
24 changes: 19 additions & 5 deletions
24
packages/sanity/src/tasks/__workshop__/TasksCreateStory.tsx
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,25 @@ | ||
import {TaskIcon} from '@sanity/icons' | ||
import {useCallback} from 'react' | ||
import {type DocumentActionDescription} from 'sanity' | ||
|
||
import {useTasksEnabled, useTasksNavigation} from '../src' | ||
|
||
export function TaskCreateAction(): DocumentActionDescription | null { | ||
const {handleOpenTasks, setViewMode} = useTasksNavigation() | ||
const {enabled} = useTasksEnabled() | ||
|
||
const handleCreateTaskFromDocument = useCallback(() => { | ||
handleOpenTasks() | ||
setViewMode({type: 'create'}) | ||
}, [handleOpenTasks, setViewMode]) | ||
|
||
if (!enabled) return null | ||
|
||
return { | ||
icon: TaskIcon, | ||
label: 'Create new task', | ||
title: 'Create new task', | ||
group: ['paneActions'], | ||
onHandle: handleCreateTaskFromDocument, | ||
} | ||
} |
54 changes: 43 additions & 11 deletions
54
packages/sanity/src/tasks/plugin/TasksFooterOpenTasks.tsx
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.