-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unittests and docs for WorkerOpinion feature
- Loading branch information
Showing
76 changed files
with
1,063 additions
and
716 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
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
Binary file added
BIN
+156 KB
docs/web/docs/guides/how_to_use/review_app/screenshots/task_worker_opinions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+87.1 KB
(470%)
docs/web/docs/guides/how_to_use/review_app/screenshots/tasks_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 0 additions & 104 deletions
104
docs/web/docs/guides/how_to_use/worker_experience/feedback.md
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
docs/web/docs/guides/how_to_use/worker_experience/mephisto-task-addons.md
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,50 @@ | ||
--- | ||
|
||
# Copyright (c) Meta Platforms and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
sidebar_position: 1 | ||
--- | ||
|
||
# Mephisto Task Addons | ||
|
||
## Overview | ||
|
||
The `mephisto-task-addons` package provides: | ||
- `WorkerOpinion` widget: collect workers' feedback for each completed unit | ||
|
||
## Usage | ||
|
||
1. Add `mephisto-task-addons` library to your webpack config: | ||
```js | ||
// Specifies location of your packages (e.g. `../../dir`) | ||
var PATH_TO_PACKAGES = "<path>" | ||
|
||
module.exports = { | ||
... | ||
resolve: { | ||
alias: { | ||
... | ||
"mephisto-task-addons": path.resolve( | ||
__dirname, | ||
`${PATH_TO_PACKAGES}/packages/mephisto-task-addons` | ||
), | ||
} | ||
} | ||
}; | ||
``` | ||
|
||
2. Import desired widgets from `mephisto-task-addons` in your code like so: | ||
|
||
```jsx | ||
import { WorkerOpinion } from "mephisto-task-addons"; | ||
... | ||
<WorkerOpinion | ||
maxTextLength={500} | ||
questions={[ | ||
"Was this task hard?", | ||
"Is this a good example?", | ||
]} | ||
/> | ||
``` |
21 changes: 0 additions & 21 deletions
21
docs/web/docs/guides/how_to_use/worker_experience/mephisto-worker-addons.md
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+94.2 KB
.../docs/guides/how_to_use/worker_experience/screenshots/worker_opinion_widget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
docs/web/docs/guides/how_to_use/worker_experience/worker_opinion.md
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,78 @@ | ||
--- | ||
|
||
# Copyright (c) Meta Platforms and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
sidebar_position: 2 | ||
--- | ||
|
||
# WorkerOpinion widget | ||
|
||
Workers can leave their feedback about a Task if you add a `WorkerOpinion` feature to it. | ||
|
||
WorkerOpinion widget currently may contain a set of textarea form fields, and a multi-file attachment form field. | ||
|
||
|
||
## How to enable `WorkerOpinion` | ||
|
||
1. Add `mephisto-task-addons` library to your webpack config | ||
2. Import `WorkerOpinion` component to your Task's React application code and define questions. | ||
|
||
### 1. Webpack config | ||
|
||
```js | ||
// Specifies location of your packages (e.g. `../../dir`) | ||
var PATH_TO_PACKAGES = "<path>" | ||
|
||
module.exports = { | ||
... | ||
resolve: { | ||
alias: { | ||
... | ||
"mephisto-task-addons": path.resolve( | ||
__dirname, | ||
`${PATH_TO_PACKAGES}/packages/mephisto-task-addons` | ||
), | ||
} | ||
} | ||
}; | ||
``` | ||
|
||
### 2. `WorkerOpinion` component | ||
|
||
```jsx | ||
import { WorkerOpinion } from "mephisto-task-addons"; | ||
... | ||
return( | ||
<div ...> | ||
<WorkerOpinion | ||
maxTextLength={500} | ||
questions={[ | ||
"Was this task hard?", | ||
"Is this a good example?", | ||
]} | ||
/> | ||
</div> | ||
) | ||
``` | ||
|
||
Supported properties for `WorkerOpinion` component: | ||
|
||
- `handleSubmit` (optional) - your custom callback that will run on opinion submit | ||
- `maxTextLength` (optional) - max amount of characters for all textarea fields | ||
- `questions` (optional, array of strings) - list of questions for the worker, where each response is a textarea field | ||
- `required` (optional) - if `false`, adds `" (optional)"` suffix to question text (default: `false`) | ||
- `textAreaWidth` (optional) - width of all textarea fields (default: `100%`) | ||
- `title` (optional) - title of the WorkerOpinion widget. Default: `Your Feedback` | ||
|
||
Here's how `WorkerOpinion` component looks like: | ||
|
||
![Worker Opinion](./screenshots/worker_opinion_widget.png) | ||
|
||
|
||
## How `WorkerOpinion` works | ||
|
||
1. After completing each unit, workers can submit an opinion about the completed unit. | ||
2. **Once the task is shut down**, you can review all collected opinions for the task in TaskReview app. | ||
3. When reviewing units in TaskReview app, you will see an extra accordion section "Worker Opinion" if a worker submitted their opinion. |
Oops, something went wrong.