Skip to content

Commit

Permalink
lint + format
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDarsa committed Feb 26, 2024
1 parent 2a1ae83 commit aee6615
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module.exports = {
extends: ['next', 'plugin:storybook/recommended'],
rules: {
'import/no-anonymous-default-export': 'off',
'react/no-unescaped-entities': 'off',
'react/no-unescaped-entities': 0,
'react/display-name': 'off',
},
ignorePatterns: ['src/**/*.stories.js'],
ignorePatterns: ['src/**/*.stories.js', 'src/**/*.stories.tsx', 'src/tours'],

overrides: [
{
Expand Down
6 changes: 5 additions & 1 deletion .storybook/mocks/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface Tasks {
created: string;
service: string;
status: string;
id: string;
}[];
environmentSlug: string;
projectSlug: string;
Expand All @@ -27,8 +28,9 @@ interface Task {
status: string;
files: TaskFile[];
logs: string;
taskName?: string;
taskName: string;
name?: string;
id: string;
};
}
faker.setDefaultRefDate(new Date(`${new Date().getFullYear().toString()}-01-01`));
Expand All @@ -45,6 +47,7 @@ export function createTasks(): Tasks {
created: faker.date.anytime().toDateString(),
service: 'cli',
status: faker.helpers.arrayElement(['Pending', 'In progress', 'Completed']),
id: faker.string.uuid(),
};
});

Expand Down Expand Up @@ -89,6 +92,7 @@ export function createTask(): Task {
files,
logs: log,
taskName: faker.lorem.slug(2),
id: faker.string.uuid(),
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ActiveStandbyConfirm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ActiveStandbyConfirm: FC<ActiveStandbyConfirmProps> = ({
<div className="margins">
<Button action={openModal}>Switch Active/Standby environments</Button>
</div>
<Modal isOpen={open} onRequestClose={closeModal} contentLabel="Confirm">
<Modal variant={null} isOpen={open} onRequestClose={closeModal} contentLabel="Confirm">
<StyledActiveStandbyConfirmModal>
<p>
This will replace the current active environment
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddTask/components/CustomTaskConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const CustomTaskConfirm: FC<CustomTaskConfirmProps> = ({
Confirm Task
</Button>
</div>
<Modal isOpen={open} onRequestClose={closeModal} contentLabel={`Confirm`}>
<Modal variant={null} isOpen={open} onRequestClose={closeModal} contentLabel={`Confirm`}>
<React.Fragment>
<ReactMarkdown>{taskText}</ReactMarkdown>
<div className="form-input">
Expand Down
2 changes: 2 additions & 0 deletions src/components/DeleteConfirm/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';

import { DeleteOutlined } from '@ant-design/icons';
import { action } from '@storybook/addon-actions';
import { Meta } from '@storybook/react';

Expand Down Expand Up @@ -41,6 +42,7 @@ export const WithConfirmationBlocked = ({
closeModalFunction,
}: Props) => (
<DeleteConfirmBaseComponent
icon={<DeleteOutlined />}
deleteType="environment"
deleteName="Forty-two"
onDelete={onDeleteFunction}
Expand Down
2 changes: 1 addition & 1 deletion src/components/link/EnvironmentVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const getLinkData = (environmentSlug, projectSlug) => ({
/**
* Links to the environment variables page given the project name and the openshift project name.
*/
const EnvironmentVariablesLink = ({ environmentSlug, projectSlug, children, className = null, prefetch = false }) => {
const EnvironmentVariablesLink = ({ environmentSlug, projectSlug, children, className = '', prefetch = false }) => {
const linkData = getLinkData(environmentSlug, projectSlug);

return (
Expand Down
8 changes: 6 additions & 2 deletions src/layouts/GlobalStyles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DefaultTheme, GlobalStyleComponent, createGlobalStyle } from 'styled-co
* Applies styles globally to any component nested inside it.
*/

export const GlobalStyles: GlobalStyleComponent<{}, DefaultTheme> = createGlobalStyle`
export const GlobalStyles: GlobalStyleComponent<Record<string, never>, DefaultTheme> = createGlobalStyle`
* {
box-sizing: border-box;
}
Expand Down Expand Up @@ -313,4 +313,8 @@ main{
}
`;

export default React.memo(() => <GlobalStyles />);
const AppGlobalStyles = React.memo(() => <GlobalStyles />);

AppGlobalStyles.displayName = 'GlobalStyles';

export default AppGlobalStyles;
9 changes: 8 additions & 1 deletion src/stories/organizations/organizationGroups.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export const Default: Story = {
graphql.mutation('addGroup', (req, res, ctx) => {
const { group } = req.variables;

const newGroup = { __typename: 'Group', name: group, id: faker.lorem.slug(), members: [], type: 'null' };
const newGroup = {
__typename: 'Group',
name: group,
id: faker.lorem.slug(),
members: [],
type: 'null',
memberCount: 0,
};

// "add" into the mock group for future refetch
mockOrganization.groups = [newGroup, ...mockOrganization.groups];
Expand Down

0 comments on commit aee6615

Please sign in to comment.