-
-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Content Rename Model (#4971)
Co-authored-by: Nilesh <[email protected]>
- Loading branch information
1 parent
f2df63e
commit e3be234
Showing
3 changed files
with
150 additions
and
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Refactor ContentsRenameModal -@Tishasoumya-02 |
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
61 changes: 61 additions & 0 deletions
61
src/components/manage/Contents/ContentsRenameModal.stories.jsx
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,61 @@ | ||
import { injectIntl } from 'react-intl'; | ||
import React from 'react'; | ||
import ContentsRenameModalComponent from './ContentsRenameModal'; | ||
import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook'; | ||
|
||
const IntlContentRenameModalComponent = injectIntl( | ||
ContentsRenameModalComponent, | ||
); | ||
|
||
function StoryComponent(args) { | ||
return ( | ||
<Wrapper | ||
customStore={{ | ||
content: { | ||
update: { | ||
loading: false, | ||
loaded: true, | ||
}, | ||
}, | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}} | ||
> | ||
<div id="toolbar" style={{ display: 'none' }} /> | ||
<IntlContentRenameModalComponent | ||
{...args} | ||
onOk={() => {}} | ||
onCancel={() => {}} | ||
items={[ | ||
{ | ||
...args, | ||
url: '/blog', | ||
}, | ||
]} | ||
/> | ||
</Wrapper> | ||
); | ||
} | ||
|
||
export const ContentRenameModal = StoryComponent.bind({}); | ||
|
||
ContentRenameModal.args = { | ||
open: true, | ||
id: 'blogs', | ||
title: 'Plone Blog', | ||
}; | ||
|
||
export default { | ||
title: 'Public components/Contents/Content Rename Modal', | ||
component: ContentRenameModal, | ||
decorators: [ | ||
(Story) => ( | ||
<div className="ui segment form attached" style={{ width: '400px' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
argTypes: {}, | ||
}; |