Skip to content

LIMS-1389 - Add upload to ccp4 cloud button#901

Merged
ndg63276 merged 4 commits intopre-release/2025-R2.1from
improvement/LIMS-1389/add-upload-to-ccp4-cloud-button
Mar 11, 2025
Merged

LIMS-1389 - Add upload to ccp4 cloud button#901
ndg63276 merged 4 commits intopre-release/2025-R2.1from
improvement/LIMS-1389/add-upload-to-ccp4-cloud-button

Conversation

@ndg63276
Copy link
Collaborator

@ndg63276 ndg63276 commented Feb 6, 2025

JIRA ticket: LIMS-1389

Summary:

We should allow users to directly send processed files (eg mtz, hkl) to CCP4 cloud, without them needing to download/upload. We can add an 'Upload to CCP4 Cloud' button to the 'attached files' dialog.

Changes:

  • Add a 'CCP4 Cloud' button to the attached files dialog, for both data processing jobs and also data collections themselves (for future work with mmcif files)
  • Add a config variable to alter upload path, also allows the button to be removed
  • Add a link to help pages on CCP4 cloud (page does not yet exist but Eugene says something will soon)
  • Add ability to store ccp4 username/cloudrun id in a cookie
  • Return to attached files dialog after successful upload

To test:

  • Set config variable:
$ccp4_cloud_upload_url = 'https://data.cloud.ccp4.ac.uk/api/data/<%=USERNAME%>/<%=FACILITYSHORT%>/<%=VISIT%>_<%=IMAGEPREFIX%>_<%=DATACOLLECTIONNUMBER%>/upload';
  • Sign up for a CCP4 cloud account at https://cloud.ccp4.ac.uk/
  • Go to a visit with processed data eg mx23694-127
  • Go to the 'Logs & Files' dialog, check there is a 'CCP4 Cloud' button next to any file of type 'result'
  • Click the button, then click 'Upload' with no credentials, check there is a sensible error
  • Fill in incorrect credentials, click 'Upload', check there is a sensible error
  • Get your cloudrun id from the 'My Account' section of CCP4 cloud, use it to fill in the correct credentials. Tick the box, click 'Upload' and check it seems to run ok, and returns to the attached files dialog.
  • Go to CCP4 Cloud, start a new project, and choose the task 'Import from Cloud Storage'. Click 'Select file' and then look in 'My Cloud Storage', the file should be under '/dls/mx23694-127_prefix', depending on the data collection you used.
  • There are no files attached to a data collection of type 'params', so insert one (any file will do), or update an existing one, or change attachments.js:56 to 'recip'.
  • Go to the data collection and click the little attachments (snowflake) button. Check a 'CCP4 Cloud' button appears next to the relevant attachment, and click it.
  • Check your credentials have been remembered, and that the upload works in the same way as before.

upload: function() {
if (this.ui.remember.is(':checked')) {
let cookieOpts = { expires: 365, path: '/' }
$.cookie('ccp4_username', this.ui.username.val(), cookieOpts)
Copy link
Collaborator

@gfrn gfrn Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the native cookie management library instead, since jQuery Cookie was removed? I'm happy to do it

https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie

@gfrn
Copy link
Collaborator

gfrn commented Feb 25, 2025

Looks good! We could maybe parse the response in line 72 of cloudupload.js so it shows a neater error message, but that is a minor nitpick

@gfrn gfrn added javascript Pull requests that update Javascript code Ready to Release Configuration Change Pull requests which necessitate changes to SynchWeb configuration and removed javascript Pull requests that update Javascript code labels Feb 25, 2025
@ndg63276 ndg63276 changed the base branch from master to pre-release/2025-R2.1 March 11, 2025 14:21
@ndg63276 ndg63276 merged commit 59457ba into pre-release/2025-R2.1 Mar 11, 2025
2 checks passed
ndg63276 added a commit that referenced this pull request Mar 25, 2025
* LIMS-1646: Show 'Use Facility Account' button for EU dewar dispatch (#910)

* LIMS-1622: Add units and decimal places to visit summary page (#911)

* LIMS-1605: Remove jquery-touchswipe library (#895)

* LIMS-1496: Fix offset grid scan heatmaps in Safari (#896)

* LIMS-1389 - Add upload to ccp4 cloud button (#901)

* LIMS-538: Remove the 'Centring Method' column from creating an MX container (#908)

* LIMS-128: Add plate view to queue container page (#900)
@ndg63276 ndg63276 deleted the improvement/LIMS-1389/add-upload-to-ccp4-cloud-button branch April 22, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Configuration Change Pull requests which necessitate changes to SynchWeb configuration Ready to Release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants