Skip to content

Commit 2f18f90

Browse files
committed
address review comments #1659
1 parent c665d5b commit 2f18f90

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

cypress/e2e/with_mock_data/catalogueCategories.cy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ describe('Catalogue Category', () => {
6565
cy.findByTestId('WarningIcon').should('exist');
6666
cy.findByTestId('WarningIcon').trigger('mouseover');
6767
cy.findByText(
68-
'A catalogue category is considered critical if any of its nested child categories or catalogue items are marked as critical.'
68+
'A catalogue category is considered critical if any of its nested child categories or catalogue items are flagged as critical.'
6969
);
7070
cy.findByText('Beam Characterization').click();
7171

7272
cy.findByTestId('WarningIcon').should('exist');
7373
cy.findByTestId('WarningIcon').trigger('mouseover');
7474
cy.findByText(
75-
'A catalogue category is considered critical if any of its nested child categories or catalogue items are marked as critical.'
75+
'A catalogue category is considered critical if any of its nested child categories or catalogue items are flagged as critical.'
7676
);
7777
});
7878

@@ -99,7 +99,7 @@ describe('Catalogue Category', () => {
9999
cy.findByTestId('WarningIcon').trigger('mouseover');
100100
});
101101
cy.findByText(
102-
'A catalogue category is considered critical if any of its nested child categories or catalogue items are marked as critical.'
102+
'A catalogue category is considered critical if any of its nested child categories or catalogue items are flagged as critical.'
103103
);
104104
});
105105

@@ -1507,7 +1507,7 @@ describe('Catalogue Category', () => {
15071507

15081508
it('edits an existing property unit (as admin)', () => {
15091509
cy.visit('/catalogue/10');
1510-
cy.setCurrentUserToAdmin();
1510+
cy.setMode({ admin: true });
15111511

15121512
cy.findAllByRole('button', {
15131513
name: 'Card Actions',
@@ -1703,7 +1703,7 @@ describe('Catalogue Category', () => {
17031703

17041704
it('deletes a property (admin)', () => {
17051705
cy.visit('/catalogue/10');
1706-
cy.setCurrentUserToAdmin();
1706+
cy.setMode({ admin: true });
17071707

17081708
cy.findAllByRole('button', {
17091709
name: 'Card Actions',

src/catalogue/category/catalogueCard.component.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
alpha,
23
Button,
34
Card,
45
CardActions,
@@ -17,7 +18,7 @@ import { CatalogueCategory } from '../../api/api.types';
1718
import CriticalityTooltipIcon from '../../common/criticalityTooltipIcon.component';
1819
import { useAppSelector } from '../../state/hook';
1920
import { selectCriticality } from '../../state/slices/criticalitySlice';
20-
import { OverflowTip, formatDateTimeStrings } from '../../utils';
21+
import { formatDateTimeStrings, OverflowTip } from '../../utils';
2122
import { CriticalTooltipText } from './catalogueCardView.component';
2223
export interface CatalogueCardProps {
2324
table: MRT_TableInstance<CatalogueCategory>;
@@ -65,7 +66,7 @@ function CatalogueCard(props: CatalogueCardProps) {
6566
: undefined,
6667

6768
boxShadow: showFlagged
68-
? `0 0 10px 3px ${theme.palette.error.main}88` // 88 = ~53% opacity for fuzzy glow
69+
? `0 0 10px 3px ${alpha(theme.palette.error.main, 0.53)}` // ~53% opacity for fuzzy glow
6970
: undefined,
7071
})}
7172
>

src/catalogue/category/catalogueCardView.component.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ describe('CardView', () => {
335335

336336
expect(
337337
await screen.findByText(
338-
'A catalogue category is considered critical if any of its nested child categories or catalogue items are marked as critical.'
338+
'A catalogue category is considered critical if any of its nested child categories or catalogue items are flagged as critical.'
339339
)
340340
).toBeInTheDocument();
341341
});
@@ -365,7 +365,7 @@ describe('CardView', () => {
365365

366366
expect(
367367
await screen.findByText(
368-
'A catalogue category is considered critical if any of its nested child categories or catalogue items are marked as critical.'
368+
'A catalogue category is considered critical if any of its nested child categories or catalogue items are flagged as critical.'
369369
)
370370
).toBeInTheDocument();
371371
});

src/catalogue/category/catalogueCardView.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const CopyCategoriesButton = (props: {
160160
export const CriticalTooltipText = (
161161
<Typography style={{ whiteSpace: 'pre-line' }}>
162162
A catalogue category is considered critical if any of its nested child
163-
categories or catalogue items are marked as critical.
163+
categories or catalogue items are flagged as critical.
164164
</Typography>
165165
);
166166

@@ -323,7 +323,7 @@ function CatalogueCardView() {
323323
enableGrouping: false,
324324
},
325325
{
326-
header: 'is Critical',
326+
header: 'Is Critical',
327327
Header: ({ column }) => (
328328
<Box sx={{ display: 'flex', alignItems: 'center' }}>
329329
<Tooltip title={CriticalTooltipText}>

src/catalogue/category/catalogueCategoryTableView.component.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ describe('CatalogueCategoryTableView', () => {
404404

405405
expect(
406406
await screen.findByText(
407-
'A catalogue category is considered critical if any of its nested child categories or catalogue items are marked as critical.'
407+
'A catalogue category is considered critical if any of its nested child categories or catalogue items are flagged as critical.'
408408
)
409409
).toBeInTheDocument();
410410
});

src/utils.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
alpha,
23
Link as MuiLink,
34
SxProps,
45
TableCell,
@@ -332,8 +333,9 @@ function getNestedProperty(obj: any, path: string): any {
332333
.reduce((o, p) => (o && o[p] !== undefined ? o[p] : undefined), obj);
333334
}
334335

335-
interface ModifiedMRTGroupedCellProps<TData extends MRT_RowData>
336-
extends MRTGroupedCellProps<TData> {
336+
interface ModifiedMRTGroupedCellProps<
337+
TData extends MRT_RowData,
338+
> extends MRTGroupedCellProps<TData> {
337339
outputType?: 'Link' | 'Date'; // default is Text
338340
}
339341

@@ -694,6 +696,6 @@ export function isExactFilterActive<TData extends MRT_RowData>(
694696

695697
export const criticalityRowStyle = (theme: Theme) => {
696698
return {
697-
backgroundColor: theme.palette.error.main + '11', // ~7% tint
699+
backgroundColor: alpha(theme.palette.error.main, 0.07), // ~7% tint
698700
};
699701
};

0 commit comments

Comments
 (0)