Skip to content

Commit 7af3beb

Browse files
committed
use title instead of basefilename
1 parent d35c0da commit 7af3beb

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/firefly/java/edu/caltech/ipac/firefly/data/DownloadRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ public void setFilePrefix(String filePrefix) {
7070

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

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

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

77-
public String getTitle() { return getParam(BASE_FILE_NAME); }
77+
public String getTitle() { return getParam(TITLE); }
7878

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

src/firefly/js/core/background/BackgroundCntlr.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ function bgSetInfo(action) {
198198
function bgPackage(action) {
199199
return (dispatch) => {
200200
const {dlRequest={}, searchRequest, selectionInfo, bgKey='', downloadType} = action.payload;
201-
let {fileLocation, wsSelect, BaseFileName} = dlRequest;
201+
let {fileLocation, wsSelect, Title} = dlRequest; //use Title as the file name
202202

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

208208
const onComplete = (jobInfo) => {

src/firefly/js/templates/common/ttFeatureWatchers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const PrepareDownload = React.memo(({table_id, tbl_title, viewerId, showF
200200
viewerId,
201201
DataSource: dataSource,
202202
help_id:'table.obsCorePackage',
203-
BaseFileName: fileName ? fileName+ `_${baseFileName}` : `${baseFileName}`
203+
Title: fileName ? fileName+ `_${baseFileName}` : `${baseFileName}`
204204
}}}>
205205
{!isDatalink && <Stack spacing={1}>
206206
<CheckboxGroupInputField

src/firefly/js/templates/lightcurve/LcResult.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function defaultDownloadPanel(mission='', cutoutSize, addtlParams={}) {
140140
title={'Image Download Options'}
141141
dlParams={{
142142
MaxBundleSize: 200 * 1024 * 1024, // set it to 200mb to make it easier to test multi-parts download. each wise image is ~64mb
143-
BaseFileName: `${mission}_Files`,
143+
Title: `${mission}_Files`,
144144
DataSource: `${mission} images`,
145145
FileGroupProcessor: 'LightCurveFileGroupsProcessor',
146146
...addtlParams

src/firefly/js/ui/DownloadDialog.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export function DownloadOptionPanel ({groupKey='DownloadDialog', cutoutSize, hel
190190
const maskPanel = (<BgMaskPanel key={bgKey} componentKey={bgKey}
191191
onMaskComplete={() =>hideDownloadDialog()}/>);
192192

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

242242
validateOnSubmit: PropTypes.func, // to validate form inputs on submit
243243
dlParams: PropTypes.shape({ // these params should be used as defaults value if they appears as input fields
244-
TitlePrefix: PropTypes.string, // default title of the download.. an index number will be appended to this.
245244
FilePrefix: PropTypes.string, // packaged file prefix
246-
BaseFileName: PropTypes.string, // zip file name
245+
Title: PropTypes.string, // title in the UI, also the file name of the downloaded file
247246
DataSource: PropTypes.string,
248247
MaxBundleSize: PropTypes.number,
249248
FileGroupProcessor: PropTypes.string.isRequired,
@@ -255,7 +254,7 @@ export function TitleField({style={}, value, label='Title:', size=30}) {
255254
return (
256255
<ValidationField
257256
forceReinit={true}
258-
fieldKey='BaseFileName' //title on the UI will also be used as file name on the backend
257+
fieldKey='Title' //title will also be used as the filename on the server
259258
tooltip='Enter a description to identify this download.'
260259
{...{validator:NotBlank, initialState:{value}, label, size, style}}
261260
/>

0 commit comments

Comments
 (0)