Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
27361221
Commit
27361221
authored
Sep 09, 2021
by
Enrique Alcántara
Committed by
Michael Lunøe
Sep 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add storybook stories for the Content Editor
parent
5d90d345
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
2 deletions
+39
-2
app/assets/javascripts/content_editor/content_editor.stories.js
...sets/javascripts/content_editor/content_editor.stories.js
+27
-0
storybook/config/preview.js
storybook/config/preview.js
+9
-1
storybook/package.json
storybook/package.json
+3
-1
No files found.
app/assets/javascripts/content_editor/content_editor.stories.js
0 → 100644
View file @
27361221
import
{
ContentEditor
}
from
'
./index
'
;
export
default
{
component
:
ContentEditor
,
title
:
'
Components/Content Editor
'
,
};
const
Template
=
(
_
,
{
argTypes
})
=>
({
components
:
{
ContentEditor
},
props
:
Object
.
keys
(
argTypes
),
template
:
'
<content-editor v-bind="$props" @initialized="loadContent" />
'
,
methods
:
{
loadContent
(
contentEditor
)
{
// eslint-disable-next-line @gitlab/require-i18n-strings
contentEditor
.
setSerializedContent
(
'
Hello content editor
'
);
},
},
});
export
const
Default
=
Template
.
bind
({});
Default
.
args
=
{
renderMarkdown
:
()
=>
'
<p>Hello content editor</p>
'
,
uploadsPath
:
'
/uploads/
'
,
serializerConfig
:
{},
extensions
:
[],
};
storybook/config/preview.js
View file @
27361221
// eslint-disable-next-line import/no-extraneous-dependencies
import
Vue
from
'
vue
'
;
import
translateMixin
from
'
../../app/assets/javascripts/vue_shared/translate
'
;
const
stylesheetsRequireCtx
=
require
.
context
(
'
../../app/assets/stylesheets
'
,
true
,
/
application
\.
scss$/
,
/
(
application|application_utilities
)
\.
scss$/
,
);
window
.
gon
=
{};
translateMixin
(
Vue
);
stylesheetsRequireCtx
(
'
./application.scss
'
);
stylesheetsRequireCtx
(
'
./application_utilities.scss
'
);
storybook/package.json
View file @
27361221
...
...
@@ -5,7 +5,9 @@
"start"
:
"start-storybook -p 9002 -c config"
,
"build"
:
"build-storybook -c config -o public"
},
"dependencies"
:
{},
"blockedDependencies"
:
{
"vue"
:
"https://gitlab.com/gitlab-org/gitlab/-/issues/340511"
},
"devDependencies"
:
{
"@storybook/addon-a11y"
:
"^6.2.9"
,
"@storybook/addon-actions"
:
"^6.2.9"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment