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

Merge pull request #438 from smiclea/fix-layout

Fix Options and Storage screens layout
Dorin Paslaru 6 лет назад
Родитель
Сommit
37992c42e1

+ 0 - 1
src/components/organisms/EditReplica/EditReplica.jsx

@@ -422,7 +422,6 @@ class EditReplica extends React.Component<Props, State> {
         storageConfigDefault={endpointStore.storageConfigDefault}
         storageConfigDefault={endpointStore.storageConfigDefault}
         onChange={(f, v) => { this.handleFieldChange(type, f, v) }}
         onChange={(f, v) => { this.handleFieldChange(type, f, v) }}
         oneColumnStyle={{ marginTop: '-16px', display: 'flex', flexDirection: 'column', width: '100%', alignItems: 'center' }}
         oneColumnStyle={{ marginTop: '-16px', display: 'flex', flexDirection: 'column', width: '100%', alignItems: 'center' }}
-        columnStyle={{ marginRight: 0 }}
         fieldWidth={StyleProps.inputSizes.large.width}
         fieldWidth={StyleProps.inputSizes.large.width}
         onScrollableRef={ref => { this.scrollableRef = ref }}
         onScrollableRef={ref => { this.scrollableRef = ref }}
         availableHeight={384}
         availableHeight={384}

+ 3 - 4
src/components/organisms/WizardOptions/WizardOptions.jsx

@@ -35,6 +35,7 @@ const Wrapper = styled.div`
   display: flex;
   display: flex;
   min-height: 0;
   min-height: 0;
   flex-direction: column;
   flex-direction: column;
+  width: 100%;
 `
 `
 const Options = styled.div`
 const Options = styled.div`
   display: flex;
   display: flex;
@@ -49,7 +50,6 @@ const Fields = styled.div`
 `
 `
 const OneColumn = styled.div``
 const OneColumn = styled.div``
 const Column = styled.div`
 const Column = styled.div`
-  ${props => props.left ? 'margin-right: 160px;' : ''}
   margin-top: -16px;
   margin-top: -16px;
 `
 `
 const FieldInputStyled = styled(FieldInput)`
 const FieldInputStyled = styled(FieldInput)`
@@ -86,7 +86,6 @@ type Props = {
   storageConfigDefault?: string,
   storageConfigDefault?: string,
   onAdvancedOptionsToggle?: (showAdvanced: boolean) => void,
   onAdvancedOptionsToggle?: (showAdvanced: boolean) => void,
   wizardType: string,
   wizardType: string,
-  columnStyle?: { [string]: mixed },
   oneColumnStyle?: { [string]: mixed },
   oneColumnStyle?: { [string]: mixed },
   fieldWidth?: number,
   fieldWidth?: number,
   onScrollableRef?: (ref: HTMLElement) => void,
   onScrollableRef?: (ref: HTMLElement) => void,
@@ -239,7 +238,7 @@ class WizardOptions extends React.Component<Props> {
 
 
     if (fields.length * 96 < availableHeight) {
     if (fields.length * 96 < availableHeight) {
       return (
       return (
-        <Fields padding={this.props.layout === 'page' ? null : 32}>
+        <Fields padding={this.props.layout === 'page' ? null : 32} style={{ justifyContent: 'center' }}>
           <OneColumn style={this.props.oneColumnStyle}>
           <OneColumn style={this.props.oneColumnStyle}>
             {fields.map(f => f.component)}
             {fields.map(f => f.component)}
           </OneColumn>
           </OneColumn>
@@ -249,7 +248,7 @@ class WizardOptions extends React.Component<Props> {
 
 
     return (
     return (
       <Fields innerRef={this.props.onScrollableRef} padding={this.props.layout === 'page' ? null : 32}>
       <Fields innerRef={this.props.onScrollableRef} padding={this.props.layout === 'page' ? null : 32}>
-        <Column left style={this.props.columnStyle}>
+        <Column left>
           {fields.map(f => f.column === 'left' && f.component)}
           {fields.map(f => f.column === 'left' && f.component)}
         </Column>
         </Column>
         <Column right>
         <Column right>

+ 2 - 0
src/components/organisms/WizardPageContent/WizardPageContent.jsx

@@ -362,6 +362,7 @@ class WizardPageContent extends React.Component<Props, State> {
             useAdvancedOptions
             useAdvancedOptions
             hasStorageMap={false}
             hasStorageMap={false}
             wizardType={`${this.props.type}-source-options`}
             wizardType={`${this.props.type}-source-options`}
+            layout="page"
           />
           />
         )
         )
         break
         break
@@ -381,6 +382,7 @@ class WizardPageContent extends React.Component<Props, State> {
             storageConfigDefault={this.props.endpointStore.storageConfigDefault}
             storageConfigDefault={this.props.endpointStore.storageConfigDefault}
             wizardType={this.props.type}
             wizardType={this.props.type}
             onAdvancedOptionsToggle={useAdvancedOptions => { this.handleAdvancedOptionsToggle(useAdvancedOptions) }}
             onAdvancedOptionsToggle={useAdvancedOptions => { this.handleAdvancedOptionsToggle(useAdvancedOptions) }}
+            layout="page"
           />
           />
         )
         )
         break
         break

+ 1 - 3
src/components/organisms/WizardStorage/WizardStorage.jsx

@@ -35,6 +35,7 @@ const Wrapper = styled.div`
   width: 100%;
   width: 100%;
   display: flex;
   display: flex;
   justify-content: center;
   justify-content: center;
+  overflow: auto;
 `
 `
 const Mapping = styled.div`
 const Mapping = styled.div`
   display: flex;
   display: flex;
@@ -47,8 +48,6 @@ const StorageWrapper = styled.div`
   flex-direction: column;
   flex-direction: column;
   width: 100%;
   width: 100%;
   margin-bottom: 32px;
   margin-bottom: 32px;
-  max-height: 100%;
-  min-height: 100px;
 
 
   &:last-child {
   &:last-child {
     margin-bottom: 0;
     margin-bottom: 0;
@@ -62,7 +61,6 @@ const StorageSection = styled.div`
 const StorageItems = styled.div`
 const StorageItems = styled.div`
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
-  overflow: auto;
 `
 `
 const StorageItem = styled.div`
 const StorageItem = styled.div`
   display: flex;
   display: flex;