Skip to content

Commit ba39698

Browse files
[O2B-1158] Improve readability of on-call log (#1408)
* [O2B-1158] Improve readability of on-call log * Fix typo
1 parent 1327653 commit ba39698

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

lib/public/views/Logs/Create/OnCallLogTemplate.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,17 @@ export class OnCallLogTemplate extends Observable {
116116
* @return {string} the log text
117117
*/
118118
get text() {
119-
const textParts = [`TITLE: ${this.title}`];
120-
let importancePart = `IMPORTANCE: ${this.formData.severity}`;
119+
const textParts = [];
120+
let importancePart = `## Importance\n${this.formData.severity}`;
121121
if (this.formData.scope) {
122122
importancePart = `${importancePart} for ${this.formData.scope}`;
123123
}
124124
textParts.push(importancePart);
125-
textParts.push(`SHIFTER: ${this.formData.shifterName} - ${this.formData.shifterPosition}`);
126-
textParts.push(`LHC BEAM MODE: ${this.formData.lhcBeamMode}`);
127-
textParts.push(`DESCRIPTION:\n${this.formData.issueDescription}`);
128-
textParts.push(`REASON TO CALL THIS ON-CALL:\n${this.formData.reason}`);
129-
textParts.push(`ACTIONS ALREADY TAKEN:\n${this.formData.alreadyTakenActions}`);
125+
textParts.push(`## Shifter\n${this.formData.shifterName} - ${this.formData.shifterPosition}`);
126+
textParts.push(`## LHC beam mode\n${this.formData.lhcBeamMode}`);
127+
textParts.push(`## Description\n${this.formData.issueDescription}`);
128+
textParts.push(`## Reason to call this on-call\n${this.formData.reason}`);
129+
textParts.push(`## Actions already taken\n${this.formData.alreadyTakenActions}`);
130130

131131
return textParts.join('\n\n');
132132
}

lib/public/views/Logs/Create/onCallLogCreationConfiguration.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,18 @@ export const onCallLogCreationConfiguration = (creationModel, template) => {
3333
return {
3434
mainPane: [
3535
h(PanelComponent, [
36-
h(LabelPanelHeaderComponent, { required: true }, 'Short description'),
36+
h(LabelPanelHeaderComponent, { required: true, for: 'shortDescription' }, 'Short description'),
3737
h('input#shortDescription.form-control', {
3838
placeholder: 'Enter a short description of the issue',
3939
minlength: 4,
4040
maxlength: 30,
4141
value: template.formData.shortDescription,
4242
oninput: (e) => template.patchFormData({ shortDescription: e.target.value }),
43-
autofocus: true,
4443
}),
4544
]),
4645
h('.flex-row.g3', [
4746
h(PanelComponent, [
48-
h(LabelPanelHeaderComponent, { required: true }, 'Detector or subsystem to be called'),
47+
h(LabelPanelHeaderComponent, { required: true, for: 'detectorOrSubsystem' }, 'Detector or subsystem to be called'),
4948
template.detectorsAndSystems.match({
5049
NotAsked: () => null,
5150
Loading: () => spinner({ size: 2, absolute: false }),
@@ -66,7 +65,7 @@ export const onCallLogCreationConfiguration = (creationModel, template) => {
6665
}),
6766
]),
6867
h(PanelComponent, { class: 'flex-grow' }, [
69-
h(LabelPanelHeaderComponent, { required: true }, 'Severity level of the issue'),
68+
h(LabelPanelHeaderComponent, { required: true, for: 'severity' }, 'Severity level of the issue'),
7069
h(
7170
'select#severity.form-control',
7271
{ onchange: (e) => template.patchFormData({ severity: e.target.value }) },
@@ -81,7 +80,7 @@ export const onCallLogCreationConfiguration = (creationModel, template) => {
8180
),
8281
]),
8382
h(PanelComponent, { class: 'flex-grow' }, [
84-
h(LabelPanelHeaderComponent, { required: true }, 'Scope of the issue'),
83+
h(LabelPanelHeaderComponent, { required: true, for: 'issueScope' }, 'Scope of the issue'),
8584
h(
8685
'select#issueScope.form-control',
8786
{ onchange: (e) => template.patchFormData({ scope: e.target.value }) },
@@ -102,7 +101,7 @@ export const onCallLogCreationConfiguration = (creationModel, template) => {
102101
h('input#shifterName.form-control', { disabled: true, value: template.formData.shifterName }),
103102
]),
104103
h(PanelComponent, { class: 'flex-grow' }, [
105-
h(LabelPanelHeaderComponent, { required: true }, 'Shifter position'),
104+
h(LabelPanelHeaderComponent, { required: true, for: 'shifterPosition' }, 'Shifter position'),
106105
h(
107106
'select#shifterPosition.form-control',
108107
{ onchange: (e) => template.patchFormData({ shifterPosition: e.target.value }) },
@@ -118,7 +117,7 @@ export const onCallLogCreationConfiguration = (creationModel, template) => {
118117
]),
119118
]),
120119
h(PanelComponent, [
121-
h(LabelPanelHeaderComponent, { required: true }, 'LHC Beam mode'),
120+
h(LabelPanelHeaderComponent, { required: true, for: 'lhcBeamMode' }, 'LHC Beam mode'),
122121
h(
123122
'input#lhcBeamMode.form-control',
124123
{
@@ -128,7 +127,7 @@ export const onCallLogCreationConfiguration = (creationModel, template) => {
128127
),
129128
]),
130129
h(PanelComponent, { class: 'flex-column flex-grow' }, [
131-
h(LabelPanelHeaderComponent, { required: true }, 'Description of the issue'),
130+
h(LabelPanelHeaderComponent, { required: true, for: 'issue-description' }, 'Description of the issue'),
132131
markdownInput(
133132
template.formData.issueDescription,
134133
{

test/public/logs/create.test.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,21 +439,22 @@ module.exports = () => {
439439
const lastLog = await getLastLog();
440440
expect(lastLog.title).to.equal(`${shortDescription} - Call on-call for ${detectorOrSubsystem}`);
441441
expect(lastLog.text).to.equal(`\
442-
TITLE: ${shortDescription} - Call on-call for ${detectorOrSubsystem}
442+
## Importance
443+
${severity} for ${issueScope}
443444
444-
IMPORTANCE: ${severity} for ${issueScope}
445+
## Shifter
446+
Anonymous - ${shifterPosition}
445447
446-
SHIFTER: Anonymous - ${shifterPosition}
448+
## LHC beam mode
449+
${beamMode}
447450
448-
LHC BEAM MODE: ${beamMode}
449-
450-
DESCRIPTION:
451+
## Description
451452
${description}
452453
453-
REASON TO CALL THIS ON-CALL:
454+
## Reason to call this on-call
454455
${reason}
455456
456-
ACTIONS ALREADY TAKEN:
457+
## Actions already taken
457458
${actions}\
458459
`);
459460
});

0 commit comments

Comments
 (0)