-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: DIA-1924: "Import sample data" ability in the Data Import page #7206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
bbce2de
Adding sample select block
nick-skriabin d53cf37
Merge branch 'develop' into fb-dia-1924/sample-imports
nick-skriabin 307a3ad
Merge remote-tracking branch 'origin/develop' into fb-dia-1924/sample…
matt-bernstein e28abfe
Merge remote-tracking branch 'origin/develop' into fb-dia-1924/sample…
matt-bernstein e524a31
Uploading data samples
nick-skriabin b539c7d
Format
nick-skriabin 866cc83
Add sample import to import dialog within the project
nick-skriabin 974b50f
feat: OPTIC-1746: Improve global error message handling by showing to…
bmartel cc617d3
fix: DIA-2028: [BE] Membership API call for organization with ID=2574…
nick-skriabin d2afd79
fix: DIA-2028: [BE] Membership API call for organization with ID=2574…
nick-skriabin 8b826a7
feat: OPTIC-1265: Improve error pages (#7196)
mcanu 13afe5b
fix: DIA-2026: allow annotators/reviewers to view jwt settings (#7208)
pakelley 20008e0
fix: OPTIC-1749: Limit only sentry_force error logs to go to Sentry (…
mcanu 4425120
Merge remote-tracking branch 'origin/develop' into fb-dia-1924/sample…
matt-bernstein 96926ba
remove redundant sample
matt-bernstein 45d07f4
turn ff off by default for safety
matt-bernstein b5d8f7a
Select styles
nick-skriabin e421f23
upload samples
matt-bernstein 7ab6c55
Update web/libs/ui/package.json
nick-skriabin 43d0bfa
Refactor for DRY
nick-skriabin 11528dc
Merge branch 'develop' into fb-dia-1924/sample-imports
nick-skriabin 4d75475
Deprecate `isFF` -> `isActive`
nick-skriabin 2fa7709
Refactor FFs
nick-skriabin 104fb14
Update FF usage
nick-skriabin b608242
Development check
nick-skriabin c9dbb8f
Merge branch 'develop' into fb-dia-1924/sample-imports
nick-skriabin 532b16f
Update naming (getting rid of `index.ts`)
nick-skriabin 7ca848b
Update FF usage
nick-skriabin 01bad7e
Remove unnecessary dev check
nick-skriabin 0f86e18
Merge branch 'develop' into fb-dia-1924/sample-imports
nick-skriabin ab95531
Fix FF issue
nick-skriabin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -44,7 +44,6 @@ | |
} | ||
|
||
& + span { | ||
margin: 0 16px; | ||
color: var(--sand_600); | ||
} | ||
} | ||
|
This file contains hidden or 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
12 changes: 12 additions & 0 deletions
12
web/apps/labelstudio/src/pages/CreateProject/Import/samples.json
This file contains hidden or 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,12 @@ | ||
[ | ||
{ | ||
"title": "COCO 2017 Images", | ||
"description": "A 100-image subset of the COCO image segmentation benchmark dataset.", | ||
"url": "https://hs-sandbox-pub.s3.us-east-1.amazonaws.com/sample_data/coco_2017_val_100tasks.json" | ||
}, | ||
{ | ||
"title": "CoNLL 2012 NER", | ||
"description": "The CoNLL dataset of 13k sentences for Named Entity Recognition.", | ||
"url": "https://hs-sandbox-pub.s3.us-east-1.amazonaws.com/sample_data/conll_2012.json" | ||
} | ||
] |
This file contains hidden or 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
40 changes: 40 additions & 0 deletions
40
web/apps/labelstudio/src/pages/CreateProject/Import/utils.ts
This file contains hidden or 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,40 @@ | ||
import { API } from "apps/labelstudio/src/providers/ApiProvider"; | ||
|
||
export const importFiles = async ({ | ||
files, | ||
body, | ||
project, | ||
onUploadStart, | ||
onUploadFinish, | ||
onFinish, | ||
onError, | ||
dontCommitToProject, | ||
}: { | ||
files: { name: string }[]; | ||
body: Record<string, any> | FormData; | ||
project: APIProject; | ||
onUploadStart?: (files: { name: string }[]) => void; | ||
onUploadFinish?: (files: { name: string }[]) => void; | ||
onFinish?: (response: any) => void; | ||
onError?: (response: any) => void; | ||
dontCommitToProject?: boolean; | ||
}) => { | ||
onUploadStart?.(files); | ||
|
||
const query = dontCommitToProject ? { commit_to_project: "false" } : {}; | ||
|
||
const contentType = | ||
body instanceof FormData | ||
? "multipart/form-data" // usual multipart for usual files | ||
: "application/x-www-form-urlencoded"; // chad urlencoded for URL uploads | ||
const res = await API.invoke( | ||
"importFiles", | ||
{ pk: project.id, ...query }, | ||
{ headers: { "Content-Type": contentType }, body }, | ||
); | ||
|
||
if (res && !res.error) onFinish?.(res); | ||
else onError?.(res?.response); | ||
|
||
onUploadFinish?.(files); | ||
}; |
This file contains hidden or 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 @@ | ||
// TODO: migrate all usages to core feature flags instead of local ones | ||
// local ones used in LSO, Editor and DM | ||
export * from "@humansignal/core/lib/utils/feature-flags"; | ||
export * from "@humansignal/core/lib/utils/feature-flags/ff"; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.