-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow copy and pasting into Zui.
- Loading branch information
Showing
44 changed files
with
551 additions
and
324 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
35 changes: 35 additions & 0 deletions
35
apps/zui/src/app/routes/app-wrapper/data-dropzone-controller.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {previewLoadFiles, quickLoadFiles} from "src/domain/loads/handlers" | ||
|
||
export class DataDropzoneController { | ||
constructor( | ||
private shift: boolean, | ||
private previewing: boolean, | ||
private poolId: string | ||
) {} | ||
|
||
// prettier-ignore | ||
get title() { | ||
if (this.previewing) return (<>Add <em>Files</em></>) | ||
if (this.shift) return (<>Quick Load <em>Data</em></>) | ||
return <>Preview & Load <em>Data</em></> | ||
} | ||
|
||
// prettier-ignore | ||
get note() { | ||
if (this.previewing) return null | ||
if (this.shift) return <>Release <b>{"Shift"}</b> to preview data first.</> | ||
return <>Hold <b>{"Shift"}</b> to quick load into new pool with defaults.</> | ||
} | ||
|
||
onDrop(fileObjects: File[]) { | ||
const files = fileObjects.map((f) => f.path) | ||
const poolId = this.poolId | ||
if (this.previewing) { | ||
previewLoadFiles({files, poolId}) | ||
} else if (this.shift) { | ||
quickLoadFiles({files}) | ||
} else { | ||
previewLoadFiles({files, poolId}) | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.