Skip to content

Commit 15ac3b5

Browse files
committed
IRSA-4722: Fixed data products viewer three color hide issue
1 parent e3dece4 commit 15ac3b5

File tree

3 files changed

+51
-22
lines changed

3 files changed

+51
-22
lines changed

docs/release-notes.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99

1010
## Version 2022.2
11+
- 2022.2.1 (April 2022)
12+
- docker tag: `latest`, `2022.2`, `2022.2.1`
1113
- 2022.2 - (July 2022)
12-
- docker tag: `latest`, `2022.2`, `2022.2.0`
14+
- docker tag: `2022.2.0`
1315

1416
### _Notes_
1517
#### This release has notable UI, Infrastructure, and API enhancements
@@ -34,6 +36,16 @@
3436
- Fixed: WAVE_TAB: The algorithm is producing incorrect results [Firefly-989](https://github.com/Caltech-IPAC/firefly/pull/1224)
3537
- Multiple table related bugs
3638

39+
40+
##### _Patches 2022.2_
41+
- 2022.2.1
42+
- Added IPAC Logo to version dialog([Firefly-1037](https://github.com/Caltech-IPAC/firefly/pull/1225))
43+
- Stretch dropdown shows checkbox if stretch selected ([Firefly-1029](https://github.com/Caltech-IPAC/firefly/pull/1225))
44+
- Fixed: TAP column table showing filters ([PR](https://github.com/Caltech-IPAC/firefly/pull/1244))
45+
- Fixed: Cube planes all change stretch ([Firefly-1038](https://github.com/Caltech-IPAC/firefly/pull/1225))
46+
47+
48+
3749
##### _Pull Requests in this release_
3850
- [All Bug Fixes](https://github.com/caltech-ipac/firefly/pulls?q=is%3apr+milestone%3a2022.2+label%3abug)
3951
- [All PRs](https://github.com/caltech-ipac/firefly/pulls?q=is%3apr++milestone%3a2022.2+)
@@ -77,6 +89,7 @@
7789
##### _Patches 2022.1_
7890
- 2022.1.1
7991
- Fixed: Not packaging proprietary data correctly ([IRSA-4570,IRSA-4571](https://github.com/Caltech-IPAC/firefly/pull/1209))
92+
8093

8194

8295
## Version 2021.4 (December 2021)

src/firefly/js/metaConvert/ImageDataProductsUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function replotImageDataProducts(activePlotId, imageViewerId, tbl_id, reqAry, th
237237
dispatchPlotImage(
238238
{
239239
plotId:threeCPlotId, viewerId:imageViewerId, wpRequest:plotThreeReqAry, threeColor:true,
240-
pvOptions: {userCanDeletePlots: true, menuItemKeys:{imageSelect : false}},
240+
pvOptions: {userCanDeletePlots: false, menuItemKeys:{imageSelect : false}},
241241
attributes: { tbl_id }
242242
});
243243
}

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

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import {InputGroup} from '../../ui/InputGroup.jsx';
1111
import {ListBoxInputField} from '../../ui/ListBoxInputField.jsx';
1212
import DialogRootContainer from '../../ui/DialogRootContainer.jsx';
1313
import {PopupPanel} from '../../ui/PopupPanel.jsx';
14-
import {showInfoPopup} from '../../ui/PopupUtil.jsx';
14+
import {INFO_POPUP, showInfoPopup} from '../../ui/PopupUtil.jsx';
1515
import {getMultiViewRoot,dispatchUpdateCustom, getViewer} from '../MultiViewCntlr.js';
16-
import {dispatchShowDialog, dispatchHideDialog} from '../../core/ComponentCntlr.js';
16+
import {dispatchShowDialog, dispatchHideDialog, isDialogVisible} from '../../core/ComponentCntlr.js';
1717
import {Band, allBandAry} from '../Band.js';
1818

1919

@@ -38,35 +38,46 @@ function ColorBandChooserPanel ({viewerId, bandData, dataId}) {
3838
const options= Object.keys(threeOp).map( (k) => ({value:k, label:threeOp[k].title}));
3939
options.push({value:'NONE', label:'Disable'});
4040

41-
var redVal= Object.keys(threeOp).find( (k) => Boolean(threeOp[k].color===Band.RED));
42-
var greenVal= Object.keys(threeOp).find( (k) => Boolean(threeOp[k].color===Band.GREEN));
43-
var blueVal= Object.keys(threeOp).find( (k) => Boolean(threeOp[k].color===Band.BLUE));
41+
const {threeColorVisible}= getViewer(getMultiViewRoot(), viewerId)?.customData[dataId];
42+
43+
let redVal= Object.keys(threeOp).find( (k) => Boolean(threeOp[k].color===Band.RED));
44+
let greenVal= Object.keys(threeOp).find( (k) => Boolean(threeOp[k].color===Band.GREEN));
45+
let blueVal= Object.keys(threeOp).find( (k) => Boolean(threeOp[k].color===Band.BLUE));
4446
if (!redVal) redVal= 'NONE';
4547
if (!greenVal) greenVal= 'NONE';
4648
if (!blueVal) blueVal= 'NONE';
4749

4850
return (
49-
<FieldGroup groupKey={'WHICH_BANDS'} keepState={false}>
50-
<div style={{padding:'10px 10px 5px 15px'}}>
51-
<InputGroup labelWidth={50}>
52-
<ListBoxInputField initialState= {{ value: redVal,
53-
tooltip: 'Select Red band', label : 'Red:' }}
51+
<FieldGroup groupKey={'WHICH_BANDS'} keepState={false} style={{display:'flex', flexDirection:'column', alignItems:'center' }}>
52+
<div style={{padding:'10px 5px 5px 5px'}}>
53+
<div style={{display:'flex', flexDirection:'column', justifyContent:'space-around', height:60}}>
54+
<ListBoxInputField labelWidth={40}
55+
initialState= {{ value: redVal, tooltip: 'Select Red band', label : 'Red:' }}
5456
options={options} fieldKey={Band.RED.key} />
5557

56-
<ListBoxInputField initialState= {{value: greenVal,
57-
tooltip: 'Select Green band', label : 'Green:' }}
58+
<ListBoxInputField labelWidth={40}
59+
initialState= {{value: greenVal, tooltip: 'Select Green band', label : 'Green:' }}
5860
options={options} fieldKey={Band.GREEN.key} />
5961

60-
<ListBoxInputField initialState= {{value: blueVal,
61-
tooltip: 'Select Blue band', label : 'Blue:' }}
62+
<ListBoxInputField labelWidth={40}
63+
initialState= {{value: blueVal, tooltip: 'Select Blue band', label : 'Blue:' }}
6264
options={options} fieldKey={Band.BLUE.key} />
63-
</InputGroup>
65+
66+
</div>
67+
</div>
68+
<div style={{display:'flex', justifyContent:'space-around', margin: '7px 5px 10px 3px' }}>
69+
<CompleteButton
70+
style={{padding : '12px 0 5px 5px'}}
71+
text={`${threeColorVisible?'Update':'Show'} Three Color`}
72+
onSuccess={(request) => update3Color(request,bandData, viewerId, dataId)}
73+
closeOnValid={true}
74+
dialogId='ColorBandChooserPopup' />
75+
76+
{threeColorVisible && <CompleteButton
77+
style={{padding : '12px 0 5px 5px'}} text={'Hide Three Color'}
78+
onSuccess={(request) => hideThreeColor(viewerId, dataId)}
79+
closeOnValid={true} dialogId='ColorBandChooserPopup' />}
6480
</div>
65-
<CompleteButton
66-
style={{padding : '12px 0 5px 5px'}}
67-
onSuccess={(request) => update3Color(request,bandData, viewerId, dataId)}
68-
closeOnValid={false}
69-
dialogId='ColorBandChooserPopup' />
7081

7182
</FieldGroup>
7283
);
@@ -110,6 +121,11 @@ function validate(request) {
110121
return {valid:true};
111122
}
112123

124+
function hideThreeColor(viewerId, dataId) {
125+
const v= getViewer(getMultiViewRoot(), viewerId);
126+
dispatchUpdateCustom(viewerId,{...v.customData, [dataId]:{...v.customData[dataId], threeColorVisible:false}});
127+
}
128+
113129

114130
function loadThreeColor(request, bandData, viewerId, dataId) {
115131
const v= getViewer(getMultiViewRoot(), viewerId);

0 commit comments

Comments
 (0)