Fix typos

This commit is contained in:
Rebecca Scott 2021-05-13 11:00:49 +10:00
parent c7f41f709f
commit 79c5f1c64a
5 changed files with 18 additions and 18 deletions

View File

@ -29,7 +29,7 @@ function Options( {
const deleteOptionByName = ( optionName ) => { const deleteOptionByName = ( optionName ) => {
// eslint-disable-next-line no-alert // eslint-disable-next-line no-alert
if ( confirm( 'Are you sure you want to delete?' ) ) { if ( confirm( 'Are you sure you want to delete this option?' ) ) {
deleteOption( optionName ); deleteOption( optionName );
} }
}; };
@ -149,14 +149,14 @@ function Options( {
className="screen-reader-text" className="screen-reader-text"
htmlFor="post-search-input" htmlFor="post-search-input"
> >
Search products: Search options:
</label> </label>
<input type="search" name="search" /> <input type="search" name="search" />
<input <input
type="submit" type="submit"
id="search-submit" id="search-submit"
className="button" className="button"
value="Search Option" value="Search options"
/> />
</div> </div>
</form> </form>

View File

@ -3,7 +3,7 @@
## Adding a New Command ## Adding a New Command
1. Open `commands.js` and add a new object with command, description, and action keys. Action value must be a valid function name. 1. Open `commands.js` and add a new object with command, description, and action keys. Action value must be a valid function name.
2. Open `data/actions.js` and add a function. The function name must be the value of `Action` from step the first step. 2. Open `data/actions.js` and add a function. The function name must be the value of `Action` from the first step.
Sample function: Sample function:
``` ```

View File

@ -18,7 +18,7 @@ export default [
action: 'resetJetpackConnection', action: 'resetJetpackConnection',
}, },
{ {
command: 'Enable wc-admin* Tracking', command: 'Enable wc-admin Tracking',
description: description:
'Enable Tracking Debug mode. You should change your console level to verbose.', 'Enable Tracking Debug mode. You should change your console level to verbose.',
action: 'enableTrackingDebug', action: 'enableTrackingDebug',

View File

@ -31,7 +31,7 @@ export function addMessage( source, message ) {
}; };
} }
export function updateMssage( source, message, status ) { export function updateMessage( source, message, status ) {
return { return {
type: TYPES.ADD_MESSAGE, type: TYPES.ADD_MESSAGE,
source, source,
@ -47,16 +47,16 @@ export function removeMessage( source ) {
}; };
} }
function* runCommand( id, func ) { function* runCommand( commandName, func ) {
try { try {
yield addCurrentlyRunning( id ); yield addCurrentlyRunning( commandName );
yield addMessage( id, 'Executing...' ); yield addMessage( commandName, 'Executing...' );
yield func(); yield func();
yield removeCurrentlyRunning( id ); yield removeCurrentlyRunning( commandName );
yield updateMssage( id, 'Successful!' ); yield updateMessage( commandName, 'Successful!' );
} catch ( e ) { } catch ( e ) {
yield updateMssage( id, e.message, 'error' ); yield updateMessage( commandName, e.message, 'error' );
yield removeCurrentlyRunning( id ); yield removeCurrentlyRunning( commandName );
} }
} }
@ -93,13 +93,13 @@ export function* resetJetpackConnection() {
} }
export function* enableTrackingDebug() { export function* enableTrackingDebug() {
yield runCommand( 'Enable WC Admin Tracking Deubg Mode', function* () { yield runCommand( 'Enable WC Admin Tracking Debug Mode', function* () {
window.localStorage.setItem( 'debug', 'wc-admin:*' ); window.localStorage.setItem( 'debug', 'wc-admin:*' );
} ); } );
} }
export function* updateStoreAge() { export function* updateStoreAge() {
yield runCommand( 'Update Instllation timestamp', function* () { yield runCommand( 'Update Installation timestamp', function* () {
const today = new Date(); const today = new Date();
const dd = String( today.getDate() ).padStart( 2, '0' ); const dd = String( today.getDate() ).padStart( 2, '0' );
const mm = String( today.getMonth() + 1 ).padStart( 2, '0' ); //January is 0! const mm = String( today.getMonth() + 1 ).padStart( 2, '0' ); //January is 0!
@ -107,14 +107,14 @@ export function* updateStoreAge() {
// eslint-disable-next-line no-alert // eslint-disable-next-line no-alert
const numberOfDays = window.prompt( const numberOfDays = window.prompt(
'Please enter a date in mm/dd/yyy format', 'Please enter a date in yyyy/mm/dd format',
mm + '/' + dd + '/' + yyyy yyyy + '/' + mm + '/' + dd
); );
if ( numberOfDays !== null ) { if ( numberOfDays !== null ) {
const dates = numberOfDays.split( '/' ); const dates = numberOfDays.split( '/' );
const newTimestamp = Math.round( const newTimestamp = Math.round(
new Date( dates[ 2 ], dates[ 0 ] - 1, dates[ 1 ] ).getTime() / new Date( dates[ 0 ], dates[ 1 ] - 1, dates[ 2 ] ).getTime() /
1000 1000
); );
const payload = { const payload = {