Skip to content

Commit

Permalink
All turtles add link (#10)
Browse files Browse the repository at this point in the history
Combined with a parallel update in sanity-translations-tab, this update
includes a link that goes straight to the given task in Smartling, using
the project id and task id. If there is a task, then a link will show
along with the current job to "View Job" so users can easily get to the
associated Smartling job for additional updates or info.
  • Loading branch information
cngonzalez authored Mar 22, 2022
1 parent b6af0d8 commit f048f72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.1",
"version": "1.5.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions src/adapter/getTranslationTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ export const getTranslationTask = async (
}
}

const url = `https://api.smartling.com/jobs-api/v3/projects/${secrets.project}/jobs/${taskId}/progress`
const projectId = secrets.project
const progressUrl = `https://api.smartling.com/jobs-api/v3/projects/${projectId}/jobs/${taskId}/progress`
const smartlingTask = await fetch(smartlingProxy, {
method: 'POST',
headers: getHeaders(url, accessToken),
headers: getHeaders(progressUrl, accessToken),
})
.then(res => res.json())
.then(res => res.response.data)
Expand All @@ -41,5 +42,6 @@ export const getTranslationTask = async (
locales,
//since our download is tied to document id for smartling, keep track of it as a task
taskId: documentId,
linkToVendorTask: `https://dashboard.smartling.com/app/projects/${projectId}/account-jobs/${projectId}:${taskId}`,
}
}

0 comments on commit f048f72

Please sign in to comment.