Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix margin and padding issues with CatalogTree table #19950

Merged
merged 2 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use "scss/variables";

.streamFieldTableContainer {
margin-left: 85px;
margin-left: 83px;
background: colors.$grey-50;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use "scss/variables";

.catalogTreeTable {
padding: variables.$spacing-lg variables.$spacing-xl 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useConnectionFormService } from "hooks/services/ConnectionForm/Connecti
import { naturalComparatorBy } from "utils/objects";

import { BulkHeader } from "./BulkHeader";
import styles from "./CatalogTree.module.scss";
import { CatalogTreeBody } from "./CatalogTreeBody";
import { CatalogTreeHeader } from "./CatalogTreeHeader";
import { CatalogTreeSearch } from "./CatalogTreeSearch";
Expand Down Expand Up @@ -65,23 +66,25 @@ const CatalogTreeComponent: React.FC<React.PropsWithChildren<CatalogTreeProps>>
<BulkEditServiceProvider nodes={streams} update={onStreamsChanged}>
<LoadingBackdrop loading={isLoading}>
{mode !== "readonly" && <CatalogTreeSearch onSearch={setSearchString} />}
{isNewStreamsTableEnabled ? (
<>
<StreamConnectionHeader />
<CatalogTreeTableHeader />
</>
) : (
<>
<CatalogTreeHeader />
<CatalogTreeSubheader />
<BulkHeader />
</>
)}
<CatalogTreeBody
streams={filteredStreams}
changedStreams={changedStreams}
onStreamChanged={onSingleStreamChanged}
/>
<div className={isNewStreamsTableEnabled ? undefined : styles.catalogTreeTable}>
{isNewStreamsTableEnabled ? (
<>
<StreamConnectionHeader />
<CatalogTreeTableHeader />
</>
) : (
<>
<CatalogTreeHeader />
<CatalogTreeSubheader />
<BulkHeader />
</>
)}
<CatalogTreeBody
streams={filteredStreams}
changedStreams={changedStreams}
onStreamChanged={onSingleStreamChanged}
/>
</div>
</LoadingBackdrop>
{isNewStreamsTableEnabled && <BulkEditPanel />}
</BulkEditServiceProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
}

.searchContent {
position: relative;
width: 100%;
padding-left: variables.$spacing-xl;

&::before {
content: attr(data-content);
}
}

.searchContentNew {
position: relative;
width: 100%;
padding: 0 variables.$spacing-xl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import classnames from "classnames";
import React from "react";
import { useIntl } from "react-intl";

Expand All @@ -11,17 +10,10 @@ interface CatalogTreeSearchProps {
}

export const CatalogTreeSearch: React.FC<CatalogTreeSearchProps> = ({ onSearch }) => {
const isNewStreamsTableEnabled = process.env.REACT_APP_NEW_STREAMS_TABLE ?? false;

const { formatMessage } = useIntl();

const searchStyles = classnames({
[styles.searchContentNew]: isNewStreamsTableEnabled,
[styles.searchContent]: !isNewStreamsTableEnabled,
});

return (
<div className={searchStyles}>
<div className={styles.searchContent}>
<Input
className={styles.searchInput}
placeholder={formatMessage({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
@use "scss/colors";
@use "scss/variables";

.container {
padding-bottom: variables.$spacing-md;

// HACK: Hot-fixes an issue in StreamHeader SCSS where the .catalogSectionRow margin-top is creating a spacing between rows
margin-bottom: -9px;
josephkmh marked this conversation as resolved.
Show resolved Hide resolved
}

.rowsContainer {
background: colors.$white;
border-radius: variables.$border-radius-md;
margin: 0 10px 5px;
margin: 0 variables.$spacing-md;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface StreamFieldTableProps {

export const StreamFieldTable: React.FC<StreamFieldTableProps> = (props) => {
return (
<>
<div className={styles.container}>
<TreeRowWrapper noBorder>
<FieldHeader />
</TreeRowWrapper>
Expand All @@ -38,6 +38,6 @@ export const StreamFieldTable: React.FC<StreamFieldTableProps> = (props) => {
</TreeRowWrapper>
))}
</div>
</>
</div>
);
};

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export const ConnectionFormFields: React.FC<ConnectionFormFieldsProps> = ({ valu
clearFormChange(formId);
});

const isNewStreamsTableEnabled = process.env.REACT_APP_NEW_STREAMS_TABLE ?? false;

return (
<>
{/* FormChangeTracker is here as it has access to everything it needs without being repeated */}
Expand Down Expand Up @@ -118,7 +116,7 @@ export const ConnectionFormFields: React.FC<ConnectionFormFieldsProps> = ({ valu
)}
</Field>
</Section>
<Section className={isNewStreamsTableEnabled ? styles.flush : undefined}>
<Section className={styles.flush}>
<Field
name="syncCatalog.streams"
component={SyncCatalogField}
Expand Down