-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
103 additions
and
48 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed client copy mutation, cleanup up move mutation for consistency @pnicolli |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,35 @@ | ||
import { z } from 'zod'; | ||
import { ApiRequestParams, apiRequest } from '../../API'; | ||
import { | ||
PloneClientConfig, | ||
PloneClientConfigSchema, | ||
} from '../../validation/config'; | ||
import { PloneClientConfig } from '../../validation/config'; | ||
import { copyMoveDataSchema as copyDataSchema } from '../../validation/copymove'; | ||
import { CopyMoveResponse as CopyResponse } from '@plone/types'; | ||
|
||
export const copyArgsSchema = z.object({ | ||
data: copyDataSchema, | ||
config: PloneClientConfigSchema, | ||
}); | ||
|
||
export type CopyArgs = z.infer<typeof copyArgsSchema>; | ||
export type CopyArgs = z.infer<typeof copyDataSchema> & { | ||
config: PloneClientConfig; | ||
}; | ||
|
||
export const copy = async ({ | ||
path, | ||
data, | ||
config, | ||
}: CopyArgs): Promise<CopyResponse> => { | ||
const validatedArgs = copyArgsSchema.parse({ | ||
const validatedArgs = copyDataSchema.parse({ | ||
path, | ||
data, | ||
config, | ||
}); | ||
|
||
const options: ApiRequestParams = { | ||
config, | ||
data: validatedArgs.data, | ||
config: validatedArgs.config, | ||
}; | ||
|
||
return apiRequest('post', '/@copy', options); | ||
const copyPath = `${validatedArgs.path}/@copy`; | ||
|
||
return apiRequest('post', copyPath, options); | ||
}; | ||
|
||
export const copyMutation = ({ config }: { config: PloneClientConfig }) => ({ | ||
mutationKey: ['post', 'copy'], | ||
mutationFn: ({ data }: Omit<CopyArgs, 'config'>) => copy({ data, config }), | ||
mutationFn: ({ path, data }: Omit<CopyArgs, 'config'>) => | ||
copy({ path, data, config }), | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { z } from 'zod'; | ||
|
||
export const copyMoveDataSchema = z.object({ | ||
source: z.union([z.string(), z.array(z.string())]), | ||
path: z.string(), | ||
data: z.object({ | ||
source: z.union([z.string(), z.array(z.string())]), | ||
}), | ||
}); |
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 @@ | ||
Added the configuration for VSCode not to reformat Markdown and MyST files. @aadityaforwork |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fetch `user` before pass it to the `restricted` function of the block settings. @wesleybl |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fixed build style classnames in edit mode. Also use buildStyleClassNamesExtenders. @giuliaghisini |
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 @@ | ||
Fetch `user` before pass it to the `restricted` function of the block settings. @wesleybl |
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 @@ | ||
Fixed toolbar buttons not having a focus outline. @JeffersonBledsoe |
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 @@ | ||
Fixed spelling of prerequisites. @stevepiercy |
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 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as useClipboard } from '@plone/volto/hooks/clipboard/useClipboard'; | ||
export { useClient } from '@plone/volto/hooks/client/useClient'; | ||
export { default as useUser } from '@plone/volto/hooks/user/useUser'; |
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,23 @@ | ||
import { useEffect } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import jwtDecode from 'jwt-decode'; | ||
import { getUser } from '@plone/volto/actions'; | ||
|
||
const useUser = () => { | ||
const users = useSelector((state) => state.users); | ||
const user = users?.user; | ||
const userId = useSelector((state) => | ||
state.userSession.token ? jwtDecode(state.userSession.token).sub : '', | ||
); | ||
const dispatch = useDispatch(); | ||
|
||
useEffect(() => { | ||
if (!user?.id && users?.get.loading === false) { | ||
dispatch(getUser(userId)); | ||
} | ||
}, [dispatch, userId, user, users?.get.loading]); | ||
|
||
return user; | ||
}; | ||
|
||
export default useUser; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[^.]js | ||
NodeJS | ||
[Pp]re-requisite |