Просмотр исходного кода

Merge pull request #3957 from overleaf/ae-stories-context-root

Add required attributes for ContextRoot in stories

GitOrigin-RevId: c0cabf4eb03785c6232abe417e34bd7916b97046
Jakob Ackermann 5 лет назад
Родитель
Сommit
b350843b4e

+ 7 - 3
services/web/frontend/stories/dropdown.stories.js

@@ -43,7 +43,7 @@ Primary.args = { ...defaultArgs, bsStyle: 'primary' }
 
 export const RightAligned = args => {
   return (
-    <div style={{ 'text-align': 'right' }}>
+    <div style={{ textAlign: 'right' }}>
       <DropdownButton {...args}>
         <MenuItems />
       </DropdownButton>
@@ -54,7 +54,7 @@ RightAligned.args = { ...defaultArgs, pullRight: true }
 
 export const SingleIconTransparent = args => {
   return (
-    <div style={{ 'text-align': 'right' }}>
+    <div style={{ textAlign: 'right' }}>
       <DropdownButton {...args}>
         <MenuItems />
       </DropdownButton>
@@ -71,7 +71,11 @@ SingleIconTransparent.args = {
 
 export const Customized = args => {
   return (
-    <Dropdown pullRight={args.pullRight} defaultOpen={args.defaultOpen}>
+    <Dropdown
+      pullRight={args.pullRight}
+      defaultOpen={args.defaultOpen}
+      id="dropdown-story"
+    >
       <Dropdown.Toggle
         noCaret={args.noCaret}
         className={args.className}

+ 3 - 4
services/web/frontend/stories/fixtures/context.js

@@ -5,9 +5,6 @@ export function setupContext() {
   window.user = {
     id: 'fake_user',
   }
-  window.ExposedSettings = {
-    appName: 'Overleaf',
-  }
   let $scope = {}
   if (window._ide) {
     $scope = {
@@ -16,6 +13,7 @@ export function setupContext() {
       $watch: () => {},
       ui: {
         chatOpen: true,
+        pdfLayout: 'flat',
       },
     }
   }
@@ -28,5 +26,6 @@ export function setupContext() {
     },
   }
   window.ExposedSettings = window.ExposedSettings || {}
-  window.ExposedSettings.gitBridgePublicBaseUrl = 'https://git.stories.com'
+  window.ExposedSettings.appName = 'Overleaf'
+  window.gitBridgePublicBaseUrl = 'https://git.stories.com'
 }

+ 1 - 1
services/web/frontend/stories/outline.stories.js

@@ -59,7 +59,7 @@ export default {
   },
   decorators: [
     Story => (
-      <ContextRoot>
+      <ContextRoot ide={window._ide} settings={{}}>
         <Story />
       </ContextRoot>
     ),