-
Notifications
You must be signed in to change notification settings - Fork 54
[DT-3158] feat: import from github in reuse existing slices dialog #1754
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 25 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
738ee96
feat: add import slices
levimykel fc1b3dc
Merge remote-tracking branch 'origin/main' into lg/import-slices
jomifepe 8f18284
feat: empty menu
jomifepe 5c333d9
feat: 🤖
jomifepe da0e717
feat: progress
jomifepe 12f7e0c
feat: endpoint definition
jomifepe 3a1d1b8
refactor: rename
jomifepe ac2f79f
feat: button label
jomifepe 03f08b6
Merge remote-tracking branch 'origin/jp/import-slice-base' into jp/im…
jomifepe 46f24a2
fix: types
jomifepe ea3d0d6
refactor: cleanup
jomifepe ae5135c
Merge remote-tracking branch 'origin/jp/import-slice-base' into jp/im…
jomifepe 5904598
refactor: cleanup for review
jomifepe 4478ee7
feat: add select all checkbox back
jomifepe 2864a34
refactor: revert unwanted change
jomifepe df8807d
refactor: revert unwanted change
jomifepe dd301f1
feat: remove from slices page
jomifepe 4767da7
feat: same grid and reset tab
jomifepe 52a3764
feat: scroll area
jomifepe 1dc9936
refactor: remove unwanted change
jomifepe 5c59665
fix: update success message and fix e2e
jomifepe f307d72
fix: remove protected
jomifepe 158e5ee
refactor: separate logic
jomifepe edb1960
refactor: cleanup
jomifepe 53bd4d3
refactor: tests
jomifepe b70d59a
refactor: shorten
jomifepe 24b5142
fix: onSuccess
jomifepe e07266c
refactor: cleanup
jomifepe 3dd9d1d
chore: cleanup
jomifepe 264616a
refactor: remove unnecessary code
jomifepe 731747b
refactor: duplicate toasts
jomifepe d049910
fix: lost commit
jomifepe d155263
refactor: cleanup
jomifepe 2f6a88b
fix: use conflictFreeSlices
jomifepe e95676a
fix: mock parsing
jomifepe b803f8d
chore: lint
jomifepe 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
35 changes: 35 additions & 0 deletions
35
...rc/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/DialogButtons.tsx
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,35 @@ | ||
| import { | ||
| DialogActionButton, | ||
| DialogActions, | ||
| DialogCancelButton, | ||
| } from "@prismicio/editor-ui"; | ||
|
|
||
| import { getSubmitButtonLabel } from "../shared/getSubmitButtonLabel"; | ||
|
|
||
| export function ReuseSlicesDialogContent() {} | ||
|
|
||
| interface DialogButtonsProps { | ||
| totalSelected: number; | ||
| onSubmit: () => void; | ||
| location: "custom_type" | "page_type"; | ||
| typeName: string; | ||
| isSubmitting?: boolean; | ||
| } | ||
|
|
||
| export function DialogButtons(props: DialogButtonsProps) { | ||
| const { totalSelected, onSubmit, isSubmitting, location, typeName } = props; | ||
|
|
||
| return ( | ||
| <DialogActions> | ||
| <DialogCancelButton disabled={isSubmitting} size="medium" /> | ||
| <DialogActionButton | ||
| disabled={totalSelected === 0} | ||
| loading={isSubmitting} | ||
| onClick={() => void onSubmit()} | ||
| size="medium" | ||
| > | ||
| {getSubmitButtonLabel(location, typeName)} ({totalSelected}) | ||
| </DialogActionButton> | ||
| </DialogActions> | ||
| ); | ||
| } | ||
25 changes: 25 additions & 0 deletions
25
...rc/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/DialogContent.tsx
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,25 @@ | ||
| import { Box } from "@prismicio/editor-ui"; | ||
| import { ReactNode } from "react"; | ||
|
|
||
| interface DialogContentProps { | ||
| children: ReactNode; | ||
| selected: boolean; | ||
| } | ||
|
|
||
| export function DialogContent(args: DialogContentProps) { | ||
| const { children, selected } = args; | ||
|
|
||
| if (!selected) { | ||
| return ( | ||
| <Box display="none" minHeight={0}> | ||
| {children} | ||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Box display="flex" flexDirection="column" flexGrow={1} minHeight={0}> | ||
| {children} | ||
| </Box> | ||
| ); | ||
| } |
32 changes: 32 additions & 0 deletions
32
...e/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/DialogTabs.tsx
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,32 @@ | ||
| import { Box, Tab } from "@prismicio/editor-ui"; | ||
| import { ReactNode } from "react"; | ||
|
|
||
| interface DialogTabsProps { | ||
| selectedTab: "local" | "library"; | ||
| onSelectTab: (tab: "local" | "library") => void; | ||
| rightContent?: ReactNode; | ||
| } | ||
|
|
||
| export function DialogTabs(props: DialogTabsProps) { | ||
| const { selectedTab, onSelectTab, rightContent } = props; | ||
|
|
||
| return ( | ||
| <Box justifyContent="space-between" padding={16} border={{ bottom: true }}> | ||
| <Box gap={8}> | ||
| <Tab | ||
| selected={selectedTab === "local"} | ||
| onClick={() => onSelectTab("local")} | ||
| > | ||
| Local Slices | ||
| </Tab> | ||
| <Tab | ||
| selected={selectedTab === "library"} | ||
| onClick={() => onSelectTab("library")} | ||
| > | ||
| Library Slices | ||
| </Tab> | ||
| </Box> | ||
| {rightContent} | ||
| </Box> | ||
| ); | ||
| } |
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.