Skip to content

Commit

Permalink
rm merge conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Dec 17, 2024
2 parents d67c431 + 588d510 commit 2aa231c
Show file tree
Hide file tree
Showing 23 changed files with 261 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/[email protected]

- name: Download Site dir
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GH_ACCESS_TOKEN }}
workflow: build-and-preview-site.yml
Expand Down
5 changes: 5 additions & 0 deletions src/constants/iconsSizes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// icon styles, setting general height and width properties to solves scaling and consistency problems

export const iconXSmall = {
height: 16,
width: 16
};

export const iconSmall = {
height: 20,
width: 20
Expand Down
9 changes: 6 additions & 3 deletions src/custom/CatalogDesignTable/CatalogDesignTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface CatalogDesignsTableProps {
setPage: (page: number) => void;
columnVisibility: Record<string, boolean>;
colViews: ColView[];
rowsPerPageOptions?: number[];
handleBulkDeleteModal: (patterns: Pattern[], modalRef: React.RefObject<PromptRef>) => void;
setSearch?: (search: string) => void;
handleBulkpatternsDataUnpublishModal: (
Expand All @@ -49,6 +50,7 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
colViews = [],
handleBulkDeleteModal,
setSearch,
rowsPerPageOptions = [10, 25, 50, 100],
handleBulkpatternsDataUnpublishModal
}) => {
const theme = useTheme();
Expand Down Expand Up @@ -144,10 +146,9 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
page,
elevation: 0,
sortOrder: {
name: 'updated_at',
direction: 'desc'
name: sortOrder.split(' ')[0],
direction: sortOrder.split(' ')[1]
},

onTableChange: handleTableChange,
customToolbarSelect: _.isNil(filter)
? (selected: any) => (
Expand Down Expand Up @@ -175,6 +176,7 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
filter,
totalCount,
pageSize,
sortOrder,
page,
handleTableChange,
patterns,
Expand All @@ -195,6 +197,7 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
data={patterns || []}
rowsPerPageOptions={rowsPerPageOptions}
options={options}
colViews={colViews}
tableCols={processedColumns}
Expand Down
2 changes: 1 addition & 1 deletion src/custom/CatalogDesignTable/DesignTableColumnConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const createDesignsColumnsConfig = ({
},
{
name: 'name',
label: 'Pattern Name',
label: 'Name',
options: {
filter: false,
sort: true,
Expand Down
10 changes: 5 additions & 5 deletions src/custom/CatalogDetail/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
backgroundColor: 'transparent',
border: `1px solid ${theme.palette.border.normal}`,
gap: '10px',
color: charcoal[10]
color: theme.palette.text.default
}}
onClick={() =>
cleanedType === RESOURCE_TYPES.FILTERS
? downloadFilter(details.id, details.name)
: downloadYaml(details.pattern_file, details.name)
}
>
<Download width={24} height={24} fill={charcoal[10]} />
<Download width={24} height={24} fill={theme.palette.icon.default} />
Download
</ActionButton>

Expand All @@ -108,7 +108,7 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
<CircularProgress size={24} color={'inherit'} />
) : (
<>
<CopyIcon width={24} height={24} fill={charcoal[10]} />
<CopyIcon width={24} height={24} fill={theme.palette.icon.default} />
Clone
</>
)}
Expand Down Expand Up @@ -136,7 +136,7 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
}}
onClick={handleInfoClick}
>
<EditIcon width={24} height={24} fill={charcoal[10]} />
<EditIcon width={24} height={24} fill={theme.palette.icon.default} />
Edit
</ActionButton>
)}
Expand All @@ -151,7 +151,7 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
}}
onClick={handleShare}
>
<ShareLineIcon width="24" height="24" fill={charcoal[10]} />
<ShareLineIcon width="24" height="24" fill={theme.palette.icon.default} />
Share
</ActionButton>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/custom/CatalogDetail/RelatedDesigns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ const RelatedDesigns: React.FC<RelatedDesignsProps> = ({
);

if (!filteredPatternsPerUser?.length) return null;

const organizationName = fetchingOrgError || !orgName ? 'Unknown Organization' : orgName;
return (
<AdditionalContainer>
<ContentHeading>
<h2 style={{ margin: '0', textTransform: 'uppercase' }}>
Other published design by {formatToTitleCase(userProfile?.first_name ?? '')}{' '}
{fetchingOrgError ? '' : `under ${orgName}`}
{fetchingOrgError ? '' : `under ${organizationName}`}
</h2>
</ContentHeading>
<DesignCardContainer>
Expand Down
32 changes: 23 additions & 9 deletions src/custom/CatalogDetail/SocialSharePopper.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import { Box, IconButton, Menu, MenuItem } from '@mui/material';
import React, { useState } from 'react';
import { FacebookShareButton, LinkedinShareButton, TwitterShareButton } from 'react-share';
import { ChainIcon, FacebookIcon, LinkedinIcon, ShareIcon, TwitterIcon } from '../../icons';

import {
ChainIcon,
FacebookIcon,
LinkedinIcon,
LockIcon,
PublicIcon,
ShareIcon,
TwitterIcon
} from '../../icons';
import { useTheme } from '../../theme';
import { Pattern } from '../CustomCatalog/CustomCard';
import { CustomTooltip } from '../CustomTooltip';
import { ErrorBoundary } from '../ErrorBoundary';
import { CopyShareIconWrapper, VisibilityChip } from './style';

import { VisibilityChipMenu } from '../VisibilityChipMenu';
import { VIEW_VISIBILITY } from '../VisibilityChipMenu/VisibilityChipMenu';
import { CopyShareIconWrapper } from './style';

interface SocialSharePopperProps {
details: Pattern;
Expand Down Expand Up @@ -44,13 +56,15 @@ const SocialSharePopper: React.FC<SocialSharePopperProps> = ({
return (
<ErrorBoundary>
<CopyShareIconWrapper style={{ marginBottom: '2rem' }}>
<VisibilityChip
style={{
color: theme.palette.text.default
}}
>
{details?.visibility}
</VisibilityChip>
<VisibilityChipMenu
value={details?.visibility as VIEW_VISIBILITY}
onChange={() => {}}
enabled={false}
options={[
[VIEW_VISIBILITY.PUBLIC, PublicIcon],
[VIEW_VISIBILITY.PRIVATE, LockIcon]
]}
/>

<CustomTooltip title="Copy Link" placement="top" arrow>
<IconButton
Expand Down
48 changes: 32 additions & 16 deletions src/custom/CatalogDetail/style.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Link, ListItemButton, Paper, Typography } from '../../base';
import { Button, ButtonGroup, Link, ListItemButton, Typography } from '../../base';
import { styled } from '../../theme';
import { Theme } from './types';

export const StyledActionWrapper = styled(Paper)(() => ({
export const StyledActionWrapper = styled('div')(({ theme }) => ({
boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.2)',
justifyContent: 'center',
width: '100%',
Expand All @@ -12,7 +12,8 @@ export const StyledActionWrapper = styled(Paper)(() => ({
flexDirection: 'column',
gap: '1rem',
padding: '0.6rem',
alignItems: 'center'
alignItems: 'center',
backgroundColor: theme.palette.background.default
}));

interface ActionButtonProps {
Expand Down Expand Up @@ -139,7 +140,8 @@ export const ContentDetailsPoints = styled(Typography)(() => ({
fontFamily: 'inherit'
}));

export const MetricsSection = styled('div')(() => ({
export const MetricsSection = styled('div')(({ theme }) => ({
backgroundColor: theme.palette.background.default,
padding: '1.1rem',
marginTop: '0.5rem',
display: 'flex',
Expand All @@ -152,7 +154,8 @@ export const MetricsSection = styled('div')(() => ({
}
}));

export const MetricsContainer = styled('div')(() => ({
export const MetricsContainer = styled('div')(({ theme }) => ({
backgroundColor: theme.palette.background.default,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
Expand Down Expand Up @@ -236,13 +239,14 @@ export const AdditionalContainer = styled('div')(({ theme }) => ({
borderRadius: '0.4rem'
}));

export const DesignCardContainer = styled('div')(() => ({
export const DesignCardContainer = styled('div')(({ theme }) => ({
display: 'flex',
flexWrap: 'wrap',
flex: '0 0 75%',
gap: '2rem',
justifyContent: 'space-around',
height: 'fit-content'
height: 'fit-content',
backgroundColor: theme.palette.background.default
}));

export const CopyShareIconWrapper = styled(ContentHeading)(() => ({
Expand All @@ -251,17 +255,29 @@ export const CopyShareIconWrapper = styled(ContentHeading)(() => ({
width: 'fit-content'
}));

export const VisibilityChip = styled('div')(() => ({
borderRadius: '0.5rem',
border: '1px solid gray',
padding: '0.2rem 0.5rem',
textTransform: 'capitalize',
color: '#1a1a1acc',
width: 'fit-content'
}));

export const RedirectLink = styled(Link)(({ theme }) => ({
color: theme.palette.background.brand?.default,
textDecoration: 'none',
cursor: 'pointer'
}));

export const ShareButtonGroup = styled(ButtonGroup)({
boxShadow: 'none',
border: 'none',
outline: 'none',
height: '76%'
});

export const ShareButton = styled(Button)(({ theme }) => ({
backgroundColor: theme.palette.background.brand?.default,
color: 'white',
border: 'none',
borderRadius: '0.5rem 0px 0px 0.5rem'
}));

export const ShareSideButton = styled(Button)(({ theme }) => ({
backgroundColor: theme.palette.background.brand?.default,
color: 'white',
border: 'none',
borderRadius: '0px 0.5rem 0.5rem 0px'
}));
7 changes: 3 additions & 4 deletions src/custom/CustomTooltip/customTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tooltip, type TooltipProps } from '@mui/material';
import React from 'react';
import { Tooltip, TooltipProps } from '../../base';
import { WHITE } from '../../theme';
import { RenderMarkdownTooltip } from '../Markdown';

Expand All @@ -21,7 +21,7 @@ function CustomTooltip({
fontSize,
fontWeight = 400,
variant = 'standard',
bgColor = '#333333',
bgColor = '#141414',
...props
}: CustomTooltipProps): JSX.Element {
return (
Expand All @@ -35,8 +35,7 @@ function CustomTooltip({
fontWeight: { fontWeight },
borderRadius: '0.5rem',
padding: variant === 'standard' ? '0.9rem' : '0.5rem 0.75rem',
boxShadow:
'rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px'
boxShadow: 'rgba(0, 0, 0, 0.6) 0px 4px 10px, rgba(0, 0, 0, 0.5) 0px 2px 4px'
}
},
popper: {
Expand Down
5 changes: 4 additions & 1 deletion src/custom/ResponsiveDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const DataTableEllipsisMenu: React.FC<{
open={Boolean(anchorEl)}
onClose={handleClose}
sx={{
fontFamily: theme?.typography.fontFamily,
'& .MuiPaper-root': {
backgroundColor: theme?.palette.background.default ?? 'white'
}
Expand Down Expand Up @@ -122,6 +123,9 @@ export const DataTableEllipsisMenu: React.FC<{

const dataTableTheme = (theme: Theme, backgroundColor?: string) =>
createTheme({
typography: {
fontFamily: theme.typography.fontFamily
},
components: {
MuiPaper: {
styleOverrides: {
Expand All @@ -134,7 +138,6 @@ const dataTableTheme = (theme: Theme, backgroundColor?: string) =>
MuiTable: {
styleOverrides: {
root: {
// border: `2px solid ${theme.palette.border.normal}`,
width: '-webkit-fill-available',
'@media (max-width: 500px)': {
wordWrap: 'break-word'
Expand Down
3 changes: 3 additions & 0 deletions src/custom/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { TooltipIcon } from './TooltipIconButton';

const customTheme = (theme: Theme) =>
createTheme({
typography: {
fontFamily: theme.typography.fontFamily
},
components: {
MuiTextField: {
styleOverrides: {
Expand Down
1 change: 1 addition & 0 deletions src/custom/StyledSearchBar/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { styled } from '@mui/material';
import { InputAdornment, OutlinedInput } from '../../base';

export const StyledSearchInput = styled(OutlinedInput)(({ style, theme }) => ({
fontFamily: theme.typography.fontFamily,
width: '100%',
'@media (max-width: 590px)': {
marginLeft: '0.25rem',
Expand Down
18 changes: 13 additions & 5 deletions src/custom/TeamTable/TeamTableConfiguration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export default function TeamTableConfiguration({
['name', 'xs'],
['description', 'm'],
['owner', 'l'],
['created_at', 'xl'],
['created_at', 'na'],
['updated_at', 'xl'],
['deleted_at', 'na'],
['actions', 'xs']
];
Expand Down Expand Up @@ -165,6 +166,16 @@ export default function TeamTableConfiguration({
sortDescFirst: true
}
},
{
name: 'updated_at',
label: 'Updated At',
options: {
filter: false,
sort: true,
searchable: false,
sortDescFirst: true
}
},
{
name: 'deleted_at',
label: 'Deleted At',
Expand Down Expand Up @@ -290,10 +301,7 @@ export default function TeamTableConfiguration({
backgroundColor: '#f3f1f1'
}
},
sortOrder: {
name: 'created_at',
direction: 'desc'
},

viewColumns: false,
search: false,
rowsExpanded: [ExpandedRowIdx],
Expand Down
2 changes: 2 additions & 0 deletions src/custom/UserSearchField/UserSearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
<Autocomplete
id="user-search-field"
sx={{ width: 'auto' }}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
filterOptions={(x) => x}
options={options}
disableClearable
Expand Down
Loading

0 comments on commit 2aa231c

Please sign in to comment.