Change order and wording snapshot actions (#7677)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Joakim Sørensen 2020-11-23 17:08:10 +01:00 committed by GitHub
parent 4dcc0bb66c
commit 7f089c309f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,7 @@ class HassioSnapshotDialog extends LitElement {
return html``; return html``;
} }
return html` return html`
<ha-dialog open stacked @closing=${this._closeDialog} .heading=${true}> <ha-dialog open @closing=${this._closeDialog} .heading=${true}>
<div slot="heading"> <div slot="heading">
<ha-header-bar> <ha-header-bar>
<span slot="title"> <span slot="title">
@ -191,47 +191,37 @@ class HassioSnapshotDialog extends LitElement {
: ""} : ""}
${this._error ? html` <p class="error">Error: ${this._error}</p> ` : ""} ${this._error ? html` <p class="error">Error: ${this._error}</p> ` : ""}
<div>Actions:</div> <div class="button-row" slot="primaryAction">
${!this._onboarding <mwc-button @click=${this._partialRestoreClicked}>
? html`<mwc-button
@click=${this._downloadClicked}
slot="primaryAction"
>
<ha-svg-icon .path=${mdiDownload} class="icon"></ha-svg-icon>
Download Snapshot
</mwc-button>`
: ""}
<mwc-button
@click=${this._partialRestoreClicked}
slot="secondaryAction"
>
<ha-svg-icon .path=${mdiHistory} class="icon"></ha-svg-icon> <ha-svg-icon .path=${mdiHistory} class="icon"></ha-svg-icon>
Restore Selected Restore Selected
</mwc-button> </mwc-button>
${!this._onboarding
? html`
<mwc-button @click=${this._deleteClicked}>
<ha-svg-icon .path=${mdiDelete} class="icon warning">
</ha-svg-icon>
<span class="warning">Delete Snapshot</span>
</mwc-button>
`
: ""}
</div>
<div class="button-row" slot="secondaryAction">
${this._snapshot.type === "full" ${this._snapshot.type === "full"
? html` ? html`
<mwc-button <mwc-button @click=${this._fullRestoreClicked}>
@click=${this._fullRestoreClicked}
slot="secondaryAction"
>
<ha-svg-icon .path=${mdiHistory} class="icon"></ha-svg-icon> <ha-svg-icon .path=${mdiHistory} class="icon"></ha-svg-icon>
Wipe &amp; restore Restore Everything
</mwc-button> </mwc-button>
` `
: ""} : ""}
${!this._onboarding ${!this._onboarding
? html`<mwc-button ? html`<mwc-button @click=${this._downloadClicked}>
@click=${this._deleteClicked} <ha-svg-icon .path=${mdiDownload} class="icon"></ha-svg-icon>
slot="secondaryAction" Download Snapshot
>
<ha-svg-icon
.path=${mdiDelete}
class="icon warning"
></ha-svg-icon>
<span class="warning">Delete Snapshot</span>
</mwc-button>` </mwc-button>`
: ""} : ""}
</div>
</ha-dialog> </ha-dialog>
`; `;
} }
@ -245,6 +235,14 @@ class HassioSnapshotDialog extends LitElement {
display: block; display: block;
margin: 4px; margin: 4px;
} }
mwc-button ha-svg-icon {
margin-right: 4px;
}
.button-row {
display: grid;
gap: 8px;
margin-right: 8px;
}
.details { .details {
color: var(--secondary-text-color); color: var(--secondary-text-color);
} }
@ -252,10 +250,6 @@ class HassioSnapshotDialog extends LitElement {
.error { .error {
color: var(--error-color); color: var(--error-color);
} }
.buttons {
display: flex;
flex-direction: column;
}
.buttons li { .buttons li {
list-style-type: none; list-style-type: none;
} }