Commit a216d7e1 authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Refactored popup to display compliance

parent d0ff2bccd4a7
......@@ -29,9 +29,7 @@ export interface CurrentTabConfigProps {
onClickSeeViews: () => void;
onClickSeeDataSources: () => void;
onClickSeeResources: () => void;
onClickGotoOptions: () => void;
onClickTurnOff: () => void;
onClickDisplayRaw: () => void;
onClickSeeCompliance: () => void;
onTabCommandAutomatic: (event: React.FormEvent<HTMLInputElement>) => void;
onTabCommandClearTopic: () => void;
onTabCommandSelectView: (event: React.FormEvent<HTMLSelectElement>) => void;
......@@ -92,36 +90,16 @@ export class CurrentTabConfig extends React.Component<
<div className="col-2">
<a
className="btn btn-outline-light"
onClick={this.props.onClickDisplayRaw}
title="Display the raw source for this document"
onClick={this.props.onClickSeeCompliance}
title="Display the linked data compliance"
>
<span style={{ fontSize: "20pt", cursor: "pointer" }}>
<img width="24px" src="../icons/raw.svg" />
</span>
</a>
</div>
<div className="col-2">
<a
className="btn btn-outline-light"
onClick={this.props.onClickGotoOptions}
title="Browser's options"
>
<span style={{ fontSize: "20pt", cursor: "pointer" }}>
<img width="24px" src="../icons/settings.svg" />
</span>
</a>
</div>
<div className="col-2">
<a
className="btn btn-outline-light"
onClick={this.props.onClickTurnOff}
title="Turn off on this tab"
>
<span style={{ fontSize: "20pt", cursor: "pointer" }}>
<img width="24px" src="../icons/off.svg" />
<img width="24px" src="../icons/compliance.svg" />
</span>
</a>
</div>
<div className="col-2" />
<div className="col-2" />
</div>
<div className="row">
<div className="col-12">
......
......@@ -26,6 +26,8 @@ export interface CurrentTabMenuProps {
data: ResourceData;
registry: definition.ViewRegistry;
onSelectView: (viewId: string) => void;
onClickTurnOffTab: () => void;
onClickDisplaySources: () => void;
onClickGotoCurrentTab: () => void;
onClickGotoOptions: () => void;
onClickToggleSidebar: () => void;
......@@ -67,6 +69,28 @@ export class CurrentTabMenu extends React.Component<CurrentTabMenuProps, {}> {
}
)}
<hr />
<div className="row">
<div className="col-12">
<a
className="btn btn-outline-light"
onClick={this.props.onClickDisplaySources}
title={"Display the sources for this tab"}
>
Display the source
</a>
</div>
</div>
<div className="row">
<div className="col-12">
<a
className="btn btn-outline-light"
onClick={this.props.onClickTurnOffTab}
title={"Current tab options"}
>
Turn off on this tab
</a>
</div>
</div>
<div className="row">
<div className="col-12">
<a
......@@ -74,7 +98,7 @@ export class CurrentTabMenu extends React.Component<CurrentTabMenuProps, {}> {
onClick={this.props.onClickGotoCurrentTab}
title={"Current tab options"}
>
Current tab ...
More options for this tab ...
</a>
</div>
</div>
......
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 490.667 490.667" style="enable-background:new 0 0 490.667 490.667;" xml:space="preserve">
<g>
<g>
<path d="M416,0H74.667C33.493,0,0,33.493,0,74.667v234.667C0,350.507,33.493,384,74.667,384h230.251l103.531,103.552
c2.048,2.027,4.779,3.115,7.552,3.115c1.365,0,2.752-0.277,4.075-0.811c3.989-1.643,6.592-5.547,6.592-9.856v-96.747
c36.139-5.205,64-36.373,64-73.92V74.667C490.667,33.493,457.173,0,416,0z M469.333,309.333c0,29.419-23.936,53.333-53.333,53.333
c-5.888,0-10.667,4.779-10.667,10.667v80.917l-88.448-88.469c-2.005-1.984-4.715-3.115-7.552-3.115H74.667
c-29.397,0-53.333-23.915-53.333-53.333V74.667c0-29.419,23.936-53.333,53.333-53.333H416c29.397,0,53.333,23.915,53.333,53.333
V309.333z"/>
</g>
</g>
<g>
<g>
<path d="M245.333,256c-17.643,0-32,14.357-32,32c0,17.643,14.357,32,32,32c17.643,0,32-14.357,32-32
C277.333,270.357,262.976,256,245.333,256z M245.333,298.667c-5.888,0-10.667-4.8-10.667-10.667
c0-5.867,4.779-10.667,10.667-10.667S256,282.133,256,288C256,293.867,251.221,298.667,245.333,298.667z"/>
</g>
</g>
<g>
<g>
<path d="M279.424,74.197C273.387,67.712,264.853,64,256,64h-21.333c-8.853,0-17.365,3.712-23.403,10.197
c-6.037,6.464-9.131,15.232-8.512,24.235l9.024,105.109c1.237,17.451,15.915,31.125,33.557,31.125
c17.493,0,32.171-13.675,33.387-30.955l9.195-105.429C288.555,89.451,285.461,80.683,279.424,74.197z M266.667,96.597
l-9.216,105.451c-0.448,6.336-5.781,11.285-12.288,11.285c-6.357,0-11.669-4.949-12.139-11.456l-9.003-105.109
c-0.213-3.008,0.789-5.867,2.837-8.043c2.048-2.176,4.821-3.392,7.808-3.392H256c2.987,0,5.76,1.216,7.808,3.392
C265.856,90.901,266.859,93.76,266.667,96.597z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
......@@ -36,6 +36,7 @@ import { CurrentTabDataSources } from "../common/config/CurrentTabDataSources";
import { CurrentTabResources } from "../common/config/CurrentTabRessources";
import { CurrentTabConfig } from "../common/config/CurrentTabConfig";
import { CurrentTabMenu } from "../common/config/CurrentTabMenu";
import { CurrentTabCompliance } from "../common/config/CurrentTabCompliance";
/**
* Gets the identifier of the currently active tab
......@@ -165,6 +166,8 @@ class Popup extends React.Component<{}, State> {
<CurrentTabMenu
data={this.state.data}
registry={this.state.registry}
onClickDisplaySources={this.onDisplayRaw}
onClickTurnOffTab={this.onTunOff}
onClickGotoCurrentTab={() => {
self.state.pane = "tab";
self.setState(self.state);
......@@ -195,9 +198,10 @@ class Popup extends React.Component<{}, State> {
self.state.pane = "resources";
self.setState(self.state);
}}
onClickGotoOptions={this.onOpenOptions}
onClickTurnOff={this.onTunOff}
onClickDisplayRaw={this.onDisplayRaw}
onClickSeeCompliance={() => {
self.state.pane = "compliance";
self.setState(self.state);
}}
onTabCommandAutomatic={this.onTabCommandAutomatic}
onTabCommandSelectView={this.onTabCommandSelectView}
onTabCommandSelectLanguage={this.onTabCommandSelectLanguage}
......@@ -238,6 +242,17 @@ class Popup extends React.Component<{}, State> {
}}
/>
);
} else if (this.state.pane == "compliance") {
return (
<CurrentTabCompliance
data={this.state.data}
displayBack={true}
onClickBack={() => {
self.state.pane = "tab";
self.setState(self.state);
}}
/>
);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment