Skip to content

Commit

Permalink
Removed additional editMode render logic not needed in file table on …
Browse files Browse the repository at this point in the history
…dataset pg [ref #7081]
  • Loading branch information
mheppler committed Oct 8, 2020
1 parent f094b97 commit 56dc4c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/main/webapp/file-info-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<div class="col-sm-10 col-file-metadata">
<div class="fileNameOriginal">
<ui:fragment rendered="#{!editDatafilesPage}">
<!-- conditional render in file page links, if file has global id, use that; if not, we use database id -->
<a href="#{widgetWrapper.wrapURL('/file.xhtml?'.concat(!empty fileMetadata.dataFile.globalIdString ? 'persistentId=' : 'fileId=').concat(!empty fileMetadata.dataFile.globalIdString ? fileMetadata.dataFile.globalIdString : fileMetadata.dataFile.id).concat('&amp;version=').concat(fileMetadata.datasetVersion.friendlyVersionNumber))}">
#{fileMetadata.label}
</a>
Expand Down
35 changes: 9 additions & 26 deletions src/main/webapp/filesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
value="#{DatasetPage.fileMetadatasSearch}"
rowIndexVar="rowNum" rowKey="#{fileMetadata.dataFile.storageIdentifier}"
selection="#{DatasetPage.selectedFiles}" var="fileMetadata" widgetVar="filesTable"
rendered="#{DatasetPage.fileDisplayTable and empty DatasetPage.editMode and (DatasetPage.workingVersion != null)}"
rendered="#{DatasetPage.fileDisplayTable and (DatasetPage.workingVersion != null)}"
emptyMessage="#{DatasetPage.workingVersion.fileMetadatas.size() == 0 ? bundle['file.notFound.tip'] : bundle['file.notFound.search']}">
<p:ajax event="page" listener="#{DatasetPage.fileListingPaginatorListener}" update="filesTable" process="@this" oncomplete="refreshPaginator(),rebindCommand()" immediate="true"/>
<p:ajax event="toggleSelect" listener="#{DatasetPage.toggleAllSelected()}" update="filesTable" process="@this" oncomplete="rebindCommand()" />
Expand Down Expand Up @@ -118,21 +118,16 @@
</div>
<div class="col-xs-7 text-right">
<p:outputPanel id="filesButtons">
<!-- 4.2.1: replaced permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset) with DatasetPage.canUpdateDataset() -->
<!-- tab-header pull-right -->
<div jsf:id="uploadComputeBlock" class="button-block pull-right no-margin-top"
jsf:rendered="#{!(DatasetPage.editMode == 'FILE' or DatasetPage.editMode == 'CREATE')
and (DatasetPage.canUpdateDataset()
jsf:rendered="#{(DatasetPage.canUpdateDataset()
or (!(empty DatasetPage.workingVersion.fileMetadatas) and DatasetPage.workingVersion.fileMetadatas.size() > 1))}">

<!-- DOWNLOAD DCM SCRIPT BUTTON -->
<h:commandLink id="rsyncDLFF" actionListener="#{DatasetPage.downloadRsyncScript()}" styleClass="btn btn-default"
rendered="#{DatasetPage.sessionUserAuthenticated
and DatasetPage.canUpdateDataset() and empty DatasetPage.workingVersion.fileMetadatas
and !widgetWrapper.widgetView and DatasetPage.lockedDueToDcmUpload}">
<span class="glyphicon glyphicon-download-alt"/> <h:outputText value=" #{bundle['file.rsyncUpload.step2.downloadScriptButton']}"/>
</h:commandLink>

<!-- UPLOAD FILES BUTTON -->
<h:outputLink value="/editdatafiles.xhtml?datasetId=#{DatasetPage.dataset.id}&#38;mode=UPLOAD"
type="button" styleClass="btn btn-default btn-access #{DatasetPage.lockedFromEdits ? 'disabled' : ''}"
Expand Down Expand Up @@ -372,7 +367,7 @@
            </ui:include>
</p:column>

<p:column class="col-file-action button-block text-right" ariaHeaderText="#{bundle['file.actionsBlock']}" rendered="#{!(DatasetPage.editMode == 'FILE' or DatasetPage.editMode == 'CREATE')}">
<p:column class="col-file-action button-block text-right" ariaHeaderText="#{bundle['file.actionsBlock']}">
<f:facet name="header">
<!-- EDIT -->
<div style="margin-right:14px;" class="btn-group" jsf:rendered="#{DatasetPage.sessionUserAuthenticated
Expand Down Expand Up @@ -629,29 +624,17 @@
widgetVar="filesTree"
value="#{DatasetPage.filesTreeRoot}"
var="node">

<p:treeNode expandedIcon="ui-icon ui-icon-folder-open" collapsedIcon="ui-icon ui-icon-folder-collapsed">
<!-- For a folder, the node payload is just its name as a String object, that we display here: -->
<h:outputText value="#{node}" />
<h:outputText value="#{node}"/>
</p:treeNode>

<p:treeNode type="customFileNode">
<!-- For a file, the payload data ("node") is the corresponding FileMetadata object: -->
<span class="icon-#{dataFileServiceBean.getFileThumbnailClass(node.dataFile)} text-muted" />

<!-- same approach to rendering file page links, as in the file table above: -->
<!-- if the file has the global id, we use that; if not, we use the database id in the url. -->
<ui:fragment rendered="#{!empty node.dataFile.globalIdString}">
<a href="#{widgetWrapper.wrapURL('/file.xhtml?persistentId='.concat(node.dataFile.globalIdString).concat('&amp;version=').concat(DatasetPage.workingVersion.friendlyVersionNumber))}">
#{node.label}
</a>
</ui:fragment>
<ui:fragment rendered="#{empty node.dataFile.globalIdString}">
<a href="#{widgetWrapper.wrapURL('/file.xhtml?fileId='.concat(node.dataFile.id).concat('&amp;version=').concat(DatasetPage.workingVersion.friendlyVersionNumber))}">
#{node.label}
</a>
</ui:fragment>

<span class="icon-#{dataFileServiceBean.getFileThumbnailClass(node.dataFile)} text-muted"/>
<!-- conditional render in file page links, if file has global id, use that; if not, we use database id -->
<a href="#{widgetWrapper.wrapURL('/file.xhtml?'.concat(!empty node.dataFile.globalIdString ? 'persistentId=' : 'fileId=').concat(!empty node.dataFile.globalIdString ? node.dataFile.globalIdString : node.dataFile.id).concat('&amp;version=').concat(DatasetPage.workingVersion.friendlyVersionNumber))}">
#{node.label}
</a>
<span class="text-muted">(#{node.dataFile.friendlySize})</span>
</p:treeNode>
</p:tree>
Expand Down

0 comments on commit 56dc4c7

Please sign in to comment.