mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 18:32:00 +00:00
* minro code edits * Added support for acknowledging code of conduct - Added CodeOfConduct component that shows links and a checkbox that must be acknwledged before seeing the public galley - Added verbose message for notebook publish error (when another notebook with the same name exists in the gallery) - Added a feature flag for enabling code of conduct acknowledgement * Added Info Component * minor edit * fixed failign tests * publish tab displayed only when code of conduct accepted * added code of conduct fetch during publish * fixed bug * added test and addressed PR comments * changed line endings * added comment * addressed PR comments
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
import * as React from "react";
|
|
import { Icon, Label, Stack, HoverCard, HoverCardType, Link } from "office-ui-fabric-react";
|
|
import { CodeOfConductEndpoints } from "../../../../Common/Constants";
|
|
import "./InfoComponent.less";
|
|
|
|
export class InfoComponent extends React.Component {
|
|
private getInfoPanel = (iconName: string, labelText: string, url: string): JSX.Element => {
|
|
return (
|
|
<Link href={url} target="_blank">
|
|
<div className="infoPanel">
|
|
<Icon iconName={iconName} styles={{ root: { verticalAlign: "middle" } }} />
|
|
<Label className="infoLabel">{labelText}</Label>
|
|
</div>
|
|
</Link>
|
|
);
|
|
};
|
|
|
|
private onHover = (): JSX.Element => {
|
|
return (
|
|
<Stack tokens={{ childrenGap: 5, padding: 5 }}>
|
|
<Stack.Item>{this.getInfoPanel("Script", "Code of Conduct", CodeOfConductEndpoints.codeOfConduct)}</Stack.Item>
|
|
<Stack.Item>
|
|
{this.getInfoPanel("RedEye", "Privacy Statement", CodeOfConductEndpoints.privacyStatement)}
|
|
</Stack.Item>
|
|
<Stack.Item>
|
|
{this.getInfoPanel("KnowledgeArticle", "Microsoft Terms of Use", CodeOfConductEndpoints.termsOfUse)}
|
|
</Stack.Item>
|
|
</Stack>
|
|
);
|
|
};
|
|
|
|
public render(): JSX.Element {
|
|
return (
|
|
<HoverCard plainCardProps={{ onRenderPlainCard: this.onHover }} instantOpenOnClick type={HoverCardType.plain}>
|
|
<div className="infoPanelMain">
|
|
<Icon className="infoIconMain" iconName="Help" styles={{ root: { verticalAlign: "middle" } }} />
|
|
<Label className="infoLabelMain">Help</Label>
|
|
</div>
|
|
</HoverCard>
|
|
);
|
|
}
|
|
}
|