Skip to content

Commit

Permalink
Standardised saveButtons and reference labels properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-baillie-ortoo committed Jan 11, 2022
1 parent 19322de commit 141f1ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
class="slds-p-around_xxx-small"
data-ortoo-elem-id={cancelButtonId}
variant="default"
name="cancel"
data-name="cancel"
label={cancelLabel}
onclick={handleCancelClick}
></lightning-button>
Expand All @@ -16,8 +14,6 @@
class="slds-p-around_xxx-small"
data-ortoo-elem-id={saveButtonId}
variant="brand"
name="save"
data-name="save"
label={saveLabel}
onclick={handleSaveClick}
></lightning-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { LightningElement, api } from 'lwc';
import configureElementIdGenerator from 'c/elementIdGenerator';

//import CANCEL_LABEL from '@salesforce/label/c.ortoo_core_cancel';
//import SAVE_LABEL from '@salesforce/label/c.ortoo_core_save';

const CANCEL_LABEL = 'Cancel';
const SAVE_LABEL = 'Save';
import CANCEL_LABEL from '@salesforce/label/c.ortoo_core_cancel';
import SAVE_LABEL from '@salesforce/label/c.ortoo_core_save';

/**
* Provides a standard format for save and cancel buttons, as well as the ability to add additional ones into it.
*
* If the 'additional-buttons' slot is used, it should be used with:
* * <span slot="additional-buttons">
* * Buttons that have class="slds-p-around_xxx-small"
*/
export default class SaveButtons extends LightningElement {

@api cancelLabel = CANCEL_LABEL; // should be a label (see above)
@api saveLabel = SAVE_LABEL; // should be a label (see above)
@api cancelLabel = CANCEL_LABEL;
@api saveLabel = SAVE_LABEL;

@api ortooElemIdPrefix = 'savebuttons';

Expand Down

0 comments on commit 141f1ef

Please sign in to comment.