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

Add Tag, TagManagementDialog and SimpleConfirmationDialog components #166

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

JSReds
Copy link
Contributor

@JSReds JSReds commented Dec 23, 2024

Change-type: minor

@JSReds JSReds requested a review from myarmolinsky December 23, 2024 15:46
@JSReds JSReds self-assigned this Dec 23, 2024
Copy link
Contributor

flowzone-app bot commented Dec 23, 2024

Website deployed to CF Pages, 👀 preview link https://36c7bf22.balena-design-system.pages.dev

@flowzone-app flowzone-app bot enabled auto-merge December 23, 2024 15:51
@JSReds JSReds force-pushed the add-tag-and-management-modal branch from d199a93 to 1cc47e2 Compare December 23, 2024 16:12
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Box, type BoxProps, Button, Tooltip, Typography } from '@mui/material';

// Prevent the filters taking up too much horizontal space
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment does not make much sense in the context of the library alone, is there something a bit more generic we can change it to?

{onClose && (
<Button
sx={(theme) => ({
p: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p: 1,
py: 1,

pl: 2,
pr: 3,
fontSize: 1,
color: theme.palette.customGrey.main,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not one of our colors, is it?

SimpleConfirmationDialog,
} from '../SimpleConfirmationDialog';

const RESERVED_NAMESPACE = 'io.resin.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

io.balena. is reserved as well

itemType,
count,
})}
<br />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the <br /> for? Can we just pass the paragraph prop to Typography?

<SimpleConfirmationDialog {...confirmationDialogOptions} />
)}
</Stack>
<Box>{error && <Callout severity="danger">{error.message}</Callout>}</Box>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the Box there for? Can we remove it so it's not in the DOM when there is no error?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is not used. Should be able to delete it

</TableRow>
) : (
tags.map((tag) => {
console.log(tag, items, tagDiffs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚓

Comment on lines 149 to 176
/**
* Displays a Dialog to manage Tags.
*
* [View story source](https://github.com/balena-io-modules/rendition/blob/master/src/components/TagManagementDialog/TagManagementDialog.stories.tsx)
*
*
*
* Dialog Strings:
*
* | `Name |` Description |
* |------|-------------|
* | `labels.tags` | Tags |
* | `labels.shared` | Shared |
* | `labels.tag_name` | Tag name |
* | `labels.value` | Value |
* | `labels.tag_value` | Tag value |
* | `actions.ok` | OK |
* | `actions.cancel` | Cancel |
* | `actions.add_tag` | Add tag |
* | `actions.continue` | Continue |
* | `actions.undo_add` | Undo add |
* | `actions.undo_edit` | Undo edit |
* | `actions.undo_delete` | Undo delete |
* | `actions.apply_item_type_count` | Apply |
* | `actions.apply_item_type_count_plural` | Apply to {{count}} {{itemType}} |
* | `actions_messages.confirmation` | Are you sure? |
* | `actions_confirmations.confirm_to_proceed` | Do you want to proceed? |
* | `no_data.no_name_set` | No name set |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment necessary? We should just be referencing the translations file IMO


return (
<DialogWithCloseButton
open={true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
open={true}
open

{items.length > 1 && <span>{t('labels.shared')} </span>}
{t('labels.tags')}
</Typography>
<Box pl={1}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pl 1?

<TableCell>
{showPreviousTagProperties && (
<PreviousTagProperty state={tag.state}>
<Box>{tag.tag_key}</Box>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Box wrapping necessary?

)}
{tag.state !== 'deleted' && (
<TagProperty state={tag.state}>
<Box>{tag.tag_key}</Box>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

<TableCell>
{showPreviousTagProperties && (
<PreviousTagProperty state={tag.state}>
<Box>{tag.initialValue ?? NBSP}</Box>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

</TableCell>
<TableCell>
{tag.state && (
<Box alignItems="center" justifyContent="flex-end">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't these not do anything if the Box is not flex?

@JSReds JSReds force-pushed the add-tag-and-management-modal branch from 1cc47e2 to 651efdf Compare December 23, 2024 17:13
@JSReds JSReds force-pushed the add-tag-and-management-modal branch from 651efdf to d0df74c Compare December 23, 2024 17:15
@flowzone-app flowzone-app bot merged commit 1173849 into master Dec 23, 2024
52 checks passed
@flowzone-app flowzone-app bot deleted the add-tag-and-management-modal branch December 23, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants