Skip to content

Commit e815def

Browse files
committed
1.Fixed problem with extra help icon on select a new image panel.
2. Updated some help links per Luisa's feedbacks. 3.. Updated the LC viewer panels.
1 parent d1bffbf commit e815def

File tree

6 files changed

+74
-59
lines changed

6 files changed

+74
-59
lines changed

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ import {dispatchLoadPlotData} from '../../charts/XYPlotCntlr.js';
3131

3232
import {RAW_TABLE, PHASE_FOLDED} from '../../templates/lightcurve/LcManager.js';
3333

34+
const grpkey = 'LC_FORM_Panel';
35+
3436
function getDialogBuilder() {
3537
var popup= null;
3638
return () => {
3739
if (!popup) {
3840
const popup= (
3941
<PopupPanel title={'Light Curve'} >
40-
<LCInput groupKey={'LC_FORM_Panel'} />
42+
<LcPhaseFoldingDialog groupKey={grpkey} />
4143
</PopupPanel>
4244
);
43-
DialogRootContainer.defineDialog('LcParamForm', popup);
45+
DialogRootContainer.defineDialog('LcPhaseFoldingForm', popup);
4446
}
4547
return popup;
4648
};
@@ -49,9 +51,9 @@ function getDialogBuilder() {
4951
const dialogBuilder= getDialogBuilder();
5052

5153
// Could be a popup form
52-
export function showLcParamForm() {
54+
export function showLcPhaseFoldingForm() {
5355
dialogBuilder();
54-
dispatchShowDialog('LcParamForm');
56+
dispatchShowDialog('LcPhaseFoldingForm');
5557
}
5658

5759
const PanelResizableStyle = {
@@ -126,7 +128,7 @@ const defValues= {
126128
};
127129

128130

129-
var LCInput = React.createClass({
131+
var LcPhaseFoldingDialog = React.createClass({
130132

131133

132134

@@ -136,7 +138,7 @@ var LCInput = React.createClass({
136138
<div>
137139
<Tabs componentKey='LCInputTabs' defaultSelected={0} useFlex={true}>
138140
<Tab name='Phase Folding'>
139-
<LcParamForm />
141+
<LcPhaseFoldingForm />
140142
</Tab>
141143
</Tabs>
142144
</div>
@@ -148,11 +150,11 @@ var LCInput = React.createClass({
148150
});
149151

150152

151-
export class LcParamForm extends Component {
153+
export class LcPhaseFoldingForm extends Component {
152154

153155
constructor(props) {
154156
super(props);
155-
this.state = {fields:FieldGroupUtils.getGroupFields('LC_FORM_Panel')};
157+
this.state = {fields:FieldGroupUtils.getGroupFields(grpkey)};
156158
}
157159

158160
componentWillUnmount() {
@@ -163,7 +165,7 @@ export class LcParamForm extends Component {
163165

164166
componentDidMount() {
165167
this.iAmMounted= true;
166-
this.unbinder= FieldGroupUtils.bindToStore('LC_FORM_Panel', (fields) => {
168+
this.unbinder= FieldGroupUtils.bindToStore(grpkey, (fields) => {
167169
if (fields!==this.state.fields && this.iAmMounted) {
168170
this.setState({fields});
169171
}
@@ -173,7 +175,7 @@ export class LcParamForm extends Component {
173175
render() {
174176
var {fields}= this.state;
175177
// if (!fields) return false;
176-
return <LcCurveOptionsPanel fields={fields} />;
178+
return <LcPFOptionsPanell fields={fields} />;
177179
}
178180

179181
}
@@ -194,7 +196,7 @@ export function LcPFOptionsPanel ({fields}) {
194196

195197
return (
196198

197-
<FieldGroup style= {PanelResizableStyle} groupKey={'LC_FORM_Panel'} initValues={{timeCol:'mjd',field1:'4'}}
199+
<FieldGroup style= {PanelResizableStyle} groupKey={grpkey} initValues={{timeCol:'mjd',field1:'4'}}
198200
reducerFunc={DialogReducer} keepState={true}>
199201
<InputGroup labelWidth={110}>
200202

@@ -311,7 +313,7 @@ var DialogReducer= function(inFields, action) {
311313

312314

313315
function resetDefaults() {
314-
dispatchRestoreDefaults('LC_FORM_Panel');
316+
dispatchRestoreDefaults(grpkey);
315317

316318
}
317319

@@ -338,8 +340,8 @@ function showResults(success, request) {
338340
</PopupPanel>
339341
);
340342

341-
DialogRootContainer.defineDialog('ResultsFromLcParamForm', results);
342-
dispatchShowDialog('ResultsFromLcParamForm');
343+
DialogRootContainer.defineDialog('ResultsFromLcPhaseFoldingForm', results);
344+
dispatchShowDialog('ResultsFromLcPhaseFoldingForm');
343345

344346
}
345347

@@ -349,7 +351,7 @@ function makeResultInfoContent(statStr,s,closePromiseClick) {
349351
<div style={{padding:'5px'}}>
350352
<br/>{statStr}<br/><br/>{s}
351353
<button type='button' onClick={closePromiseClick}>Another Close</button>
352-
<CompleteButton dialogId='ResultsFromLcParamForm' />
354+
<CompleteButton dialogId='ResultsFromLcPhaseFoldingForm' />
353355
</div>
354356
);
355357
}
@@ -365,7 +367,7 @@ function resultsSuccess(request) {
365367
}
366368

367369
function onSearchSubmit(request) {
368-
let fieldState = FieldGroupUtils.getGroupFields('LC_FORM_Panel');
370+
let fieldState = FieldGroupUtils.getGroupFields(grpkey);
369371

370372
// TODO Fix: request doesn't contain 'Tabs'...
371373
//if (request.Tabs==='LC Param') {
@@ -405,4 +407,4 @@ function makeField1(hide) {
405407

406408

407409

408-
//export default LcParamForm;
410+
//export default LcPhaseFoldingForm;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import {FieldGroup} from '../../ui/FieldGroup.jsx';
2727
import {ListBoxInputField} from '../../ui/ListBoxInputField.jsx';
2828
import {InputGroup} from '../../ui/InputGroup.jsx';
2929
import {UploadPanel} from './LcViewer.jsx';
30-
import {showLcParamForm, LcPFOptionsPanel} from './LcPhaseFoldingPanel.jsx';
31-
import {LCPFOPanel} from './PeriodogramOptionsPanel.jsx';
3230
import {LcPlotOptionsPanel} from './LcPlotOptions.jsx';
3331
import {LcImageToolbar} from './LcImageToolbar.jsx';
3432
import {ImageMetaDataToolbar} from '../../visualize/ui/ImageMetaDataToolbar.jsx';
33+
import {LcPFOptionsPanel} from './LcPhaseFoldingPanel.jsx';
34+
import {LcPeriodFindingPanel} from './PeriodogramOptionsPanel.jsx';
3535

3636
const PanelResizableStyle = {
3737
width: 400,
@@ -108,7 +108,7 @@ export class LcResult extends Component {
108108
</Tab>
109109
<Tab name="Periodogram">
110110
<div>
111-
<LCPFOPanel />
111+
<LcPeriodFindingPanel />
112112
</div>
113113
</Tab>
114114
<Tab name='Upload'>

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

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {makeTblRequest,getTblById} from '../../tables/TableUtil.js';
2020

2121
import {dispatchLoadPlotData} from '../../charts/XYPlotCntlr.js';
2222

23+
import {dispatchMultiValueChange, dispatchRestoreDefaults} from '../../fieldGroup/FieldGroupCntlr.js';
2324
import {RAW_TABLE,PERIODOGRAM, PEAK_TABLE} from '../../templates/lightcurve/LcManager.js';
2425

2526
const gkey = 'PFO_PANEL';
@@ -59,45 +60,46 @@ export class PeriodogramOptionsPanel extends Component {
5960

6061
constructor(props) {
6162
super(props);
63+
this.state = {fields:FieldGroupUtils.getGroupFields(gkey)};
6264
}
6365

6466
componentWillUnmount() {
65-
if (this.removeListener) this.removeListener();
6667
this.iAmMounted= false;
68+
if (this.unbinder) this.unbinder();
69+
//if (this.removeListener) this.removeListener();
70+
//this.iAmMounted= false;
6771
}
6872

6973
componentDidMount() {
7074
this.iAmMounted= true;
71-
this.removeListener= FieldGroupUtils.bindToStore(gkey, (fields) => {
72-
if (this.iAmMounted) this.setState(fields);
75+
this.unbinder= FieldGroupUtils.bindToStore(gkey, (fields) => {
76+
if (fields!==this.state.fields && this.iAmMounted) {
77+
this.setState({fields});
78+
}
79+
//this.iAmMounted= true;
80+
//this.removeListener= FieldGroupUtils.bindToStore(gkey, (fields) => {
81+
// if (this.iAmMounted) this.setState(fields);
7382
});
7483
}
7584

7685
render() {
77-
const fields= this.state;
86+
var fields= this.state;
7887
return (
79-
<LCPFOPanel />
88+
<LcPeriodFindingPanel />
8089
);
81-
8290
}
8391

8492

8593
}
8694

87-
88-
function hideSearchPanel() {
89-
dispatchHideDropDown();
90-
}
91-
92-
93-
export const LCPFOPanel = () => {
95+
/**
96+
*
97+
* @returns {XML}
98+
* @constructor
99+
*/
100+
export function LcPeriodFindingPanel () {
94101
return (
95102
<div style={{padding:5}}>
96-
<FormPanel
97-
width='400px' height='200px'
98-
groupKey={gkey}
99-
onSubmit={(request) => onSearchSubmit(request)}
100-
onCancel={hideSearchPanel}>
101103
<FieldGroup groupKey={gkey} reducerFunc={periodogramRangeReducer} keepState={true}>
102104
<InputGroup labelWidth={150}>
103105
<ListBoxInputField initialState= {{
@@ -131,26 +133,23 @@ export const LCPFOPanel = () => {
131133
label='Step Size:'
132134
/>
133135
<br/>
136+
<button type='button' className='button std hl' onClick={(request) => onSearchSubmit(request)}>
137+
<b>Period Finding</b>
138+
</button>
139+
<button type='button' className='button std hl' onClick={() => resetDefaults()}>
140+
<b>Reset</b>
141+
</button>
134142

135143
</InputGroup>
136144
</FieldGroup>
137145
<br/>
138146

139-
</FormPanel>
147+
140148
</div>
141149

142150
);
143151
};
144152

145-
LCPFOPanel.propTypes = {
146-
name: PropTypes.oneOf(['LCPFO'])
147-
};
148-
149-
LCPFOPanel.defaultProps = {
150-
name: 'LCPFO',
151-
};
152-
153-
154153
/**
155154
*
156155
* @param {object} inFields
@@ -225,4 +224,7 @@ function doPeriodFinding(request) {
225224
}
226225
}
227226

227+
function resetDefaults() {
228+
dispatchRestoreDefaults(gkey);
228229

230+
}

src/firefly/js/ui/FitsDownloadDialog.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function FitsDownloadDialogForm() {
287287
</td>
288288
<td>
289289
<div style={{ textAlign:'center', marginBottom: 20}}>
290-
<HelpIcon helpId={'visualization.fitsViewer'} />
290+
<HelpIcon helpId={'visualization.imageoptions'} />
291291
</div>
292292
</td>
293293
</tr>
@@ -489,7 +489,7 @@ function makeTitleFileName(plot, band) {
489489
* After the str is spitted to an array, reconnect the array to a string
490490
* using '-'.
491491
*
492-
* @param str: input string
492+
* @param str input string
493493
* @returns {T} a string by replace ':' and white spaces by '-' in the input str.
494494
*/
495495
function getHyphenatedName(str){

src/firefly/js/visualize/ui/ImageSelectPanel.jsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,26 @@ class ImageSelectionView extends Component {
446446
text={'Load'} />
447447
</div>
448448
<div className={'padding'}>
449-
<HelpIcon helpId={helpId}/>
449+
<HelpIcon helpId={'visualizationCST'}/>
450450
</div>
451451
</div>);
452452
}
453453
};
454454

455-
var helpId = 'basics.catalog';
455+
var helpId = 'basics.searching';
456+
457+
var panelHelpIcon = () => {
458+
if (!this.props.loadButton) {
459+
return (
460+
<div style={{display:'flex', flexDirection:'column', alignItems:'flex-end'}}>
461+
<HelpIcon helpId={helpId}/>
462+
</div>
463+
464+
);
465+
} else {
466+
return <div></div>;
467+
}
468+
};
456469

457470
/*
458471
* top: target panel
@@ -475,9 +488,7 @@ class ImageSelectionView extends Component {
475488
</div>
476489
{ loadButtonArea() }
477490
</div>
478-
<div style={{display:'flex', flexDirection:'column', alignItems:'flex-end'}}>
479-
<HelpIcon helpId={'basics.searching'}/>
480-
</div>
491+
{ panelHelpIcon() }
481492
</FieldGroup>
482493
);
483494
}
@@ -504,6 +515,8 @@ ImageSelectionView.defaultProps={
504515
*
505516
* @returns {XML}
506517
* @constructor
518+
* @param plotMode
519+
* @param displayEntry
507520
*/
508521
function TargetPanelSetView({plotMode, displayEntry}) {
509522

src/firefly/js/visualize/ui/VisToolbarView.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,12 @@ const tipStyle= {
9090
};
9191

9292

93-
94-
9593
/**
9694
* Vis Toolbar
9795
* @param visRoot visualization store root
9896
* @param toolTip tool tip to show
9997
* @param dlCount drawing layer count
100-
* @param messageUnder put the help message under
98+
* @param messageUnder put the help message under
10199
* @return {XML}
102100
*/
103101
export function VisToolbarViewWrapper({visRoot,toolTip,dlCount, messageUnder}) {
@@ -338,7 +336,7 @@ export class VisToolbarView extends Component {
338336

339337
<div style={{display:'inline-block', height:'100%', flex:'0 0 auto', marginLeft:'10px'}}>
340338
<HelpIcon
341-
helpId={'visualization.fitsViewer'}/>
339+
helpId={'visualization.imageoptions'}/>
342340
</div>
343341

344342
</div>

0 commit comments

Comments
 (0)