Skip to content

Commit

Permalink
[DC][Sidecars] Add learn more link to sidecar migration banner (#7892) (
Browse files Browse the repository at this point in the history
#7894)

Co-authored-by: Yoona Oh <[email protected]>
  • Loading branch information
yoonaoh and johmsft authored Oct 31, 2024
1 parent 23ef040 commit 23178d4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,10 @@ export const bannerLinkStyle = (theme: ThemeExtended) =>
},
},
});

// NOTE(yoonaoh): The color of the link is set to the default Fluent UI link color.
// Using the statusBar link color from @fluentui/azure-themes instead
export const customBannerLinkStyle = (theme: ThemeExtended) =>
style({
color: theme?.semanticColors?.link?.toLowerCase() == '#0078d4' ? '#005A9E' : '#6CB8F6',
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import DeploymentCenterGitHubConfiguredView from '../github-provider/DeploymentC
import DeploymentCenterContainerSettingsReadOnlyView from './DeploymentCenterContainerSettingsReadOnlyView';
import { SiteStateContext } from '../../../../SiteState';
import DeploymentCenterVstsBuildProvider from '../devops-provider/DeploymentCenterVstsBuildProvider';
import { MessageBar, MessageBarType, PrimaryButton, ProgressIndicator, Text } from '@fluentui/react';
import { Link, MessageBar, MessageBarType, PrimaryButton, ProgressIndicator } from '@fluentui/react';
import { AppOs, SiteContainer } from '../../../../models/site/site';
import DeploymentCenterData from '../DeploymentCenter.data';
import { PortalContext } from '../../../../PortalContext';
Expand All @@ -35,7 +35,10 @@ import { AcrDependency } from '../../../../utils/dependency/Dependency';
import DeploymentCenterVstsBuildConfiguredView from '../devops-provider/DeploymentCenterVstsBuildConfiguredView';
import { ArmObj } from '../../../../models/arm-obj';
import { style } from 'typestyle';
import { migrationBannerStyle } from '../DeploymentCenter.styles';
import { migrationBannerStyle, titleWithPaddingStyle } from '../DeploymentCenter.styles';
import { DeploymentCenterLinks } from '../../../../utils/FwLinks';
import { ThemeContext } from '../../../../ThemeContext';
import { customBannerLinkStyle } from '../../../../components/CustomBanner/CustomBanner.styles';

const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<DeploymentCenterContainerFormData>> = props => {
const { formProps, isDataRefreshing } = props;
Expand All @@ -48,6 +51,8 @@ const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<Dep
const [showVstsReadOnlyView, setShowVstsReadOnlyView] = useState(false);
const [showSourceSelectionOption, setShowSourceSelectionOption] = useState(false);
const [enableSidecarMigration, setEnableSidecarMigration] = useState(false);
const theme = useContext(ThemeContext);
const linkStyle = customBannerLinkStyle(theme);

// NOTE(michinoy): The serverUrl, image, username, and password are retrieved from one of three sources:
// acr, dockerHub, or privateRegistry.
Expand Down Expand Up @@ -397,14 +402,23 @@ const DeploymentCenterContainerSettings: React.FC<DeploymentCenterFieldProps<Dep
return (
<>
{showMigrationBanner && (
<>
<div className={titleWithPaddingStyle}>
<MessageBar messageBarType={MessageBarType.warning}>
<div className={migrationBannerStyle}>
<Text>{t('deploymentCenterUpdateToSidecarContainers')}</Text>
<PrimaryButton text={t('startUpdate')} onClick={openUpdateToSidecarPane} className={style({ maxWidth: '130px' })} />
<span>
<span tabIndex={0}>{t('deploymentCenterUpdateToSidecarContainers')}</span>
<Link className={linkStyle} href={DeploymentCenterLinks.sidecarsLink} target="_blank" aria-label={t('learnMore')}>
{t('learnMore')}
</Link>
</span>
<PrimaryButton
text={t('startUpdate')}
onClick={openUpdateToSidecarPane}
className={style({ maxWidth: '125px', maxHeight: '40px' })}
/>
</div>
</MessageBar>
</>
</div>
)}

{showSourceSelectionOption && <DeploymentCenterContainerSource formProps={formProps} />}
Expand Down
1 change: 1 addition & 0 deletions client-react/src/utils/FwLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ export const DeploymentCenterLinks = {
roleAssignmentPrereqs: 'https://go.microsoft.com/fwlink/?linkid=2249489',
managedIdentityCreationPrereqs: 'https://go.microsoft.com/fwlink/?linkid=2253463',
oidcPermissionPrereqs: 'https://go.microsoft.com/fwlink/?linkid=2256502',
sidecarsLink: 'https://go.microsoft.com/fwlink/?linkid=2295005',
};

0 comments on commit 23178d4

Please sign in to comment.