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 ) => {
// 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 );
}
};
@ -149,14 +149,14 @@ function Options( {
className="screen-reader-text"
htmlFor="post-search-input"
>
Search products:
Search options:
</label>
<input type="search" name="search" />
<input
type="submit"
id="search-submit"
className="button"
value="Search Option"
value="Search options"
/>
</div>
</form>

View File

@ -3,7 +3,7 @@
## 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.
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:
```

View File

@ -18,7 +18,7 @@ export default [
action: 'resetJetpackConnection',
},
{
command: 'Enable wc-admin* Tracking',
command: 'Enable wc-admin Tracking',
description:
'Enable Tracking Debug mode. You should change your console level to verbose.',
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 {
type: TYPES.ADD_MESSAGE,
source,
@ -47,16 +47,16 @@ export function removeMessage( source ) {
};
}
function* runCommand( id, func ) {
function* runCommand( commandName, func ) {
try {
yield addCurrentlyRunning( id );
yield addMessage( id, 'Executing...' );
yield addCurrentlyRunning( commandName );
yield addMessage( commandName, 'Executing...' );
yield func();
yield removeCurrentlyRunning( id );
yield updateMssage( id, 'Successful!' );
yield removeCurrentlyRunning( commandName );
yield updateMessage( commandName, 'Successful!' );
} catch ( e ) {
yield updateMssage( id, e.message, 'error' );
yield removeCurrentlyRunning( id );
yield updateMessage( commandName, e.message, 'error' );
yield removeCurrentlyRunning( commandName );
}
}
@ -93,13 +93,13 @@ export function* resetJetpackConnection() {
}
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:*' );
} );
}
export function* updateStoreAge() {
yield runCommand( 'Update Instllation timestamp', function* () {
yield runCommand( 'Update Installation timestamp', function* () {
const today = new Date();
const dd = String( today.getDate() ).padStart( 2, '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
const numberOfDays = window.prompt(
'Please enter a date in mm/dd/yyy format',
mm + '/' + dd + '/' + yyyy
'Please enter a date in yyyy/mm/dd format',
yyyy + '/' + mm + '/' + dd
);
if ( numberOfDays !== null ) {
const dates = numberOfDays.split( '/' );
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
);
const payload = {