Skip to content

Commit

Permalink
LIMS-1554: Add 'State' column to proposals list page (#865)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Williams <[email protected]>
  • Loading branch information
ndg63276 and Mark Williams authored Jan 13, 2025
1 parent f0f03a1 commit cda9303
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions api/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@
# Beamlines on which to scale the gridplot to 1024
$scale_grid = array('i24');

# URL for instructions for closed proposals
$closed_proposal_link = '';

# These map proposal types to their proposalcode
# - If these are not defined for a proposal type, the api then uses bl_types below
Expand Down
3 changes: 2 additions & 1 deletion api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function setupApplication($mode): Slim
$dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $synchweb_version, $redirects,
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments,
$dials_rest_url_rings;
$dials_rest_url_rings, $closed_proposal_link;
$app->contentType('application/json');
$options = $app->container['options'];
$app->response()->body(json_encode(array(
Expand All @@ -95,6 +95,7 @@ function setupApplication($mode): Slim
'synchweb_version' => $synchweb_version,
'shipping_service_app_url' => $use_shipping_service_redirect || $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'shipping_service_app_url_incoming' => $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'closed_proposal_link' => $closed_proposal_link,
'dials_rest_url_rings' => $dials_rest_url_rings,
'redirects' => $redirects
)));
Expand Down
2 changes: 1 addition & 1 deletion api/src/Page/Proposal.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function _get_proposals($id = null)
$order = 'p.proposalid DESC';

if ($this->has_arg('sort_by')) {
$cols = array('ST' => 'p.bltimestamp', 'PROPOSALCODE' => 'p.proposalcode', 'PROPOSALNUMBER' => 'p.proposalnumber', 'VCOUNT' => 'vcount', 'TITLE' => 'lower(p.title)');
$cols = array('ST' => 'p.bltimestamp', 'PROPOSALCODE' => 'p.proposalcode', 'PROPOSALNUMBER' => 'p.proposalnumber', 'VCOUNT' => 'vcount', 'TITLE' => 'lower(p.title)', 'STATE' => 'p.state');
$dir = $this->has_arg('order') ? ($this->arg('order') == 'asc' ? 'ASC' : 'DESC') : 'ASC';
if (array_key_exists($this->arg('sort_by'), $cols))
$order = $cols[$this->arg('sort_by')] . ' ' . $dir;
Expand Down
11 changes: 10 additions & 1 deletion client/src/js/app/components/navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
class="tw-block tw-text-gray-900 tw-py-4 tw-px-2"
>
<p>This proposal is closed. You cannot create shipments, proteins or contacts.</p>
<span v-if="getClosedProposalLink"><a @click="onWrapperClick" :href="getClosedProposalLink">Click here for more info.</a></span>
</router-link>
</li>
<li
Expand Down Expand Up @@ -170,6 +171,9 @@ export default {
},
helpStatus: function() {
return this.showHelp ? "On" : "Off"
},
getClosedProposalLink: function() {
return app.options.get('closed_proposal_link')
}
},
methods: {
Expand All @@ -190,6 +194,11 @@ export default {
$('p.help').fadeOut()
}
},
onWrapperClick(e) {
if (e.target.tagName === 'A') {
e.stopPropagation()
}
},
}
}
</script>
Expand All @@ -210,4 +219,4 @@ export default {
margin-top: 1rem;
width: 101%;
}
</style>
</style>
3 changes: 2 additions & 1 deletion client/src/js/modules/proposal/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define(['marionette',
{ name: 'PROPOSALCODE', label: 'Code', cell: 'string', editable: false },
{ name: 'PROPOSALNUMBER', label: 'Number', cell: 'string', editable: false },
{ name: 'VCOUNT', label: 'Visits', cell: 'string', editable: false },
{ name: 'STATE', label: 'State', cell: 'string', editable: false },
{ name: 'TITLE', label: 'Title', cell: 'string', editable: false }]

this.table = new TableView({ collection: options.collection, columns: columns, tableClass: 'proposals', filter: 's', search: options.params.s, loading: true, backgrid: { row: this.getOption('clickableRow'), emptyText: 'No proposals found', } })
Expand All @@ -41,4 +42,4 @@ define(['marionette',
},
})

})
})

0 comments on commit cda9303

Please sign in to comment.