Commit 52e06f7a authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Refactoring the popup UI

parent 5a1c63370dfa
......@@ -332,10 +332,12 @@ class LDBrowserImpl implements LDBrowser {
source.loaded = store.statements.length - before;
resolve(source.loaded);
} catch (err) {
source.loaded = -1;
reject(err);
}
})
.catch(reason => {
source.loaded = -1;
reject(reason);
});
}
......
......@@ -62,7 +62,7 @@ export class CurrentTabConfig extends React.Component<
title="See data/views matching"
>
<span style={{ fontSize: "20pt", cursor: "pointer" }}>
<img width="24px" src="../icons/views.svg" />
<img width="24px" src="../icons/view.svg" />
</span>
</a>
</div>
......@@ -73,7 +73,7 @@ export class CurrentTabConfig extends React.Component<
title="See data sources"
>
<span style={{ fontSize: "20pt", cursor: "pointer" }}>
<img width="24px" src="../icons/sources.svg" />
<img width="24px" src="../icons/datasource.svg" />
</span>
</a>
</div>
......@@ -84,7 +84,7 @@ export class CurrentTabConfig extends React.Component<
title="See the loaded supplementary resources"
>
<span style={{ fontSize: "20pt", cursor: "pointer" }}>
<img width="24px" src="../icons/resources.svg" />
<img width="24px" src="../icons/resource.svg" />
</span>
</a>
</div>
......
......@@ -34,6 +34,31 @@ export class CurrentTabDataSources extends React.Component<
super(props);
}
renderTriplesCount(count: number): React.ReactNode {
if (count == -1) {
return (
<span className="badge badge-danger" title="Failed to load this source">
error
</span>
);
}
if (count == 0) {
return (
<span className="badge badge-secondary" title="Not loaded">
0
</span>
);
}
return (
<span
className="badge badge-secondary"
title="Total loaded triples from this source"
>
{count}
</span>
);
}
render() {
let allSources = getSourcesFor(this.props.data);
let renderedSources = Object.keys(allSources).map(
......@@ -57,12 +82,7 @@ export class CurrentTabDataSources extends React.Component<
<div key={"source-" + index} className="row">
<div className="col-12">
<span>{"\u00A0\u00A0\u00A0\u00A0\u21B3"}</span>
<span
className="badge badge-secondary"
title="Total loaded triples from this source"
>
{source.loaded}
</span>
{this.renderTriplesCount(source.loaded)}
<span>{source.name}</span>
</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="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512.001 512.001" style="enable-background:new 0 0 512.001 512.001;" xml:space="preserve">
<g>
<g>
<path d="M405.967,187.467c-1.069-78.061-64.902-141.239-143.213-141.239c-34.835,0-68.396,12.672-94.498,35.682
c-23.296,20.535-39.232,47.977-45.543,78.106c-0.461-0.005-0.918-0.009-1.374-0.009C54.434,160.008,0,214.441,0,281.347
s54.434,121.339,121.34,121.339h44.534c6.029,0,10.919-4.888,10.919-10.919c0-6.031-4.89-10.919-10.919-10.919H121.34
c-54.866,0-99.502-44.636-99.502-99.501s44.636-99.501,99.502-99.501c2.923,0,6.013,0.157,9.448,0.48
c5.822,0.54,11.049-3.596,11.842-9.396c3.932-28.82,18.161-55.327,40.067-74.638c22.111-19.492,50.542-30.226,80.056-30.226
c66.935,0,121.389,54.455,121.389,121.389c0,2.41-0.449,8.642-0.449,8.642c-0.227,3.212,0.975,6.361,3.287,8.604
c2.309,2.243,5.488,3.349,8.697,3.03c2.904-0.293,5.834-0.44,8.708-0.44c47.297,0,85.778,38.48,85.778,85.778
c0,47.297-38.48,85.777-85.778,85.777h-48.902c-6.029,0-10.919,4.888-10.919,10.919s4.89,10.919,10.919,10.919h48.902
c59.339,0,107.616-48.275,107.616-107.615C512,236.261,464.58,188.317,405.967,187.467z"/>
</g>
</g>
<g>
<g>
<path d="M262.755,97.548c-45.658,0-84.742,34.121-90.914,79.367c-0.815,5.975,3.371,11.462,9.343,12.295
c6.368,0.888,11.548-3.869,12.295-9.343c4.702-34.479,34.484-60.48,69.276-60.48c6.031,0,10.919-4.888,10.919-10.919
C273.674,102.436,268.785,97.548,262.755,97.548z"/>
</g>
</g>
<g>
<g>
<path d="M313.279,410.283c-4.017-4.496-10.92-4.887-15.418-0.868l-26.265,23.463V298.547c0-6.031-4.89-10.919-10.919-10.919
c-6.031,0-10.919,4.888-10.919,10.919v134.33l-26.264-23.463c-4.496-4.018-11.401-3.627-15.417,0.868
c-4.018,4.498-3.63,11.399,0.868,15.418l39.717,35.483c3.425,3.061,7.719,4.59,12.014,4.59c4.294,0,8.589-1.53,12.013-4.589
l39.719-35.483C316.907,421.684,317.296,414.781,313.279,410.283z"/>
</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>
<svg height="640.1302pt" viewBox="-20 -20 640.1302 640.1302" width="640.1302pt" xmlns="http://www.w3.org/2000/svg"><path d="m399.578125 367.0625c1.632813-2.433594 3.09375-4.933594 4.53125-7.453125.53125-.929687 1.128906-1.828125 1.640625-2.769531 1.082031-2 2-4.089844 3-6.136719.742188-1.582031 1.519531-3.132813 2.191406-4.742187.667969-1.609376 1.121094-3 1.679688-4.558594.820312-2.242188 1.671875-4.472656 2.359375-6.773438.269531-.910156.457031-1.824218.699219-2.738281.808593-2.921875 1.582031-5.851563 2.164062-8.847656l.046875-.332031c.777344-4.1875 1.332031-8.410157 1.660156-12.652344h61.410157c5.195312 30.757812 33.097656 52.402344 64.179687 49.789062 31.078125-2.605468 54.980469-28.59375 54.980469-59.789062 0-31.191406-23.902344-57.175782-54.980469-59.789063-31.082031-2.609375-58.984375 19.035157-64.179687 49.789063h-61.410157c-.339843-4.234375-.910156-8.453125-1.699219-12.628906l-.046874-.328126c-.582032-3-1.355469-5.929687-2.164063-8.851562-.242187-.910156-.429687-1.828125-.699219-2.738281-.6875-2.300781-1.542968-4.519531-2.359375-6.761719-.558593-1.527344-1.0625-3.070312-1.683593-4.578125-.617188-1.511719-1.445313-3.152344-2.1875-4.71875-.953126-2.0625-1.878907-4.132813-3-6.152344-.511719-.941406-1.109376-1.839843-1.640626-2.769531-1.4375-2.519531-2.898437-5-4.53125-7.449219-.160156-.238281-.351562-.46875-.519531-.707031-2.308593-3.375-4.792969-6.625-7.4375-9.734375l128.292969-128.25c6.09375 3.675781 13.070312 5.632813 20.183594 5.667969 22.09375 0 40-17.90625 40-40 0-22.089844-17.90625-40-40-40-22.089844 0-40 17.910156-40 40 .039062 7.121094 1.996094 14.097656 5.675781 20.191406l-128.242187 128.242188c-3.265626-2.773438-6.671876-5.371094-10.210938-7.78125l-.191406-.140626c-2.578125-1.738281-5.238282-3.300781-7.917969-4.820312-.773437-.429688-1.5-.921875-2.28125-1.339844-2.1875-1.175781-4.429687-2.1875-6.671875-3.21875-1.398438-.648437-2.757812-1.34375-4.179688-1.9375-1.71875-.714844-3.46875-1.285156-5.21875-1.914062-2-.730469-4-1.5-6.089843-2.128906-1.191407-.363282-2.410157-.609376-3.605469-.929688-2.632812-.710938-5.273438-1.410156-8.003906-1.941406-.539063-.109375-1.089844-.148438-1.632813-.25-3.757812-.679688-7.578125-1.199219-11.449219-1.519532v-61.410156c30.757813-5.199218 52.402344-33.097656 49.789063-64.179687-2.605469-31.078125-28.597656-54.980469-59.789063-54.980469-31.191406 0-57.179687 23.902344-59.789062 54.980469-2.609375 31.082031 19.039062 58.980469 49.789062 64.179687v61.410156c-3.90625.320313-7.757812.839844-11.558593 1.53125-.503907.101563-1 .140626-1.507813.238282-2.753906.53125-5.429687 1.25-8.109375 2-1.152343.308594-2.320312.550781-3.464843.890625-2.117188.648437-4.167969 1.429687-6.238282 2.183593-1.699218.617188-3.398437 1.164063-5.066406 1.859376-1.480469.617187-2.890625 1.335937-4.332031 1.996093-2.191407 1-4.378907 2.003907-6.519531 3.148438-.839844.457031-1.632813 1.003906-2.453126 1.441406-2.628906 1.488281-5.226562 3.003906-7.757812 4.722656l-.390625.285157c-3.464844 2.371093-6.804687 4.921874-10 7.644531l-128.25-128.261719c3.675781-6.09375 5.632813-13.070312 5.667969-20.191406 0-22.089844-17.90625-40-40-40-22.089844 0-40 17.910156-40 40 0 22.09375 17.910156 40 40 40 7.121094-.035156 14.097656-1.992188 20.191406-5.667969l128.25 128.25c-2.644531 3.109375-5.132812 6.359375-7.441406 9.734375-.167969.238281-.355469.46875-.515625.707031-1.632813 2.429688-3.089844 4.929688-4.53125 7.449219-.535157.929688-1.128907 1.828125-1.640625 2.769531-1.082032 2.003907-1.996094 4.082031-3 6.136719-.730469 1.582031-1.523438 3.121094-2.191406 4.742188-.667969 1.621093-1.117188 3.003906-1.671876 4.550781-.828124 2.242187-1.667968 4.472656-2.367187 6.78125-.265625.910156-.457031 1.828125-.703125 2.738281-.804688 2.921875-1.578125 5.851562-2.15625 8.851562v.328126c-.796875 4.175781-1.363281 8.394531-1.710938 12.628906h-61.410156c-5.199218-30.753906-33.097656-52.398438-64.179687-49.789063-31.078125 2.613281-54.980469 28.597657-54.980469 59.789063 0 31.195312 23.902344 57.183594 54.980469 59.789062 31.082031 2.613282 58.980469-19.03125 64.179687-49.789062h61.410156c.34375 4.238281.910157 8.457031 1.699219 12.632812v.332032c.582031 2.996093 1.355469 5.925781 2.160157 8.847656.242187.910156.429687 1.832031.703124 2.738281.695313 2.308594 1.539063 4.539063 2.367188 6.792969.5625 1.507812 1.050781 2.996094 1.671875 4.539062.617187 1.539063 1.457031 3.167969 2.199219 4.746094 1.003906 2.003906 1.878906 4.121094 3 6.132812.511718.9375 1.105468 1.84375 1.640625 2.769532 1.441406 2.519531 2.898437 5 4.53125 7.449218.160156.242188.347656.46875.515625.710938 2.308594 3.367188 4.796875 6.621094 7.441406 9.730469l-128.25 128.253906c-6.09375-3.679687-13.070312-5.636719-20.191406-5.675781-22.089844 0-40 17.910156-40 40 0 22.09375 17.910156 40 40 40 22.09375 0 40-17.90625 40-40-.035156-7.113282-1.992188-14.089844-5.667969-20.183594l128.242187-128.242188c3.195313 2.703126 6.539063 5.238282 10 7.59375l.457032.34375c2.492187 1.671876 5 3.167969 7.632812 4.640626.871094.5 1.707032 1.046874 2.589844 1.53125 2.070312 1.109374 4.195312 2.0625 6.316406 3 1.511719.710937 3.003906 1.46875 4.550782 2.109374 1.554687.636719 3.160156 1.171876 4.75 1.742188 2.179687.796875 4.351562 1.625 6.582031 2.296875.996093.289063 1.996093.492187 2.929687.757813 2.855469.78125 5.730469 1.535156 8.667969 2.109374l.503906.074219c4.113281.792969 8.269531 1.367188 12.445313 1.71875v61.410157c-30.753906 5.195312-52.398438 33.097656-49.789063 64.179687 2.613281 31.078125 28.597657 54.980469 59.789063 54.980469 31.195312 0 57.183594-23.902344 59.789062-54.980469 2.613282-31.082031-19.03125-58.984375-49.789062-64.179687v-61.410157c4.191406-.339843 8.355468-.898437 12.480468-1.679687l.503907-.066406c2.9375-.574219 5.808593-1.335938 8.667969-2.117188 1-.265625 2-.46875 2.929687-.757812 2.230469-.667969 4.402344-1.496094 6.578125-2.296876 1.59375-.570312 3.191406-1.089843 4.753906-1.742187 1.558594-.652344 2.996094-1.398437 4.550782-2.109375 2.117187-1 4.246093-1.929688 6.316406-3 .878906-.476562 1.710937-1 2.578125-1.527344 2.59375-1.472656 5.152343-3.003906 7.644531-4.652344l.429688-.308593c3.460937-2.363281 6.800781-4.910157 10-7.621094l128.242187 128.203125c-3.679687 6.09375-5.636719 13.070312-5.675781 20.183594 0 22.09375 17.910156 40 40 40 22.09375 0 40-17.90625 40-40 0-22.089844-17.90625-40-40-40-7.113282.039062-14.089844 1.996094-20.183594 5.675781l-128.253906-128.253906c2.644531-3.109375 5.132812-6.363281 7.441406-9.730469.164062-.242188.355469-.46875.515625-.6875zm140.480469-107.003906c22.09375 0 40 17.910156 40 40 0 22.09375-17.90625 40-40 40-22.089844 0-40-17.90625-40-40 0-22.089844 17.910156-40 40-40zm-480 80c-22.089844 0-40-17.90625-40-40 0-22.089844 17.910156-40 40-40 22.09375 0 40 17.910156 40 40 0 22.09375-17.90625 40-40 40zm338.121094-20.847656c-.480469 2.429687-1.117188 4.84375-1.769532 7.25-.21875.800781-.378906 1.621093-.621094 2.410156-.558593 1.871094-1.257812 3.6875-1.925781 5.527344-.484375 1.304687-.914062 2.632812-1.441406 3.914062-.53125 1.277344-1.179687 2.546875-1.773437 3.828125-.820313 1.761719-1.605469 3.527344-2.527344 5.242187-.390625.726563-.859375 1.425782-1.269532 2.148438-1.230468 2.15625-2.480468 4.3125-3.875 6.367188l-.226562.3125c-7.078125 10.375-16.027344 19.335937-26.386719 26.429687l-.472656.351563c-2 1.347656-4.117187 2.570312-6.226563 3.78125-.773437.4375-1.523437.9375-2.316406 1.355468-1.644531.890625-3.378906 1.660156-5.085937 2.460938-1.320313.621094-2.632813 1.289062-4 1.839844-1.371094.546874-2.511719.921874-3.769531 1.378906-1.878907.691406-3.757813 1.410156-5.671876 2.003906-.738281.21875-1.511718.378906-2.25.578125-2.460937.671875-4.921874 1.328125-7.410156 1.8125h-.21875c-12.363281 2.351563-25.058594 2.375-37.433594.058594l-.648437-.101563c-2.378906-.460937-4.726563-1.089844-7.078125-1.71875-.859375-.238281-1.742188-.410156-2.589844-.667968-1.800781-.542969-3.558594-1.222657-5.339844-1.863282-1.367187-.496094-2.761718-1-4.109374-1.507812-1.351563-.511719-2.410157-1.121094-3.621094-1.679688-1.832032-.847656-3.667969-1.667968-5.429688-2.621094-.667968-.363281-1.308594-.792968-2.003906-1.164062-2.214844-1.269531-4.4375-2.558594-6.546875-4l-.109375-.078125c-10.507812-7.121094-19.570312-16.164063-26.710938-26.65625l-.242187-.324219c-1.375-2.046875-2.625-4.199218-3.855469-6.347656-.417968-.734375-.894531-1.441406-1.292968-2.183594-.910157-1.6875-1.691407-3.457031-2.511719-5.207031-.585938-1.289063-1.25-2.550781-1.777344-3.851563-.53125-1.296874-.953125-2.601562-1.429687-3.898437-.667969-1.84375-1.382813-3.667969-1.9375-5.546875-.230469-.773438-.390626-1.582031-.609376-2.375-.660156-2.414062-1.304687-4.828125-1.785156-7.28125 0-.125 0-.257812 0-.378906-2.347656-12.402344-2.347656-25.136719 0-37.539063 0-.117187 0-.25 0-.378906.480469-2.449219 1.125-4.859375 1.785156-7.28125.21875-.789063.378907-1.597656.609376-2.367187.554687-1.882813 1.269531-3.710938 1.9375-5.554688.46875-1.296875.898437-2.625 1.429687-3.894531.527344-1.269531 1.191406-2.574219 1.777344-3.855469.820312-1.746094 1.601562-3.519531 2.511719-5.207031.398437-.738281.875-1.449219 1.292968-2.179688 1.230469-2.152343 2.480469-4.300781 3.855469-6.351562l.242187-.316407c7.101563-10.421874 16.09375-19.414062 26.511719-26.523437.109375-.070313.222657-.15625.328125-.242187 2.058594-1.382813 4.207032-2.632813 6.382813-3.875.714843-.410157 1.410156-.867188 2.136719-1.257813 1.699218-.925781 3.484374-1.714844 5.242187-2.53125 1.277344-.589844 2.527344-1.242187 3.832031-1.773437 1.296875-.53125 2.605469-1 3.914063-1.4375 1.832031-.671876 3.652343-1.367188 5.511719-1.929688.804687-.242188 1.640624-.402344 2.445312-.621094 2.394531-.660156 4.796875-1.289062 7.226562-1.761718l.4375-.070313c12.367188-2.359375 25.074219-2.359375 37.441407 0l.417969.070313c2.433593.472656 4.839843 1.113281 7.242187 1.761718.800781.21875 1.632813.378906 2.417969.621094 1.871094.5625 3.691406 1.257812 5.523437 1.929688 1.308594.476562 2.640625.90625 3.917969 1.4375 1.28125.53125 2.539062 1.171874 3.8125 1.757812 1.769531.832031 3.558594 1.621094 5.265625 2.546875.714844.375 1.390625.835937 2.089844 1.238281 2.183593 1.25 4.351562 2.511719 6.433593 3.90625l.246094.179688c10.457032 7.121094 19.472656 16.132812 26.59375 26.582031l.230469.308594c1.390625 2.058593 2.640625 4.214843 3.871094 6.371093.410156.71875.878906 1.421876 1.269531 2.148438.917969 1.710938 1.707031 3.484375 2.527344 5.242188.589844 1.28125 1.242187 2.53125 1.769531 3.832031.53125 1.296875 1 2.605469 1.4375 3.910156.675781 1.835937 1.375 3.65625 1.9375 5.527344.226563.792969.398437 1.613281.617187 2.410156.648438 2.410156 1.289063 4.820313 1.769532 7.25l.046875.390625c2.355469 12.394531 2.355469 25.125 0 37.515625zm141.878906-279.152344c11.050781 0 20 8.957031 20 20 0 11.050781-8.949219 20-20 20-11.042969 0-20-8.949219-20-20 0-11.042969 8.957031-20 20-20zm-280 20c0-22.089844 17.910156-40 40-40 22.09375 0 40 17.910156 40 40 0 22.09375-17.90625 40-40 40-22.089844 0-40-17.90625-40-40zm-220 0c0-11.042969 8.957031-20 20-20 11.050781 0 20 8.957031 20 20 0 11.050781-8.949219 20-20 20-11.042969 0-20-8.949219-20-20zm20 500c-11.042969 0-20-8.949219-20-20 0-11.042969 8.957031-20 20-20 11.050781 0 20 8.957031 20 20 0 11.050781-8.949219 20-20 20zm280-20c0 22.09375-17.90625 40-40 40-22.089844 0-40-17.90625-40-40 0-22.089844 17.910156-40 40-40 22.09375 0 40 17.910156 40 40zm220 0c0 11.050781-8.949219 20-20 20-11.042969 0-20-8.949219-20-20 0-11.042969 8.957031-20 20-20 11.050781 0 20 8.957031 20 20zm0 0"/><path d="m338.632812 270.058594c.898438-3.257813 1.382813-6.617188 1.425782-10 0-22.089844-17.90625-40-40-40-22.089844 0-40 17.910156-40 40 .050781 3.382812.53125 6.742187 1.429687 10-25.609375 13.960937-41.511719 40.835937-41.429687 70 0 5.527344 4.476562 10 10 10h140c5.527344 0 10-4.472656 10-10 .089844-29.164063-15.816406-56.039063-41.425782-70zm-38.574218-30c11.050781 0 20 8.957031 20 20 0 11.050781-8.949219 20-20 20-11.042969 0-20-8.949219-20-20 0-11.042969 8.957031-20 20-20zm-59.179688 90c2.996094-18.074219 14.144532-33.769532 30.230469-42.550782 7.5 8.007813 17.984375 12.550782 28.949219 12.550782 10.972656 0 21.449218-4.542969 28.949218-12.550782 16.089844 8.78125 27.238282 24.476563 30.234376 42.550782zm0 0"/></svg>
\ No newline at end of file
......@@ -166,30 +166,36 @@ class Popup extends React.Component<{}, State> {
/>
);
} else if (this.state.pane == "views") {
<CurrentTabViews
data={this.state.data}
registry={this.state.registry}
onClickBack={() => {
self.state.pane = "tab";
self.setState(self.state);
}}
/>;
return (
<CurrentTabViews
data={this.state.data}
registry={this.state.registry}
onClickBack={() => {
self.state.pane = "tab";
self.setState(self.state);
}}
/>
);
} else if (this.state.pane == "sources") {
<CurrentTabDataSources
data={this.state.data}
onClickBack={() => {
self.state.pane = "tab";
self.setState(self.state);
}}
/>;
return (
<CurrentTabDataSources
data={this.state.data}
onClickBack={() => {
self.state.pane = "tab";
self.setState(self.state);
}}
/>
);
} else if (this.state.pane == "resources") {
<CurrentTabResources
data={this.state.data}
onClickBack={() => {
self.state.pane = "tab";
self.setState(self.state);
}}
/>;
return (
<CurrentTabResources
data={this.state.data}
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