Skip to content

Commit

Permalink
Avoid Bootstrap columns unless there are columns (#7443)
Browse files Browse the repository at this point in the history
* Avoid Bootstrap columns unless there are columns

* Revert Card in GetStartedView

* Fix Activate button alignment

* Snapshots

* Make Extension Console "Get Started" view consistent with other views (#7489)
  • Loading branch information
fregante authored Feb 1, 2024
1 parent 7d61103 commit bb84088
Show file tree
Hide file tree
Showing 38 changed files with 1,527 additions and 1,827 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ module.exports = {
message:
'For safety and convenience, use this instead: import { allSettled } from "@/utils/promiseUtils";',
},
{
message:
"Bootstrap columns should not be used if there's a single column. Use a plain `div` or drop the wrapper altogether if not needed. You might also consider using one of the classes 'max-550', 'max-750', or 'max-950' to limit the width of the body.",
selector:
"JSXElement[openingElement.name.name='Row'] > JSXText:first-child + JSXElement:nth-last-child(2)",
},
{
message:
"Use the `uuid` module instead because crypto.randomUUID is not available in http: contexts",
Expand Down
208 changes: 92 additions & 116 deletions src/__snapshots__/Storyshots.test.js.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 11 additions & 21 deletions src/components/documentBuilder/edit/ElementEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,17 @@ const ElementEditor: React.FC<ElementEditorProps> = ({ documentBodyName }) => {
</Col>
</Row>

<Row>
<Col>
<ElementOptions />
</Col>
</Row>
<Row>
<Col>
<MoveElement documentBodyName={documentBodyName} />
</Col>
</Row>
<Row>
<Col>
<ConnectedCollapsibleFieldSection title="Advanced: Layout">
<CssSpacingField
name={joinName(elementName, "config", "className")}
schema={{ type: "string" }}
label="Spacing"
/>
</ConnectedCollapsibleFieldSection>
</Col>
</Row>
<div>
<ElementOptions />
</div>
<MoveElement documentBodyName={documentBodyName} />
<ConnectedCollapsibleFieldSection title="Advanced: Layout">
<CssSpacingField
name={joinName(elementName, "config", "className")}
schema={{ type: "string" }}
label="Spacing"
/>
</ConnectedCollapsibleFieldSection>
</>
);
};
Expand Down
5 changes: 1 addition & 4 deletions src/components/documentBuilder/edit/PipelineOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import ConnectedFieldTemplate from "@/components/form/ConnectedFieldTemplate";
import React from "react";
import { Col, Row } from "react-bootstrap";
import { joinPathParts } from "@/utils/formUtils";

type PipelineOptionsProps = {
Expand All @@ -26,9 +25,7 @@ type PipelineOptionsProps = {

const PipelineOptions: React.FC<PipelineOptionsProps> = ({ elementName }) => (
<>
<Row>
<Col>Use the Brick Actions Panel on the left to add and edit bricks.</Col>
</Row>
<p>Use the Brick Actions Panel on the left to add and edit bricks.</p>
<ConnectedFieldTemplate
name={joinPathParts(elementName, "config", "label")}
label="Pipeline name"
Expand Down
12 changes: 5 additions & 7 deletions src/components/formBuilder/edit/FormEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,11 @@ const FormEditor: React.FC<FormEditorProps> = ({
<hr />
</>
)}
<Row className={styles.addRow}>
<Col>
<Button onClick={addProperty} variant="primary" size="sm">
<FontAwesomeIcon icon={faPlus} /> Add new field
</Button>
</Col>
</Row>
<div className={styles.addRow}>
<Button onClick={addProperty} variant="primary" size="sm">
<FontAwesomeIcon icon={faPlus} /> Add new field
</Button>
</div>

<Row className={styles.currentFieldRow}>
<Col xl="3" className={styles.currentField}>
Expand Down
Loading

0 comments on commit bb84088

Please sign in to comment.