Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
commit5afcbe03ead9ada87621888a31a62652b10a7e4f (patch)
tree9918b67a0d0f0bafa6542e839a8be37adf73102d /storybook
parentc97c0201564848c1f53226fe19d71fdcc472f7d0 (diff)
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'storybook')
-rw-r--r--storybook/config/addons/make_container/index.js12
-rw-r--r--storybook/config/preview.js2
2 files changed, 14 insertions, 0 deletions
diff --git a/storybook/config/addons/make_container/index.js b/storybook/config/addons/make_container/index.js
new file mode 100644
index 00000000000..2bc7fa92b8a
--- /dev/null
+++ b/storybook/config/addons/make_container/index.js
@@ -0,0 +1,12 @@
+/**
+ * Return a story decorator function, which wraps the given story in a `div`
+ * element with the given `style` attributes.
+ *
+ * @param {object} style The style attribute to apply to the container.
+ * @return {function} The story decorator.
+ */
+export const makeContainer = (style) => (Story) => ({
+ render(h) {
+ return h('div', { style }, [h(Story())]);
+ },
+});
diff --git a/storybook/config/preview.js b/storybook/config/preview.js
index fc04623071a..e31f36ca70e 100644
--- a/storybook/config/preview.js
+++ b/storybook/config/preview.js
@@ -1,6 +1,7 @@
// Some modules read window.gon on initialization thus we need to define this object before anything else
import './gon';
import Vue from 'vue';
+import VueApollo from 'vue-apollo';
import translateMixin from '~/vue_shared/translate';
import { initializeGitLabAPIAccess } from './addons/gitlab_api_access/preview';
@@ -13,6 +14,7 @@ const stylesheetsRequireCtx = require.context(
initializeGitLabAPIAccess();
translateMixin(Vue);
+Vue.use(VueApollo);
stylesheetsRequireCtx('./application.scss');
stylesheetsRequireCtx('./application_utilities.scss');