Skip to content

Commit

Permalink
Improved style/format for message block and info popup for privacy-pr…
Browse files Browse the repository at this point in the history
…eserving preview on dataset pg. [ref #4233]
  • Loading branch information
mheppler committed Nov 17, 2017
1 parent 543bf60 commit 836d248
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"displayName": "Privacy-Preserving Data Preview",
"description": "The link below goes to a tool that helps data depositors release privacy preserving statistics describing a dataset.\n\nThis is done by distributing a privacy budget across different possible statistical calculations. This tool is called the budgeter. Users select which statistics they would like to calculate and are given estimates of how accurately each statistic can be computed. They can also redistribute their privacy budget according to which statistics they think are most valuable in their dataset.",
"description": "Use the PSI budgeter tool to create privacy-preserving summary statistics for this data file. The tool distributes a privacy budget across different possible statistical calculations. Users select which statistics they would like to calculate and are given estimates of how accurately each statistic can be computed. They can also redistribute their privacy budget according to which statistics they think are most valuable in their dataset.",
"toolUrl": "https://beta.dataverse.org/custom/DifferentialPrivacyPrototype/UI/code/interface.html",
"toolParameters": {
"queryParameters": [
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ file.rsyncUpload.step2.downloadScriptButton=Download Script
file.rsyncUpload.step3=Open a terminal window in the same directory you saved the script and run this command: <code>bash ./{0}</code>
file.rsyncUpload.step4=Follow the instructions in the script. It will ask for a full path (beginning with "/") to the directory containing your data. Note: this script will expire after 7 days.
file.rsyncUpload.inProgressMessage.summary=DCM File Upload
file.rsyncUpload.inProgressMessage.details=- this dataset is locked until the data files have been transferred and verified.
file.rsyncUpload.inProgressMessage.details=This dataset is locked until the data files have been transferred and verified.

file.metaData.dataFile.dataTab.variables=Variables
file.metaData.dataFile.dataTab.observations=Observations
Expand Down Expand Up @@ -1527,7 +1527,7 @@ file.results.btn.sort.option.type=Type
file.compute.fileRestricted=File Restricted
file.compute.fileAccessDenied=You cannot compute on this restricted file because you do not have permission to access it.
file.configure.Button=Configure
file.configure.launchMessage.details=Please refresh this page once you've finished configuring your
file.configure.launchMessage.details=Please refresh this page once you have finished configuring your
dataset.compute.datasetCompute=Dataset Compute Not Supported
dataset.compute.datasetAccessDenied=You cannot compute on this dataset because you do not have permission to access all of the restricted files.
dataset.compute.datasetComputeDisabled=You cannot compute on this dataset because this functionality is not enabled yet. Please click on a file to access computing features.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ConfigureFragmentBean implements java.io.Serializable{
private ExternalTool tool = null;

public String psiExternalAlert() {
JH.addMessage(FacesMessage.SEVERITY_WARN, tool.getDisplayName(), BundleUtil.getStringFromBundle("file.configure.launchMessage.details") + " " + tool.getDisplayName());
JH.addMessage(FacesMessage.SEVERITY_WARN, tool.getDisplayName(), BundleUtil.getStringFromBundle("file.configure.launchMessage.details") + " " + tool.getDisplayName() + ".");
return "";
}

Expand Down
12 changes: 11 additions & 1 deletion src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,16 @@
</p:dialog>
<!-- END: Request Access Sign Up/Log In Button -->

<p:dialog header="#{configureFragmentBean.configurePopupTool.displayName}" widgetVar="configureToolPopup" modal="true"
id="configureToolPopup" styleClass="smallPopUp" rendered="#{DatasetPage.sessionUserAuthenticated and DatasetPage.canUpdateDataset()}">

<ui:include src="file-configure-popup-fragment.xhtml">
<ui:param name="externalTools" value="#{DatasetPage.getExternalToolsForDataFile(fileMetadata.dataFile.id)}"/>
<ui:param name="canUpdateDataset" value="#{DatasetPage.canUpdateDataset()}"/>
</ui:include>

</p:dialog>

<p:dialog id="downloadPopup" styleClass="largePopUp" header="#{bundle['file.downloadDialog.header']}" widgetVar="downloadPopup" modal="true">
<o:importFunctions type="edu.harvard.iq.dataverse.util.MarkupChecker" />

Expand Down Expand Up @@ -1213,7 +1223,7 @@
</ui:include>
</div>
</p:dialog>

<p:dialog id="linkDatasetForm" header="#{bundle['dataset.link']}" widgetVar="linkDatasetForm" modal="true">
<ui:fragment rendered="#{DatasetPage.dataversesForLinking.size() > 0}">
<ui:fragment rendered="#{DatasetPage.dataversesForLinking.size() == 1}">
Expand Down
46 changes: 16 additions & 30 deletions src/main/webapp/file-configure-dropdown-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
xmlns:o="http://omnifaces.org/ui"
xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">

<div class="btn-group" >
<div class="btn-group">
<button type="button" id="editFile" class="btn btn-default btn-access dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-cog"/> #{bundle['dataset.configureBtn']} <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right text-left" role="menu" >
<ul class="dropdown-menu pull-right text-left" role="menu">
<!-- Worldmap unpublished -->
<li jsf:rendered="#{worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata)}">
<a onclick="PF('mapData_popup').show()" href="javascript:void(0);" >#{bundle['file.map']}</a>
<a onclick="PF('mapData_popup').show()" href="javascript:void(0);">#{bundle['file.map']}</a>
</li>
<!-- Worldmap published -->
<li jsf:rendered="#{worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata)}">
<a href="#{fileMetadata.dataFile.getMapItURL(dataverseSession.user.id)}" >#{bundle['file.map']}</a>
<a href="#{fileMetadata.dataFile.getMapItURL(dataverseSession.user.id)}">#{bundle['file.map']}</a>
</li>
<ui:repeat value="#{externalTools}" var="tool" rendered="#{dataverseSession.user.authenticated and canUpdateDataset and (fileMetadata.dataFile.tabularData or worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata))}">
<li>
Expand All @@ -37,31 +37,17 @@
</ul>
</div>

<p:dialog header="#{configureFragmentBean.configurePopupTool.displayName}" widgetVar="configureToolPopup" modal="true" id="configureToolPopup">
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/> #{configureFragmentBean.configurePopupTool.description}
</p>
<div class="button-block">
<!-- This calls the alert in dataset page and works, but probably should be somewhere else -->
<p:commandButton
action="#{configureFragmentBean.psiExternalAlert()}"
value="#{bundle['file.configure.Button']}"
onclick="PF('configureToolPopup').hide();window.open('#{configureFragmentBean.configurePopupTool.toolUrl}', '_blank')"
update=":messagePanel">
</p:commandButton>
<button type="button" class="btn btn-default" onclick="PF('configureToolPopup').hide();PF('blockDatasetForm').hide();" value="#{bundle.cancel}">#{bundle.cancel}</button>
</div>
</p:dialog>

<p:dialog header="#{bundle['file.mapData.unpublished.header']}" widgetVar="mapData_popup" modal="true" rendered="#{(worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata))}">
<p class="help-block">
<span class="text-danger"><span class="glyphicon glyphicon-warning-sign"/> #{bundle['file.mapData.unpublished.message']}</span>
</p>
<div class="button-block">
<button type="button" class="btn btn-default" onclick="PF('mapData_popup').hide();PF('blockDatasetForm').hide();">
#{bundle.close}
</button>
</div>
</p:dialog>
<!-- MOVED TO file configure popup fragment -->

<p:dialog header="#{bundle['file.mapData.unpublished.header']}" widgetVar="mapData_popup" modal="true" rendered="#{(worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata))}">
<p class="help-block">
<span class="text-danger"><span class="glyphicon glyphicon-warning-sign"/> #{bundle['file.mapData.unpublished.message']}</span>
</p>
<div class="button-block">
<button type="button" class="btn btn-default" onclick="PF('mapData_popup').hide();PF('blockDatasetForm').hide();">
#{bundle.close}
</button>
</div>
</p:dialog>

</ui:composition>
25 changes: 25 additions & 0 deletions src/main/webapp/file-configure-popup-fragment.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
xmlns:o="http://omnifaces.org/ui"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">

<p class="help-block">
<h:outputText styleClass="text-left" value=" #{configureFragmentBean.configurePopupTool.description}" escape="false"/>
</p>

<div class="button-block">
<!-- This calls the alert in dataset page and works, but probably should be somewhere else -->
<p:commandLink type="button" styleClass="btn btn-default"
action="#{configureFragmentBean.psiExternalAlert()}"
value="#{bundle['continue']}"
onclick="PF('configureToolPopup').hide();window.open('#{configureFragmentBean.configurePopupTool.toolUrl}', '_blank')"
update=":messagePanel">
</p:commandLink>
<button type="button" class="btn btn-default" onclick="PF('configureToolPopup').hide();PF('blockDatasetForm').hide();" value="#{bundle.cancel}">#{bundle.cancel}</button>
</div>
</ui:composition>
3 changes: 3 additions & 0 deletions src/main/webapp/resources/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,9 @@ div[id$="filesTable"].ui-datatable.ui-datatable-scrollable {padding-right:12px;}
#file-replace-original-block div[id$="filesTable"] .col-file-thumb {width:74px !important;padding:4px 10px;}
#file-replace-original-block div[id$="filesTable"] .col-file-metadata {padding:4px 10px;}

/* HACK */
div[id$="filesTable"] div.ui-datatable-scrollable-body {padding-bottom:140px;}

span.ingest-warning {display:inline-block; font-size:24px; line-height:1; vertical-align: middle;}
span.ingest-warning span.glyphicon {top:3px}

Expand Down
9 changes: 5 additions & 4 deletions src/main/webapp/resources/iqbs/messages.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ui:fragment rendered="#{not empty flash['errorMsg']}">
<div class="alert alert-danger">
<o:form useRequestURI="true">
<span class="glyphicon glyphicon-exclamation-sign"></span>&#160;<strong>#{bundle['messages.error']}</strong>
<span class="glyphicon glyphicon-warning-sign"></span>&#160;<strong>#{bundle['messages.error']}</strong>
<h:outputText value="#{flash['errorMsg']} " escape="false"/>
<h:outputFormat value="#{bundle['error.support.message']}" escape="false">
<o:param>
Expand All @@ -38,7 +38,7 @@
</ui:fragment>
<ui:fragment rendered="#{not empty flash['infoMsg']}">
<div class="alert alert-info">
<span class="glyphicon glyphicon-exclamation-sign"></span>&#160;<strong>#{bundle['messages.info']}</strong><h:outputText escape="false" value="#{flash['infoMsg']} "/>
<span class="glyphicon glyphicon-info-sign"></span>&#160;<strong>#{bundle['messages.info']}</strong><h:outputText escape="false" value="#{flash['infoMsg']} "/>
</div>
</ui:fragment>
<ui:fragment rendered="#{not empty flash['warningMsg']}">
Expand All @@ -48,17 +48,18 @@
</ui:fragment>
<ui:fragment rendered="#{facesContext.validationFailed}">
<div class="alert alert-danger">
<span class="glyphicon glyphicon-exclamation-sign"></span>&#160;<strong>#{bundle['messages.validation']}</strong> – #{bundle['messages.validation.msg']}
<span class="glyphicon glyphicon-warning-sign"></span>&#160;<strong>#{bundle['messages.validation']}</strong> – #{bundle['messages.validation.msg']}
</div>
</ui:fragment>
<ui:repeat rendered="#{!facesContext.validationFailed}" value="#{facesContext.messageList}" var="msg">
#{level = fn:split(msg.severity,' ')[0]; "" }
#{bsClass = (level eq 'INFO' ? 'info' : (level eq 'WARN' ? 'warning' : 'danger')); ""}
#{bsIcon = (level eq 'INFO' ? 'info' : (level eq 'WARN' ? 'exclamation' : 'warning')); ""}
<div class="alert #{cc.attrs.collapsible ? 'alert-dismissable' :''} alert-#{bsClass}">
<ui:fragment rendered="#{cc.attrs.collapsible}">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</ui:fragment>
<span class="glyphicon glyphicon-info-sign"></span>&#160;<strong>#{msg.summary}</strong>&#160;<h:outputText value="#{msg.detail}" rendered="#{!empty msg.detail and (msg.detail != msg.summary)}"/>
<span class="glyphicon glyphicon-#{bsIcon}-sign"></span>&#160;<strong>#{msg.summary}</strong><h:outputText escape="false" value="#{msg.detail}" rendered="#{!empty msg.detail and (msg.detail != msg.summary)}"/>
<ui:fragment rendered="#{level eq 'FATAL'}">
Please contact <a href="#" onclick="event.preventDefault();PF('contactForm').show();" title="Contact #{settingsWrapper.supportTeamName}">#{settingsWrapper.supportTeamName}</a> for assistance.
<strong>Date/Time: </strong>
Expand Down

0 comments on commit 836d248

Please sign in to comment.