chore(i8n,curriculum): processed translations (#41551)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8249367417b2b2512c42
|
||||
title: Issue Tracker
|
||||
title: 问题跟踪器
|
||||
challengeType: 4
|
||||
forumTopicId: 301569
|
||||
dashedName: issue-tracker
|
||||
@@ -8,42 +8,42 @@ dashedName: issue-tracker
|
||||
|
||||
# --description--
|
||||
|
||||
Build a full stack JavaScript app that is functionally similar to this: <https://issue-tracker.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
|
||||
构建一个 JavaScript 的全栈应用,在功能上与这个应用相似: <https://issue-tracker.freecodecamp.rocks/>。 可以采用下面的任意一种方式完成这个挑战:
|
||||
|
||||
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) and complete your project locally.
|
||||
- Use [this repl.it starter project](https://repl.it/github/freeCodeCamp/boilerplate-project-issuetracker) to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
- 克隆 [GitHub 仓库](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) 并在本地完成你的项目。
|
||||
- 使用 [repl.it 上的初始化项目](https://repl.it/github/freeCodeCamp/boilerplate-project-issuetracker) 来完成项目。
|
||||
- 使用一个你喜欢的站点生成器来完成项目。 需要确定包含了我们 GitHub 仓库的所有文件。
|
||||
|
||||
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
|
||||
完成本项目后,请将一个正常运行的 demo(项目演示)托管在可以公开访问的平台。 然后在 `Solution Link` 框中提交你的项目 URL。 此外,还可以将项目的源码提交到 `GitHub Link` 中。
|
||||
|
||||
# --instructions--
|
||||
|
||||
- Complete the necessary routes in `/routes/api.js`
|
||||
- Create all of the functional tests in `tests/2_functional-tests.js`
|
||||
- Copy the `sample.env` file to `.env` and set the variables appropriately
|
||||
- To run the tests uncomment `NODE_ENV=test` in your `.env` file
|
||||
- To run the tests in the console, use the command `npm run test`. To open the Repl.it console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell"
|
||||
- 在 `/routes/api.js` 中完成必要的路由
|
||||
- 在 `tests/2_functional-tests.js` 中创建所有的功能测试
|
||||
- 复制 `sample.env` 文件到 `.env` 并按需设置变量
|
||||
- 要运行测试,在 `.env` 文件中取消注释 `NODE_ENV=test`
|
||||
- 使用 `npm run test` 命令,在 console 运行测试。 按 Ctrl+Shift+P (在 Mac 上是 Cmd+Shift+P) 并输入"open shell",打开 Repl.it 控制台。
|
||||
|
||||
Write the following tests in `tests/2_functional-tests.js`:
|
||||
在 `tests/2_functional-tests.js` 中编写下以下测试:
|
||||
|
||||
- Create an issue with every field: POST request to `/api/issues/{project}`
|
||||
- Create an issue with only required fields: POST request to `/api/issues/{project}`
|
||||
- Create an issue with missing required fields: POST request to `/api/issues/{project}`
|
||||
- View issues on a project: GET request to `/api/issues/{project}`
|
||||
- View issues on a project with one filter: GET request to `/api/issues/{project}`
|
||||
- View issues on a project with multiple filters: GET request to `/api/issues/{project}`
|
||||
- Update one field on an issue: PUT request to `/api/issues/{project}`
|
||||
- Update multiple fields on an issue: PUT request to `/api/issues/{project}`
|
||||
- Update an issue with missing `_id`: PUT request to `/api/issues/{project}`
|
||||
- Update an issue with no fields to update: PUT request to `/api/issues/{project}`
|
||||
- Update an issue with an invalid `_id`: PUT request to `/api/issues/{project}`
|
||||
- Delete an issue: DELETE request to `/api/issues/{project}`
|
||||
- Delete an issue with an invalid `_id`: DELETE request to `/api/issues/{project}`
|
||||
- Delete an issue with missing `_id`: DELETE request to `/api/issues/{project}`
|
||||
- 用所有字段创建 issue:POST 请求到 `/api/issues/{project}`
|
||||
- 用必填字段创建 issue:POST 请求到 `/api/issues/{project}`
|
||||
- 用缺失必填字段创建 issue:POST 请求到 `/api/issues/{project}`
|
||||
- 查看 project 里的 issue:GET 请求到 `/api/issues/{project}`
|
||||
- 用 filter 过滤 project 里的 issue:GET 请求到 `/api/issues/{project}`
|
||||
- 用多个 filter 过滤 project 里的 issue:GET 请求到 `/api/issues/{project}`
|
||||
- 更新 issue 里的一个字段:PUT 请求到 `/api/issues/{project}`
|
||||
- 更新 issue 里的多个字段:PUT 请求到 `/api/issues/{project}`
|
||||
- 在缺少 `_id` 字段的情况下更新 issue: PUT 请求到 `/api/issues/{project}`
|
||||
- 在没有字段更新的情况下调用更新:PUT 请求到 `/api/issues/{project}`
|
||||
- 传入一个无效的的 `_id` 来调用更新:PUT 请求到 `/api/issues/{project}`
|
||||
- 删除一个 issue:DELETE 请求到 `/api/issues/{project}`
|
||||
- 传入一个无效的的 `_id` 来调用删除:DELETE 请求到 `/api/issues/{project}`
|
||||
- 在缺失 `_id` 的情况下来调用删除:DELETE 请求到 `/api/issues/{project}`
|
||||
|
||||
# --hints--
|
||||
|
||||
You can provide your own project, not the example URL.
|
||||
提交自己的项目,而不是示例的 URL。
|
||||
|
||||
```js
|
||||
(getUserInput) => {
|
||||
@@ -51,7 +51,7 @@ You can provide your own project, not the example URL.
|
||||
};
|
||||
```
|
||||
|
||||
You can send a `POST` request to `/api/issues/{projectname}` with form data containing the required fields `issue_title`, `issue_text`, `created_by`, and optionally `assigned_to` and `status_text`.
|
||||
可以发送 `POST` 请求到 `/api/issues/{projectname}`,表单数据包含必填字段 `issue_title`、`issue_text`、`created_by` 和可选字段 `assigned_to` 以及 `status_text`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -73,7 +73,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
The `POST` request to `/api/issues/{projectname}` will return the created object, and must include all of the submitted fields. Excluded optional fields will be returned as empty strings. Additionally, include `created_on` (date/time), `updated_on` (date/time), `open` (boolean, `true` for open - default value, `false` for closed), and `_id`.
|
||||
`POST` 请求到 `/api/issues/{projectname}` 将返回创建的对象,必须包含所有提交的全部字段。 如果没有填选填字段将作为空字符串返回. 此外,包含 `created_on` (日期/时间)、 `updated_on` (日期/时间)、 `open` (布尔型) `true` 用于打开 - 默认值, `false` 用于关闭, `_id`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -107,7 +107,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
If you send a `POST` request to `/api/issues/{projectname}` without the required fields, returned will be the error `{ error: 'required field(s) missing' }`
|
||||
如果发送一个 `POST` 请求到 `/api/issues/{projectname}` 且缺少必填字段,会返回错误 `{ error: 'required field(s) missing' }`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -125,7 +125,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can send a `GET` request to `/api/issues/{projectname}` for an array of all issues for that specific `projectname`, with all the fields present for each issue.
|
||||
可以发送 `GET` 请求到 `/api/issues/{projectname}` 请求所有指定 `projectname` 的 issues 数组,会展示每个 issue 的所有字段。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -172,7 +172,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can send a `GET` request to `/api/issues/{projectname}` and filter the request by also passing along any field and value as a URL query (ie. `/api/issues/{project}?open=false`). You can pass one or more field/value pairs at once.
|
||||
可以发送 `GET` 请求到 `/api/issues/{projectname}` 通过 URL 查询传入字段名和值过滤请求(如, `/api/issues/{project}?open=false`)。 你可以一次通过一个或多个字段/值对。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -213,7 +213,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can send a `PUT` request to `/api/issues/{projectname}` with an `_id` and one or more fields to update. On success, the `updated_on` field should be updated, and returned should be `{ result: 'successfully updated', '_id': _id }`.
|
||||
你可以发送一个 `PUT` 请求到 `/api/issues/{projectname}` 带有一个 `_id` 以及一个或多个字段进行更新。 成功后, `updated_on` field 应该被更新,返回的应该是 `{ result: 'successfully updated', '_id': _id }`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -248,7 +248,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
When the `PUT` request sent to `/api/issues/{projectname}` does not include an `_id`, the return value is `{ error: 'missing _id' }`.
|
||||
当 `PUT` 请求发送给 `/api/issues/{projectname}` 的请求体不包含 `_id` 时应返回`{ error: 'missing _id' }`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -264,7 +264,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
When the `PUT` request sent to `/api/issues/{projectname}` does not include update fields, the return value is `{ error: 'no update field(s) sent', '_id': _id }`. On any other error, the return value is `{ error: 'could not update', '_id': _id }`.
|
||||
当 `PUT` 请求发送给 `/api/issues/{projectname}` 的请求体不包含任何更新的字段,应返回 `{ error: 'no update field(s) sent', '_id': _id }`。 在任何其他错误,应返回 `{ error: 'could not update', '_id': _id }`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -294,7 +294,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can send a `DELETE` request to `/api/issues/{projectname}` with an `_id` to delete an issue. If no `_id` is sent, the return value is `{ error: 'missing _id' }`. On success, the return value is `{ result: 'successfully deleted', '_id': _id }`. On failure, the return value is `{ error: 'could not delete', '_id': _id }`.
|
||||
你可以发送一个 `DELETE` 请求到 `/api/issues/{projectname}` 带有一个 `_id` 来删除 issue。 如果没有发送 `_id` ,返回值为 `{ error: 'missing _id' }`。 成功后,返回值为 `{ result: 'successfully deleted', '_id': _id }`。 失败时,返回值为 `{ error: 'could not delete', '_id': _id }`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -336,7 +336,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
All 14 functional tests are complete and passing.
|
||||
所有 14 项功能测试都已完成并通过。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
|
Reference in New Issue
Block a user