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

ci(ui): Add prettier to CI #10741

Merged
merged 3 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@
"build": "yarn run generate && NODE_OPTIONS='--max-old-space-size=3072 --openssl-legacy-provider' CI=false vite build",
"test": "vitest",
"generate": "graphql-codegen --config codegen.yml",
"lint": "eslint . --ext .ts,.tsx --quiet && yarn type-check",
"lint": "eslint . --ext .ts,.tsx --quiet && yarn format-check && yarn type-check",
"lint-fix": "eslint '*/**/*.{ts,tsx}' --quiet --fix",
"format-check": "prettier --check src",
"format": "prettier --write src",
"type-check": "tsc --noEmit",
"type-watch": "tsc -w --noEmit"
},
Expand Down
6 changes: 3 additions & 3 deletions datahub-web-react/src/App.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// less preprocessor configuration.

@font-face {
font-family: 'Manrope';
font-style: normal;
src: local('Manrope'), url('./fonts/manrope.woff2') format('woff2'),
font-family: 'Manrope';
font-style: normal;
src: local('Manrope'), url('./fonts/manrope.woff2') format('woff2');
}
28 changes: 14 additions & 14 deletions datahub-web-react/src/Mocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1453,10 +1453,10 @@ export const businessAttribute = {
name: 'TestBusinessAtt-2',
description: 'lorem upsum updated 12',
created: {
time: 1705857132786
time: 1705857132786,
},
lastModified: {
time: 1705857132786
time: 1705857132786,
},
glossaryTerms: {
terms: [
Expand All @@ -1465,10 +1465,10 @@ export const businessAttribute = {
urn: 'urn:li:glossaryTerm:1',
type: EntityType.GlossaryTerm,
hierarchicalName: 'SampleHierarchicalName',
name: 'SampleName',
name: 'SampleName',
},
associatedUrn: 'urn:li:businessAttribute:ba1'
}
associatedUrn: 'urn:li:businessAttribute:ba1',
},
],
__typename: 'GlossaryTerms',
},
Expand All @@ -1483,7 +1483,7 @@ export const businessAttribute = {
name: 'abc-sample-tag',
},
__typename: 'TagAssociation',
associatedUrn: 'urn:li:businessAttribute:ba1'
associatedUrn: 'urn:li:businessAttribute:ba1',
},
{
tag: {
Expand All @@ -1493,30 +1493,30 @@ export const businessAttribute = {
name: 'TestTag',
},
__typename: 'TagAssociation',
associatedUrn: 'urn:li:businessAttribute:ba1'
}
]
associatedUrn: 'urn:li:businessAttribute:ba1',
},
],
},
customProperties: [
{
key: 'prop2',
value: 'val2',
associatedUrn: 'urn:li:businessAttribute:ba1',
__typename: 'CustomPropertiesEntry'
__typename: 'CustomPropertiesEntry',
},
{
key: 'prop1',
value: 'val1',
associatedUrn: 'urn:li:businessAttribute:ba1',
__typename: 'CustomPropertiesEntry'
__typename: 'CustomPropertiesEntry',
},
{
key: 'prop3',
value: 'val3',
associatedUrn: 'urn:li:businessAttribute:ba1',
__typename: 'CustomPropertiesEntry'
}
]
__typename: 'CustomPropertiesEntry',
},
],
},
ownership: {
owners: [
Expand Down
21 changes: 12 additions & 9 deletions datahub-web-react/src/app/SearchRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,18 @@ export const SearchRoutes = (): JSX.Element => {
<Route path={PageRoutes.INGESTION} render={() => <ManageIngestionPage />} />
<Route path={PageRoutes.SETTINGS} render={() => <SettingsPage />} />
<Route path={`${PageRoutes.GLOSSARY}*`} render={() => <GlossaryRoutes />} />
<Route path={PageRoutes.BUSINESS_ATTRIBUTE} render={() => {
if (!appConfigContextLoaded) {
return null;
}
if (businessAttributesFlag) {
return <BusinessAttributes />;
}
return <NoPageFound />;
}}/>
<Route
path={PageRoutes.BUSINESS_ATTRIBUTE}
render={() => {
if (!appConfigContextLoaded) {
return null;
}
if (businessAttributesFlag) {
return <BusinessAttributes />;
}
return <NoPageFound />;
}}
/>
<Route component={NoPageFound} />
</Switch>
</SearchablePage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('timeSeriesChart', () => {
});

it('compute lines works works correctly for monthly case', () => {
const chartData:TimeSeriesChart = {
const chartData: TimeSeriesChart = {
title: 'Weekly Active Users',
lines: [
{
Expand Down
4 changes: 3 additions & 1 deletion datahub-web-react/src/app/auth/ResetCredentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const FormInput = styled(Input)`
`;

const StyledFormItem = styled(Form.Item)`
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper {
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
.ant-input-affix-wrapper-borderless
).ant-input-affix-wrapper {
background-color: transparent;
}
`;
Expand Down
4 changes: 3 additions & 1 deletion datahub-web-react/src/app/auth/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const TitleSelector = styled(Select)`
`;

const StyledFormItem = styled(Form.Item)`
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper {
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
.ant-input-affix-wrapper-borderless
).ant-input-affix-wrapper {
background-color: transparent;
}
`;
Expand Down
14 changes: 7 additions & 7 deletions datahub-web-react/src/app/auth/login.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%,-50%);
transform: translate(-50%, -50%);
}

.login_logo_box {
Expand All @@ -28,28 +28,28 @@

.login_form_box {
width: 100%;
background-color: #1C1C1C;
background-color: #1c1c1c;
border: 1px solid #555555;
border-radius: 5px;
padding: 2em;
}

.login_button {
color: #171717;
background-color: #EEEEEE;
border: 1px solid #555555;
background-color: #eeeeee;
border: 1px solid #555555;
height: 40px;
font-size: 14px;
}

.login_button:hover {
color: white;
background-color: transparent;
border: 1px solid #555555;
border: 1px solid #555555;
}

.sso_button {
color: #EEEEEE;
color: #eeeeee;
background-color: #171717;
border: 1px solid #555555;
height: 40px;
Expand All @@ -60,4 +60,4 @@
color: black;
background-color: white;
border: 1px solid #555555;
}
}
8 changes: 4 additions & 4 deletions datahub-web-react/src/app/buildEntityRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import GlossaryNodeEntity from './entity/glossaryNode/GlossaryNodeEntity';
import { DataPlatformEntity } from './entity/dataPlatform/DataPlatformEntity';
import { DataProductEntity } from './entity/dataProduct/DataProductEntity';
import { DataPlatformInstanceEntity } from './entity/dataPlatformInstance/DataPlatformInstanceEntity';
import { ERModelRelationshipEntity } from './entity/ermodelrelationships/ERModelRelationshipEntity'
import { ERModelRelationshipEntity } from './entity/ermodelrelationships/ERModelRelationshipEntity';
import { RoleEntity } from './entity/Access/RoleEntity';
import { RestrictedEntity } from './entity/restricted/RestrictedEntity';
import {BusinessAttributeEntity} from "./entity/businessAttribute/BusinessAttributeEntity";
import { BusinessAttributeEntity } from './entity/businessAttribute/BusinessAttributeEntity';
import { SchemaFieldPropertiesEntity } from './entity/schemaField/SchemaFieldPropertiesEntity';

export default function buildEntityRegistry() {
Expand All @@ -48,9 +48,9 @@ export default function buildEntityRegistry() {
registry.register(new DataPlatformEntity());
registry.register(new DataProductEntity());
registry.register(new DataPlatformInstanceEntity());
registry.register(new ERModelRelationshipEntity())
registry.register(new ERModelRelationshipEntity());
registry.register(new RestrictedEntity());
registry.register(new BusinessAttributeEntity());
registry.register(new SchemaFieldPropertiesEntity());
return registry;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ export default function CreateBusinessAttributeModal({ visible, onClose, onCreat
>
<Typography.Paragraph>
By default, a random UUID will be generated to uniquely identify this entity. If
you&apos;d like to provide a custom id, you may provide it here. Note that it should be
unique across the entire Business Attributes. Be careful, you cannot easily change the id after
creation.
you&apos;d like to provide a custom id, you may provide it here. Note that it should
be unique across the entire Business Attributes. Be careful, you cannot easily
change the id after creation.
</Typography.Paragraph>
<Form.Item
name="id"
Expand Down
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/embed/lookup/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export const EMBED_LOOKUP_NOT_FOUND_REASON = {
} as const;

export type EmbedLookupNotFoundReason =
typeof EMBED_LOOKUP_NOT_FOUND_REASON[keyof typeof EMBED_LOOKUP_NOT_FOUND_REASON];
(typeof EMBED_LOOKUP_NOT_FOUND_REASON)[keyof typeof EMBED_LOOKUP_NOT_FOUND_REASON];
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {MockedProvider} from '@apollo/client/testing';
import {render} from '@testing-library/react';
import { MockedProvider } from '@apollo/client/testing';
import { render } from '@testing-library/react';
import React from 'react';
import {mocks} from '../../../../../Mocks';
import { mocks } from '../../../../../Mocks';
import TestPageContainer from '../../../../../utils/test-utils/TestPageContainer';
import {Preview} from '../Preview';
import {PreviewType} from "../../../Entity";
import { Preview } from '../Preview';
import { PreviewType } from '../../../Entity';

describe('Preview', () => {
it('renders', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function CreateDataProductModal({ domain, onCreateDataProduct, on
onClose();
}
})
.catch(( error ) => {
.catch((error) => {
onClose();
message.destroy();
message.error({ content: `Failed to create Data Product: ${error.message}.` });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from "react";
import { Collapse, Form, Input, Typography } from "antd";
import styled from "styled-components";
import React from 'react';
import { Collapse, Form, Input, Typography } from 'antd';
import styled from 'styled-components';
import { validateCustomUrnId } from '../../../shared/textUtil';
import { DataProductBuilderFormProps } from "./types";

import { DataProductBuilderFormProps } from './types';

const FormItem = styled(Form.Item)`
.ant-form-item-label {
Expand All @@ -23,8 +22,7 @@ const AdvancedLabel = styled(Typography.Text)`
color: #373d44;
`;

export function DataProductAdvancedOption({builderState, updateBuilderState }: DataProductBuilderFormProps){

export function DataProductAdvancedOption({ builderState, updateBuilderState }: DataProductBuilderFormProps) {
function updateDataProductId(id: string) {
updateBuilderState({
...builderState,
Expand Down Expand Up @@ -54,15 +52,15 @@ export function DataProductAdvancedOption({builderState, updateBuilderState }: D
}),
]}
>
<Input
data-testid="data-product-id"
placeholder="engineering"
<Input
data-testid="data-product-id"
placeholder="engineering"
value={builderState.id}
onChange={(e) => updateDataProductId(e.target.value)}
/>
</FormItemNoMargin>
</FormItemWithMargin>
</Collapse.Panel>
</Collapse>
)
}
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function DataProductBuilderForm({ builderState, updateBuilderStat
<Form.Item label={<Typography.Text strong>Description</Typography.Text>}>
<StyledEditor doNotFocus content={builderState.description} onChange={updateDescription} />
</Form.Item>
<DataProductAdvancedOption builderState={builderState} updateBuilderState={updateBuilderState}/>
<DataProductAdvancedOption builderState={builderState} updateBuilderState={updateBuilderState} />
</Form>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export type DataProductBuilderState = {
export type DataProductBuilderFormProps = {
builderState: DataProductBuilderState;
updateBuilderState: (newState: DataProductBuilderState) => void;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { GenericEntityProperties } from '../shared/types';
import { ERModelRelationshipPreviewCard } from './preview/ERModelRelationshipPreviewCard';
import ermodelrelationshipIcon from '../../../images/ermodelrelationshipIcon.svg';
import { ERModelRelationshipTab } from '../shared/tabs/ERModelRelationship/ERModelRelationshipTab';
import { useGetErModelRelationshipQuery, useUpdateErModelRelationshipMutation } from '../../../graphql/ermodelrelationship.generated';
import {
useGetErModelRelationshipQuery,
useUpdateErModelRelationshipMutation,
} from '../../../graphql/ermodelrelationship.generated';
import { DocumentationTab } from '../shared/tabs/Documentation/DocumentationTab';
import { PropertiesTab } from '../shared/tabs/Properties/PropertiesTab';
import { SidebarAboutSection } from '../shared/containers/profile/sidebar/AboutSection/SidebarAboutSection';
Expand Down Expand Up @@ -108,7 +111,9 @@ export class ERModelRelationshipEntity implements Entity<ErModelRelationship> {
<ERModelRelationshipPreviewCard
urn={data.urn}
name={
<span className="ermodelrelationName">{data.properties?.name || data.editableProperties?.name || ''}</span>
<span className="ermodelrelationName">
{data.properties?.name || data.editableProperties?.name || ''}
</span>
}
description={data?.editableProperties?.description || ''}
owners={data.ownership?.owners}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../../../node_modules/antd/dist/antd.less";
@import '../../../../../node_modules/antd/dist/antd.less';

.joinName {
width: 385px;
Expand All @@ -9,4 +9,4 @@
line-height: 24px;
align-items: center;
color: #262626;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export const ERModelRelationshipPreviewCard = ({
name={name || ''}
urn={urn}
description={description || ''}
logoComponent={<img src={ermodelrelationshipIcon} alt="ERModelRelationship" style={{ fontSize: '20px' }} />}
logoComponent={
<img src={ermodelrelationshipIcon} alt="ERModelRelationship" style={{ fontSize: '20px' }} />
}
tags={globalTags || undefined}
glossaryTerms={glossaryTerms || undefined}
owners={owners}
Expand Down
Loading
Loading