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

feat : Link component migration from v8 to v9 #7355

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b9a82d9
Link component migration from v8 to v9
v-prachin Jun 13, 2024
195ae4d
fixed test cases and ui issues
v-rakeshsh Jun 14, 2024
e139348
fixed test cases and ui issues
v-rakeshsh Jun 14, 2024
5a2a674
fixed test cases and ui issues
v-rakeshsh Jun 14, 2024
f2b50db
fixed test cases and ui issues
v-rakeshsh Jun 14, 2024
2ae5c8d
fixed test case issues
v-rakeshsh Jun 17, 2024
a3c3357
fixed test case issues
v-rakeshsh Jun 18, 2024
6467ee3
fixed test case issues
v-rakeshsh Jun 18, 2024
bee7aa6
fixed test case issues
v-rakeshsh Jun 18, 2024
8dea8b1
Fix for failing e2e test cases added a new function
v-prachin Jun 20, 2024
ad3d1d1
yarn format fix
v-prachin Jun 20, 2024
a5a806a
Changes for e2e test failures
v-prachin Jun 20, 2024
aeb8896
Added constant V9_CLASS_NAME_REPLACEMENT
v-prachin Jun 20, 2024
c7cbefe
merge main branch
v-rakeshsh Jun 21, 2024
17e8fb3
merge main branch
v-rakeshsh Jun 21, 2024
c26d138
merge main branch
v-rakeshsh Jun 21, 2024
830c5dd
Updated css files
v-singhanjal Jun 27, 2024
9f08004
Merge branch 'link-component-migration-to--v9' of https://github.com/…
v-singhanjal Jun 27, 2024
90d2833
Highcontrast,NavV8,Launchpadboldletters-style fixes
JeevaniChinthala Jul 10, 2024
074310b
format,testcase -fix
JeevaniChinthala Jul 12, 2024
22cf78a
lint issue - fixes
JeevaniChinthala Jul 15, 2024
e249f8e
Changes for failing e2e test cases
v-prachin Jul 17, 2024
bf8f248
Icon kept in v8 only will be migrated with next feature
v-prachin Jul 18, 2024
09f6c0a
nav-link-button.test.tsx.snap change reverted
v-prachin Jul 19, 2024
ddeda5c
adhoc panel launchpad issue-fix
JeevaniChinthala Jul 24, 2024
1f0cf72
e2e-report-tests update
JeevaniChinthala Jul 24, 2024
961e8b7
style fixing
v-sharmachir Jul 29, 2024
9613326
Reverted comments
JeevaniChinthala Jul 29, 2024
87dfd5c
Merge branch 'link-component-migration-to--v9' of https://github.com/…
JeevaniChinthala Jul 29, 2024
b733708
fixing test cases
v-sharmachir Jul 29, 2024
82501b2
Merge branch 'link-component-migration-to--v9' of https://github.com/…
v-sharmachir Jul 29, 2024
69463fd
changed :focus to :focus-visible to avoid unnecessary mouse focus
v-sharmachir Jul 29, 2024
ca20152
fixed test cases
v-sharmachir Jul 29, 2024
730459a
change styling similar to prod
v-sharmachir Jul 30, 2024
d23a4f9
reverting as: 'change'
v-sharmachir Jul 30, 2024
542ee7f
link prop change as per fluentui documentation
v-sharmachir Jul 31, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
},
"dependencies": {
"@fluentui/react": "^8.118.1",
"@fluentui/react-components": "^9.53.0",
"@fluentui/react-components": "^9.54.1",
"@microsoft/applicationinsights-web": "^2.8.15",
"@testing-library/user-event": "^14.5.2",
"ajv": "^8.12.0",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
@import '../../common/styles/common.scss';

.remove-button {
margin-left: 12px;
font-size: 16px;
margin-left: 12px !important;
font-size: 16px !important;
line-height: 24px;
color: $negative-outcome;
color: $negative-outcome !important;

&:hover,
&:focus {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Icon, Link } from '@fluentui/react';
import { Icon } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { AssessmentsProvider } from 'assessments/types/assessments-provider';
import { CapturedInstanceActionType } from 'common/types/captured-instance-action-type';
import { FailureInstanceData } from 'common/types/failure-instance-data';
Expand Down
1 change: 1 addition & 0 deletions src/DetailsView/components/base-left-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
:global {
.is-selected {
background-color: $nav-link-selected;
font-weight: 600;

a,
button {
Expand Down
10 changes: 2 additions & 8 deletions src/DetailsView/components/failure-instance-panel-control.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {
ActionButton,
Icon,
ILabelStyles,
ITextFieldStyles,
Link,
TextField,
} from '@fluentui/react';
import { ActionButton, Icon, ILabelStyles, ITextFieldStyles, TextField } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { AssessmentsProvider } from 'assessments/types/assessments-provider';
import { FlaggedComponent } from 'common/components/flagged-component';
import { FeatureFlags } from 'common/feature-flags';
Expand Down
1 change: 1 addition & 0 deletions src/DetailsView/components/failure-instance-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
font-size: 16px !important;
line-height: 24px !important;
color: $neutral-100 !important;
padding-right: 3px;

&:hover,
&:focus {
Expand Down
2 changes: 1 addition & 1 deletion src/DetailsView/components/iframe-warning.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Link } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { NewTabLink } from 'common/components/new-tab-link';
import { NamedFC } from 'common/react/named-fc';
import { SupportedMouseEvent } from 'common/telemetry-data-factory';
Expand Down
12 changes: 12 additions & 0 deletions src/DetailsView/components/left-nav/details-view-left-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

button.ms-Nav-link {
width: 100%;

&:hover {
background-color: $nav-link-hover;
}
}

.overview-label {
Expand Down Expand Up @@ -73,6 +77,10 @@
color: $always-black;
}

a {
font-weight: 600;
}

a,
button {
background-color: $communication-tint-40;
Expand All @@ -93,6 +101,10 @@
$communication-primary;
}
}

&:not(.is-selected):hover {
background-color: $nav-link-hover;
}
}

.ms-Pivot-text {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
margin-block-end: 1em;
margin-inline-start: 0;
margin-inline-end: 0;
font-size: 17px;
}

.context-links > * {
Expand Down
2 changes: 2 additions & 0 deletions src/DetailsView/components/requirement-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

h3 {
@include h3;

font-size: 17px;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/DetailsView/components/target-change-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { Link, TooltipHost } from '@fluentui/react';
import { TooltipHost } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { css } from '@fluentui/utilities';
import { NamedFC } from 'common/react/named-fc';
import { PersistedTabInfo } from 'common/types/store-data/assessment-result-data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// because we want these icons to line up with the Pass/Fail ChoiceGroup in the Requirement
// table earlier on the same page.
margin-left: 4px;
margin-right: 10px;
margin-right: 10px !important;
padding-left: 3px;
padding-right: 3px;
font-size: 16px !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
DetailsList,
IColumn,
Icon,
Link,
} from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { NamedFC } from 'common/react/named-fc';
import { AssessmentInstanceDetailsColumn } from 'DetailsView/components/assessment-instance-details-column';
import { tabStopsRequirementsTableActionColumnWidthPx } from 'DetailsView/components/tab-stops/tab-stops-requirements-table';
Expand Down
6 changes: 6 additions & 0 deletions src/common/components/new-tab-link-with-tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@
&:active {
text-decoration: none !important;
}

&:focus-visible {
box-shadow: $neutral-60 0 0 0 1px inset !important;
outline: $neutral-60 auto 1px !important;
text-decoration: none !important;
}
}
13 changes: 9 additions & 4 deletions src/common/components/new-tab-link-with-tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { ICalloutProps, ILinkProps, ITooltipHostStyles, TooltipHost } from '@fluentui/react';
import { ICalloutProps, ITooltipHostStyles, TooltipHost } from '@fluentui/react';
import { LinkProps } from '@fluentui/react-components';
import { NewTabLink } from 'common/components/new-tab-link';
import * as React from 'react';
import { NamedFC } from '../react/named-fc';
import styles from './new-tab-link-with-tooltip.scss';

export type NewTabLinkWithTooltipProps = ILinkProps & { tooltipContent: string | undefined };
export type NewTabLinkWithTooltipProps = LinkProps & {
as?: 'a';
tooltipContent: string | undefined;
className?: string;
};

export const NewTabLinkWithTooltip = NamedFC<NewTabLinkWithTooltipProps>(
'NewTabLinkWithTooltip',
props => {
const { tooltipContent, ...linkProps } = props;
const { tooltipContent, className, ...linkProps } = props;
const hostStyles: Partial<ITooltipHostStyles> = {
root: styles.insightsTooltipHost,
};
Expand All @@ -23,7 +28,7 @@ export const NewTabLinkWithTooltip = NamedFC<NewTabLinkWithTooltipProps>(
};
return (
<TooltipHost content={tooltipContent} styles={hostStyles} calloutProps={calloutProps}>
<NewTabLink className={styles.insightsLink} {...linkProps} />
<NewTabLink className={className ?? styles.insightsLink} {...linkProps} />
</TooltipHost>
);
},
Expand Down
9 changes: 4 additions & 5 deletions src/common/components/new-tab-link.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { ILinkProps, Link } from '@fluentui/react';
import { css } from '@fluentui/utilities';
import { Link, LinkProps, mergeClasses } from '@fluentui/react-components';
import * as React from 'react';

import { NamedFC } from '../react/named-fc';

export const NewTabLink = NamedFC<ILinkProps>('NewTabLink', ({ className, ...props }) => {
const classNames = ['insights-link', className];
export type NewTabLinkProps = LinkProps & { as?: 'a' };

return <Link className={css(...classNames)} {...props} target="_blank" />;
export const NewTabLink = NamedFC<NewTabLinkProps>('NewTabLink', ({ className, ...props }) => {
return <Link className={mergeClasses('insights-link', className)} target="_blank" {...props} />;
});
38 changes: 38 additions & 0 deletions src/common/styles/root-level-only/global-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ button::after {
color: $link-hover !important;
text-decoration: underline;
}

&:focus-visible {
box-shadow: $neutral-60 0 0 0 1px inset !important;
outline: $neutral-60 auto 1px !important;
text-decoration: none !important;
}
}

.high-contrast-theme {
Expand Down Expand Up @@ -66,6 +72,38 @@ button::after {
}
}

.adhoc-insights-link {
color: $link !important;
font-weight: 600 !important;
font-size: 12px !important;

&:hover {
color: $link-hover !important;
}

&:focus-visible {
box-shadow: $neutral-60 0 0 0 1px inset !important;
outline: $neutral-60 auto 1px !important;
text-decoration: none !important;
}
}

.adhoc-insights-guidance-link {
color: $link !important;
font-weight: 600 !important;
font-size: 12px !important;

&:hover {
text-decoration: none !important;
}

&:focus-visible {
box-shadow: $neutral-60 0 0 0 1px inset !important;
outline: $neutral-60 auto 1px !important;
text-decoration: none !important;
}
}

// Add hover state that's not yet in FluentUI to menu items
// GH Issue: https://github.com/microsoft/fluentui/issues/25330
.ms-ContextualMenu button:hover {
Expand Down
3 changes: 2 additions & 1 deletion src/popup/Styles/popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ html {
margin-bottom: 5px;
padding: 0;
height: 20px;
font-weight: 600 !important;

.ms-Link {
font-weight: 600;
font-weight: 600 !important;
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/popup/components/ad-hoc-tools-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
color: $link !important;
font-size: 11px;
@include fluent-forced-color-adjust-override;

&:focus-visible {
box-shadow: $neutral-60 0 0 0 1px inset !important;
outline: $neutral-60 auto 1px !important;
text-decoration: none !important;
}
}

.back-to-launch-pad-icon {
Expand Down
3 changes: 2 additions & 1 deletion src/popup/components/ad-hoc-tools-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { css, Icon, Link } from '@fluentui/react';
import { css, Icon } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { NamedFC } from 'common/react/named-fc';
import { flatMap } from 'lodash';
import * as React from 'react';
Expand Down
1 change: 1 addition & 0 deletions src/popup/components/diagnostic-view-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
grid-template-columns: auto auto;
grid-template-rows: minmax(25px, min-content) minmax(25px, min-content);
align-items: center;
font-weight: 600;

.title {
font-weight: 600;
Expand Down
6 changes: 4 additions & 2 deletions src/popup/components/diagnostic-view-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { IToggle, Link, Spinner, SpinnerSize } from '@fluentui/react';
import { IToggle, Spinner, SpinnerSize } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { VisualizationToggle } from 'common/components/visualization-toggle';
import { VisualizationConfiguration } from 'common/configs/visualization-configuration';
import { VisualizationConfigurationFactory } from 'common/configs/visualization-configuration-factory';
Expand Down Expand Up @@ -173,6 +174,7 @@ export class DiagnosticViewToggle extends React.Component<
if (this.configuration.guidance) {
return (
<ContentLink
className="adhoc-insights-guidance-link"
deps={this.props.deps}
reference={this.configuration.guidance}
linkText={linkText}
Expand All @@ -182,7 +184,7 @@ export class DiagnosticViewToggle extends React.Component<

return (
<Link
className="insights-link"
className="adhoc-insights-link"
href="#"
onClick={ev =>
this.props.actionMessageCreator.openDetailsView(
Expand Down
4 changes: 3 additions & 1 deletion src/popup/components/launch-pad-item-row.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { Icon, Link } from '@fluentui/react';
import { Icon } from '@fluentui/react';
import { Link } from '@fluentui/react-components';
import { kebabCase, uniqueId } from 'lodash';
import * as React from 'react';

Expand Down Expand Up @@ -29,6 +30,7 @@ export class LaunchPadItemRow extends React.Component<LaunchPadItemRowProps> {
id={kebabCase(this.props.title)}
onClick={this.props.onClickTitle}
aria-describedby={this.descriptionId}
style={{ fontWeight: 600 }}
>
{this.props.title}
</Link>
Expand Down
1 change: 1 addition & 0 deletions src/reports/components/assessment-report-summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
font-family: $font-family;
margin-top: 16px;
margin-bottom: 21px;
font-size: 17px;
}
}
5 changes: 3 additions & 2 deletions src/reports/components/new-tab-link-confirmation-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { getId, ILinkProps } from '@fluentui/react';
import { getId } from '@fluentui/react';
import { LinkProps } from '@fluentui/react-components';
import { NewTabLink } from 'common/components/new-tab-link';
import { NamedFC } from 'common/react/named-fc';
import * as React from 'react';

export const NewTabLinkWithConfirmationDialog = NamedFC<ILinkProps>(
export const NewTabLinkWithConfirmationDialog = NamedFC<LinkProps & { as?: 'a' }>(
'NewTabLinkWithConfirmationDialog',
props => {
const id = getId('new-tab-link-with-confirmation-dialog__'); // generates something like new-tab-link-with-confirmation-dialog__123
Expand Down
Loading
Loading