Skip to content

Commit

Permalink
feat: Build a container block that shows all the staging operations w…
Browse files Browse the repository at this point in the history
…ith a commit button #116
  • Loading branch information
danielstefanequilobe committed Dec 27, 2021
1 parent a55f522 commit 94125af
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
16 changes: 12 additions & 4 deletions src/components/blocks/StagingDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ const StagingDataTableContainer = styled('div')`
overflow-x: scroll;
`;

const ChangeGroupHeader = ({ headings, appStore, onClick }) => {
const ChangeGroupHeader = ({
headings,
appStore,
onClick,
deleteStgingIsVisible,
}) => {
return (
<THead selectedTheme={appStore.theme}>
<Tr color="gray">
Expand All @@ -90,9 +95,11 @@ const ChangeGroupHeader = ({ headings, appStore, onClick }) => {
))}
<Th selectedTheme={appStore.theme}>
<TableCellHeaderText>
<div onClick={onClick}>
<MinusIcon width={16} height={16} />
</div>
{deleteStgingIsVisible && (
<div onClick={onClick}>
<MinusIcon width={16} height={16} />
</div>
)}
</TableCellHeaderText>
</Th>
</Tr>
Expand Down Expand Up @@ -133,6 +140,7 @@ const StagingDataTable = withTheme(({ headings, data, deleteStagingData }) => {
headings={headings}
appStore={appStore}
onClick={() => deleteStagingData(changeGroup.uuid)}
deleteStgingIsVisible={deleteStagingData && true}
/>
<tbody>
{changeGroup.action === 'DELETE' && (
Expand Down
22 changes: 16 additions & 6 deletions src/pages/Projects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getProjects,
getStagingData,
deleteStagingData,
commitStagingData,
} from '../../store/actions/climateWarehouseActions';

const headings = [
Expand Down Expand Up @@ -72,12 +73,21 @@ const Projects = withRouter(({ history }) => {
<Tag body="Unit Text" closeable />
<Tag body="Unit Text" closeable />
</div>
<PrimaryButton
label="Create"
size="large"
icon={<AddIcon width="16.13" height="16.88" fill="#ffffff" />}
onClick={() => history.push('/projects/add')}
/>
{tabValue === 0 && (
<PrimaryButton
label="Create"
size="large"
icon={<AddIcon width="16.13" height="16.88" fill="#ffffff" />}
onClick={() => history.push('/projects/add')}
/>
)}
{tabValue === 1 && (
<PrimaryButton
label="Commit staging"
size="large"
onClick={() => dispatch(commitStagingData())}
/>
)}
</div>
<div>
<Tabs
Expand Down

0 comments on commit 94125af

Please sign in to comment.