@@ -15,7 +15,7 @@ import './ActionPanel.scss';
1515
1616type ActionPanelProps = {
1717 focusedOptionName : ?string ,
18- selectedCommandName : ?string ,
18+ selectedActionName : ?string ,
1919 programSequence : ProgramSequence ,
2020 pressedStepIndex : number ,
2121 intl : IntlShape ,
@@ -42,53 +42,53 @@ class ActionPanel extends React.Component<ActionPanelProps, {}> {
4242 stepNumber = cachedCurrentStepLoopData . getContainingLoopPosition ( ) ;
4343 }
4444
45- let stepName = '' ;
45+ let stepActionName = '' ;
4646 if ( currentStep . block === 'startLoop' || currentStep . block === 'endLoop' ) {
47- stepName = this . props . intl . formatMessage (
47+ stepActionName = this . props . intl . formatMessage (
4848 { id : 'Command.loop.label' } ,
4949 { loopLabel : currentStep . label }
5050 ) ;
5151 } else {
52- stepName = this . props . intl . formatMessage (
52+ stepActionName = this . props . intl . formatMessage (
5353 { id : `Command.${ currentStep . block } ` }
5454 ) ;
5555 }
5656
57- const replaceStepAriaLabel = this . props . selectedCommandName != null ?
57+ const replaceStepAriaLabel = this . props . selectedActionName != null ?
5858 this . props . intl . formatMessage (
59- { id :'ActionPanel.action.replace.withAction ' } ,
60- { stepNumber, stepName , selectedCommandName : this . props . intl . formatMessage ( { id : `Command.${ this . props . selectedCommandName } ` } ) }
59+ { id :'ActionPanel.action.replace.withSelectedAction ' } ,
60+ { stepNumber, stepActionName , selectedActionName : this . props . intl . formatMessage ( { id : `Command.${ this . props . selectedActionName } ` } ) }
6161 ) :
62- this . props . intl . formatMessage ( { id :'ActionPanel.action.replace.noAction ' } , { stepNumber, stepName } ) ;
62+ this . props . intl . formatMessage ( { id :'ActionPanel.action.replace.noSelectedAction ' } , { stepNumber, stepActionName } ) ;
6363
6464 return {
6565 replaceStepAriaLabel,
66- 'deleteStepAriaLabel' : this . props . intl . formatMessage ( { id :'ActionPanel.action.delete' } , { stepNumber, stepName } ) ,
67- 'previousStepAriaLabel' : this . makePreviousStepAriaLabel ( stepNumber , stepName ) ,
68- 'nextStepAriaLabel' : this . makeNextStepAriaLabel ( stepNumber , stepName )
66+ 'deleteStepAriaLabel' : this . props . intl . formatMessage ( { id :'ActionPanel.action.delete' } , { stepNumber, stepActionName } ) ,
67+ 'previousStepAriaLabel' : this . makePreviousStepAriaLabel ( stepNumber , stepActionName ) ,
68+ 'nextStepAriaLabel' : this . makeNextStepAriaLabel ( stepNumber , stepActionName )
6969 }
7070 }
7171
72- makePreviousStepAriaLabel ( stepNumber : ?number | string , stepName : string ) : string {
72+ makePreviousStepAriaLabel ( stepNumber : ?number | string , stepActionName : string ) : string {
7373 const currentStep = this . props . programSequence . getProgramStepAt ( this . props . pressedStepIndex ) ;
7474 if ( this . props . pressedStepIndex > 0 ) {
7575 const prevStep = this . props . programSequence . getProgramStepAt ( this . props . pressedStepIndex - 1 ) ;
7676 const cachedPreviousStepLoopData = prevStep . cache ;
7777 // When previous step is startLoop, aria-label communicates that movePrevious will move out of the current loop
7878 if ( prevStep . block === 'startLoop' && currentStep . block !== 'endLoop' ) {
79- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.startLoop ' } ,
79+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.outOfLoop ' } ,
8080 {
8181 stepNumber,
82- stepName ,
82+ stepActionName ,
8383 loopLabel : prevStep . label
8484 }
8585 ) ;
8686 // When previous step is endLoop, aria-label communicates that movePrevious will move into a loop
8787 } else if ( prevStep . block === 'endLoop' ) {
88- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.endLoop ' } ,
88+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.intoLoop ' } ,
8989 {
9090 stepNumber,
91- stepName ,
91+ stepActionName ,
9292 loopLabel : prevStep . label
9393 }
9494 ) ;
@@ -99,67 +99,67 @@ class ActionPanel extends React.Component<ActionPanelProps, {}> {
9999 const startLoopIndex = this . props . programSequence . getMatchingLoopBlockIndex ( this . props . pressedStepIndex ) ;
100100 const program = this . props . programSequence . getProgram ( ) ;
101101 if ( startLoopIndex != null && program [ startLoopIndex - 1 ] != null ) {
102- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.command ' } ,
102+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep' } ,
103103 {
104104 stepNumber,
105- stepName ,
105+ stepActionName ,
106106 previousStepNumber : startLoopIndex ,
107- command : this . props . intl . formatMessage ( { id : `Command.${ program [ startLoopIndex - 1 ] . block } ` } ) ,
107+ previousStepActionName : this . props . intl . formatMessage ( { id : `Command.${ program [ startLoopIndex - 1 ] . block } ` } ) ,
108108 }
109109 )
110110 }
111111 // When previous step is wrapped in a loop, aria-label communicates position within a loop
112112 } else if ( cachedPreviousStepLoopData != null ) {
113- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.inLoop ' } ,
113+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.withInLoop ' } ,
114114 {
115115 stepNumber,
116- stepName ,
116+ stepActionName ,
117117 previousStepNumber : cachedPreviousStepLoopData . getContainingLoopPosition ( ) ,
118- command : this . props . intl . formatMessage ( { id : `Command.${ prevStep . block } ` } ) ,
118+ previousStepActionName : this . props . intl . formatMessage ( { id : `Command.${ prevStep . block } ` } ) ,
119119 loopLabel : cachedPreviousStepLoopData . getContainingLoopLabel ( ) ,
120120 }
121121 )
122122 // When previous step is a movements step and not in a loop, aria-label communicates position within the program
123123 } else {
124- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.command ' } ,
124+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep' } ,
125125 {
126126 stepNumber,
127- stepName ,
127+ stepActionName ,
128128 previousStepNumber : this . props . pressedStepIndex ,
129- command : this . props . intl . formatMessage ( { id : `Command.${ prevStep . block } ` } )
129+ previousStepActionName : this . props . intl . formatMessage ( { id : `Command.${ prevStep . block } ` } )
130130 }
131131 ) ;
132132 }
133133 }
134134 }
135- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep' } ,
135+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToPreviousStep.disabled ' } ,
136136 {
137137 stepNumber,
138- stepName
138+ stepActionName
139139 }
140140 ) ;
141141 }
142142
143- makeNextStepAriaLabel ( stepNumber : ?number | string , stepName : string ) : string {
143+ makeNextStepAriaLabel ( stepNumber : ?number | string , stepActionName : string ) : string {
144144 const currentStep = this . props . programSequence . getProgramStepAt ( this . props . pressedStepIndex ) ;
145145 if ( this . props . pressedStepIndex < ( this . props . programSequence . getProgramLength ( ) - 1 ) ) {
146146 const nextStep = this . props . programSequence . getProgramStepAt ( this . props . pressedStepIndex + 1 ) ;
147147 const cachedNextStepLoopData = nextStep . cache ;
148148 // When next step is startLoop, aria-label communicates that moveNext will move into a loop
149149 if ( nextStep . block === 'startLoop' ) {
150- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.startLoop ' } ,
150+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.intoLoop ' } ,
151151 {
152152 stepNumber,
153- stepName ,
153+ stepActionName ,
154154 loopLabel : nextStep . label
155155 }
156156 ) ;
157157 // When next step is endLoop, aria-label communicates that moveNext will move out of the current loop
158158 } else if ( nextStep . block === 'endLoop' && currentStep . block !== 'startLoop' ) {
159- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.endLoop ' } ,
159+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.outOfLoop ' } ,
160160 {
161161 stepNumber,
162- stepName ,
162+ stepActionName ,
163163 loopLabel : nextStep . label
164164 }
165165 ) ;
@@ -170,43 +170,43 @@ class ActionPanel extends React.Component<ActionPanelProps, {}> {
170170 const endLoopIndex = this . props . programSequence . getMatchingLoopBlockIndex ( this . props . pressedStepIndex ) ;
171171 const program = this . props . programSequence . getProgram ( ) ;
172172 if ( endLoopIndex != null && program [ endLoopIndex + 1 ] != null ) {
173- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.command ' } ,
173+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep' } ,
174174 {
175175 stepNumber,
176- stepName ,
176+ stepActionName ,
177177 nextStepNumber : endLoopIndex + 2 ,
178- command : this . props . intl . formatMessage ( { id : `Command.${ program [ endLoopIndex + 1 ] . block } ` } ) ,
178+ nextStepActionName : this . props . intl . formatMessage ( { id : `Command.${ program [ endLoopIndex + 1 ] . block } ` } ) ,
179179 }
180180 ) ;
181181 }
182182 // When next step is wrapped in a loop, aria-label communicates position within a loop
183183 } else if ( cachedNextStepLoopData != null ) {
184- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.inLoop ' } ,
184+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.withInLoop ' } ,
185185 {
186186 stepNumber,
187- stepName ,
187+ stepActionName ,
188188 nextStepNumber : cachedNextStepLoopData . getContainingLoopPosition ( ) ,
189- command : this . props . intl . formatMessage ( { id : `Command.${ nextStep . block } ` } ) ,
189+ nextStepActionName : this . props . intl . formatMessage ( { id : `Command.${ nextStep . block } ` } ) ,
190190 loopLabel : cachedNextStepLoopData . getContainingLoopLabel ( )
191191 }
192192 ) ;
193193 // When next step is a movements step and not in a loop, aria-label communicates position within the program
194194 } else {
195- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.command ' } ,
195+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep' } ,
196196 {
197197 stepNumber,
198- stepName ,
198+ stepActionName ,
199199 nextStepNumber : this . props . pressedStepIndex + 2 ,
200- command : this . props . intl . formatMessage ( { id : `Command.${ nextStep . block } ` } )
200+ nextStepActionName : this . props . intl . formatMessage ( { id : `Command.${ nextStep . block } ` } )
201201 }
202202 ) ;
203203 }
204204 }
205205 }
206- return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep' } ,
206+ return this . props . intl . formatMessage ( { id : 'ActionPanel.action.moveToNextStep.disabled ' } ,
207207 {
208208 stepNumber,
209- stepName
209+ stepActionName
210210 }
211211 ) ;
212212 }
@@ -238,7 +238,7 @@ class ActionPanel extends React.Component<ActionPanelProps, {}> {
238238 const moveToNextStepIsDisabled = this . props . programSequence . moveToNextStepDisabled ( this . props . pressedStepIndex ) ;
239239 const moveToPreviousStepIsDisabled = this . props . programSequence . moveToPreviousStepDisabled ( this . props . pressedStepIndex ) ;
240240 const replaceIsVisible = this . getReplaceIsVisible ( ) ;
241- const replaceIsDisabled = this . props . selectedCommandName == null ;
241+ const replaceIsDisabled = this . props . selectedActionName == null ;
242242
243243 return (
244244 < React . Fragment >
0 commit comments