Skip to content

Commit

Permalink
feat(report): change gain jump question to look at flagged feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ljgray committed Nov 22, 2023
1 parent f62fd0d commit be18114
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
18 changes: 10 additions & 8 deletions src/payloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,20 +440,22 @@ module.exports = {
// Gains
{
type: 'input',
block_id: 'gains_block',
block_id: 'jumps_block',
element: {
type: 'checkboxes',
action_id: 'gains_ok',
action_id: 'jumps_ok',
options: [
{
text: {
type: 'plain_text',
text: 'There have been no gain jumps during my shift',
text: 'Autocorrelation jumps have all been flagged.',
},
description: {
type: 'mrkdwn',
text: '<https://grafana.chimenet.ca/d/d_OJtTBmk/' +
'data-integrity>',
text: 'Locate any channels here: <https://theremin.chimenet.ca/graphs/jumps> ' +

Check failure on line 455 in src/payloads.js

View workflow job for this annotation

GitHub Actions / install and lint

This line has a length of 100. Maximum allowed is 80
'which have more than ~10 jumps in the past few days. Check ' +

Check failure on line 456 in src/payloads.js

View workflow job for this annotation

GitHub Actions / install and lint

This line has a length of 85. Maximum allowed is 80
'here: <https://grafana.chimenet.ca/d/v_R89dSiz/correlator-input-info> ' +

Check failure on line 457 in src/payloads.js

View workflow job for this annotation

GitHub Actions / install and lint

This line has a length of 96. Maximum allowed is 80
' to ensure that these channels are being flagged.'

Check failure on line 458 in src/payloads.js

View workflow job for this annotation

GitHub Actions / install and lint

Missing trailing comma
},
value: 'ok',
},
Expand All @@ -462,18 +464,18 @@ module.exports = {
optional: true,
label: {
type: 'plain_text',
text: 'Gain jumps',
text: 'Autocorrelation jumps',
},
},
{
block_id: 'gains_note_block',
block_id: 'jumps_note_block',
type: 'input',
label: {
type: 'plain_text',
text: 'Note:',
},
element: {
action_id: 'gains_note',
action_id: 'jumps_note',
type: 'plain_text_input',
multiline: true,
placeholder: {
Expand Down
16 changes: 8 additions & 8 deletions src/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ const sendConfirmation = async(report) => {
text += report.sensitivity_note ?
`Note: ${report.sensitivity_note}\n\n` : '\n';

text += report.gains_ok ? report.gains_note ? 'Gain jumps ' : '' :
'There have been gain jumps.\n';
text += report.gains_note ? `Note: ${report.gains_note}\n\n` :
report.gains_ok ? '' : '\n';
text += report.jumps_ok ? report.jumps_note ? 'Autocorrelation jumps ' : '' :
'There have been unflagged autocorrelation jumps.\n';
text += report.jumps_note ? `Note: ${report.jumps_note}\n\n` :
report.jumps_ok ? '' : '\n';

// text += report.transit_flux ? `Latest source flux:
// ${report.transit_flux}\n` :
Expand Down Expand Up @@ -93,7 +93,7 @@ const create = async(userId, view) => {
values.system_health_block.system_health_ok.selected_options;
let alerts_selection = values.alerts_block.alerts_ok.selected_options;
let ringmap_selection = values.ringmap_block.ringmap_ok.selected_options;
let gains_selection = values.gains_block.gains_ok.selected_options;
let jumps_selection = values.jumps_block.jumps_ok.selected_options;

await sendConfirmation({
user_id: userId,
Expand All @@ -117,9 +117,9 @@ const create = async(userId, view) => {
sensitivity_ew: values.sensitivity_ew_block.sensitivity.value,
sensitivity_ns: values.sensitivity_ns_block.sensitivity.value,
sensitivity_note: values.sensitivity_note_block.sensitivity_note.value,
gains_ok: (gains_selection !== undefined
&& gains_selection.length === 1),
gains_note: values.gains_note_block.gains_note.value,
jumps_ok: (jumps_selection !== undefined
&& jumps_selection.length === 1),
jumps_note: values.jumps_note_block.jumps_note.value,
// transit_flux: values.transit_block.transit_flux.value,
// transit_flux_note: values.transit_note_block.transit_note.value,
ringmap_ok: (ringmap_selection !== undefined
Expand Down

0 comments on commit be18114

Please sign in to comment.