Skip to content

FIREFLY-1748: Cleanup and fix failing tests #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public void setFilePrefix(String filePrefix) {

public boolean isSelectAll () { return _selectInfo.isSelectAll(); }

public String getBaseFileName() { return getParam(BASE_FILE_NAME); }
public String getBaseFileName() { return getParam(TITLE); } //use Title as the file name also

public String getDataSource() { return getParam(DATA_SOURCE); }

public String getTitle() { return getParam(BASE_FILE_NAME); }
public String getTitle() { return getParam(TITLE); }

public String getEmail() { return getParam(EMAIL); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public class DownloadScript {
# move file to main directory and cleanup
mv "$downloadedFile" "$destPath"
echo ">> Saved as $destPath"

[zip-logic-added-here]

cd "$startDir"
rm -rf "$tmpDir"
Expand Down
6 changes: 3 additions & 3 deletions src/firefly/js/core/background/BackgroundCntlr.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ function bgSetInfo(action) {
function bgPackage(action) {
return (dispatch) => {
const {dlRequest={}, searchRequest, selectionInfo, bgKey='', downloadType} = action.payload;
let {fileLocation, wsSelect, BaseFileName} = dlRequest;
let {fileLocation, wsSelect, Title} = dlRequest; //use Title as the file name

BaseFileName = BaseFileName.endsWith('.zip') ? BaseFileName : BaseFileName.trim() + '.zip';
Title = Title.endsWith('.zip') ? Title : Title.trim() + '.zip';
if (fileLocation === WORKSPACE) {
if (!validateFileName(wsSelect, BaseFileName)) return false;
if (!validateFileName(wsSelect, Title)) return false;
}

const onComplete = (jobInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/js/templates/common/ttFeatureWatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const PrepareDownload = React.memo(({table_id, tbl_title, viewerId, showF
viewerId,
DataSource: dataSource,
help_id:'table.obsCorePackage',
BaseFileName: fileName ? fileName+ `_${baseFileName}` : `${baseFileName}`
Title: fileName ? fileName+ `_${baseFileName}` : `${baseFileName}`
}}}>
{!isDatalink && <Stack spacing={1}>
<CheckboxGroupInputField
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/js/templates/lightcurve/LcResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function defaultDownloadPanel(mission='', cutoutSize, addtlParams={}) {
title={'Image Download Options'}
dlParams={{
MaxBundleSize: 200 * 1024 * 1024, // set it to 200mb to make it easier to test multi-parts download. each wise image is ~64mb
BaseFileName: `${mission}_Files`,
Title: `${mission}_Files`,
DataSource: `${mission} images`,
FileGroupProcessor: 'LightCurveFileGroupsProcessor',
...addtlParams
Expand Down
7 changes: 3 additions & 4 deletions src/firefly/js/ui/DownloadDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export function DownloadOptionPanel ({groupKey='DownloadDialog', cutoutSize, hel
const maskPanel = (<BgMaskPanel key={bgKey} componentKey={bgKey}
onMaskComplete={() =>hideDownloadDialog()}/>);

const dlTitle = get(dlParams, 'BaseFileName', 'Download' + '-' + dlTitleIdx); //use BaseFileName as title as well
const dlTitle = get(dlParams, 'Title', 'Download' + '-' + dlTitleIdx); //title will also be filename of the downloaded file
const preTitleMessage = dlParams?.PreTitleMessage ?? '';
return (
<Stack sx ={{m:1/2, position: 'relative', minWidth:400, height:'auto', ...style}}>
Expand Down Expand Up @@ -241,9 +241,8 @@ DownloadOptionPanel.propTypes = {

validateOnSubmit: PropTypes.func, // to validate form inputs on submit
dlParams: PropTypes.shape({ // these params should be used as defaults value if they appears as input fields
TitlePrefix: PropTypes.string, // default title of the download.. an index number will be appended to this.
FilePrefix: PropTypes.string, // packaged file prefix
BaseFileName: PropTypes.string, // zip file name
Title: PropTypes.string, // title in the UI, also the file name of the downloaded file
DataSource: PropTypes.string,
MaxBundleSize: PropTypes.number,
FileGroupProcessor: PropTypes.string.isRequired,
Expand All @@ -255,7 +254,7 @@ export function TitleField({style={}, value, label='Title:', size=30}) {
return (
<ValidationField
forceReinit={true}
fieldKey='BaseFileName' //title on the UI will also be used as file name on the backend
fieldKey='Title' //title will also be used as the filename on the server
tooltip='Enter a description to identify this download.'
{...{validator:NotBlank, initialState:{value}, label, size, style}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public void curl() throws Exception {
assertTrue("Mkdir should be present", lines.stream().anyMatch(line -> line.contains("mkdir ")));
assertTrue("Unzip command should be present", lines.stream().anyMatch(line -> line.contains("unzip -qq")));
}

@Ignore("Need to update test to match new script format")

@Test
public void wgetUnzip() throws Exception {
List<FileGroup> fileInfoList = List.of(new FileGroup(List.of(
Expand Down