Skip to content

Commit

Permalink
fix(wizard-dialog): avoid header overlap with extra action buttons (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobVogelsang authored Apr 26, 2022
1 parent ccad42d commit ffe7859
Show file tree
Hide file tree
Showing 44 changed files with 93 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wizard-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,19 @@ export class WizardDialog extends LitElement {
renderPage(page: WizardPage, index: number): TemplateResult {
const showCodeToggleButton =
page.element && localStorage.getItem('mode') === 'pro';
const extraWidth =
showCodeToggleButton && page.menuActions
? 96
: showCodeToggleButton || page.menuActions
? 48
: 0;

return html`<mwc-dialog
defaultAction="close"
?open=${index === this.pageIndex}
heading=${page.title}
@closed=${this.onClosed}
style="--mdc-dialog-min-width:calc(100% + ${extraWidth}px)"
>
${showCodeToggleButton || page.menuActions
? html`<nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["subnetwork-editor wizarding integration edit/add Subnetwork wizard lo
defaultaction="close"
heading="[wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["DAType wizards defines a createDATypeWizard looks like the latest sna
defaultaction="close"
heading="[datype.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-select
Expand Down Expand Up @@ -618,6 +619,7 @@ snapshots["DAType wizards defines a dATypeWizard looks like the latest snapshot"
defaultaction="close"
heading="[datype.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["DOType wizards defines a createDOTypeWizard looks like the latest sna
defaultaction="close"
heading="[dotype.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-select
Expand Down Expand Up @@ -721,6 +722,7 @@ snapshots["DOType wizards defines a dOTypeWizard looks like the latest snapshot"
defaultaction="close"
heading="[dotype.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -1035,6 +1037,7 @@ snapshots["DOType wizards defines a sDOWizard to edit an existing SDO looks like
defaultaction="close"
heading="[sdo.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -1246,6 +1249,7 @@ snapshots["DOType wizards defines a sDOWizard to create a new SDO element looks
defaultaction="close"
heading="[sdo.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["EnumType wizards defines a createEnumTypeWizard looks like the latest
defaultaction="close"
heading="[enum.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-select
Expand Down Expand Up @@ -1370,6 +1371,7 @@ snapshots["EnumType wizards defines an eNumTypeEditWizard looks like the latest
defaultaction="close"
heading="[enum.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -1529,6 +1531,7 @@ snapshots["EnumType wizards defines a eNumValWizard to edit an existing EnumVal
defaultaction="close"
heading="[enum-val.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -1602,6 +1605,7 @@ snapshots["EnumType wizards defines a eNumValWizard to create a new EnumVal elem
defaultaction="close"
heading="[enum-val.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["LNodeType wizards defines a lNodeTypeHelperWizard looks like the late
defaultaction="close"
heading="[lnodetype.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -167,6 +168,7 @@ snapshots["LNodeType wizards defines a createLNodeTypeWizard looks like the late
defaultaction="close"
heading="[lnodetype.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-select
Expand Down Expand Up @@ -4353,6 +4355,7 @@ snapshots["LNodeType wizards defines a createLNodeTypeWizard opens a createLNode
defaultaction="close"
heading="[lnodetype.wizard.title.select]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-select
Expand Down Expand Up @@ -4687,6 +4690,7 @@ snapshots["LNodeType wizards defines a dOWizard to create a new DO element looks
defaultaction="close"
heading="[do.wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["BDA wizarding editing integration defines a editBDaWizard to edit an
defaultaction="close"
heading="[bda.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -633,6 +634,7 @@ snapshots["BDA wizarding editing integration defines a createBDaWizard to create
defaultaction="close"
heading="[bda.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["DA wizarding editing integration defines a editDaWizard to edit an ex
defaultaction="close"
heading="[da.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down Expand Up @@ -822,6 +823,7 @@ snapshots["DA wizarding editing integration defines a createDaWizard to create a
defaultaction="close"
heading="[da.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["bay-editor wizarding integration looks like the latest snapshot"] =
defaultaction="close"
heading="[bay.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["conducting-equipment-editor wizarding integration looks like the late
defaultaction="close"
heading="[conductingequipment.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["substation-editor wizarding integration looks like the latest snapsho
defaultaction="close"
heading="[substation.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["voltage-level-editor wizarding integration looks like the latest snap
defaultaction="close"
heading="[voltagelevel.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
1 change: 1 addition & 0 deletions test/unit/__snapshots__/wizard-dialog.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["wizard-dialog with user defined menu actions set looks like its snaps
defaultaction="close"
heading="Page 1"
open=""
style="--mdc-dialog-min-width:calc(100% + 48px)"
>
<nav>
<mwc-icon-button icon="more_vert">
Expand Down
4 changes: 4 additions & 0 deletions test/unit/editors/ied/__snapshots__/da-wizard.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["with no ancestors looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.daTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down Expand Up @@ -141,6 +142,7 @@ snapshots["with a DA element looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.daTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down Expand Up @@ -276,6 +278,7 @@ snapshots["with a BDA element looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.daTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down Expand Up @@ -411,6 +414,7 @@ snapshots["with a DA element and DAI Element looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.daTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down
3 changes: 3 additions & 0 deletions test/unit/editors/ied/__snapshots__/do-wizard.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["with no ancestors looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.doTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down Expand Up @@ -108,6 +109,7 @@ snapshots["with a DO element looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.doTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down Expand Up @@ -210,6 +212,7 @@ snapshots["with a DO element and DOI Element looks like the latest snapshot"] =
defaultaction="close"
heading="[iededitor.wizard.doTitle]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-textarea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Wizards for SCL element Bay (X/Y) looks like the latest snapshot"] =
defaultaction="close"
heading="[bay.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Wizards for SCL element Conducting Equipment (X/Y) looks like the lat
defaultaction="close"
heading="[conductingequipment.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Wizards for SCL element Power Transformer (X/Y) looks like the latest
defaultaction="close"
heading="[powertransformer.wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Update method for desc attributes in SEL IEDs working on SCL files co
defaultaction="close"
heading="Add desc"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list multi="">
Expand Down Expand Up @@ -146,6 +147,7 @@ snapshots["Update method for desc attributes in SEL IEDs working on SCL files co
defaultaction="close"
heading="Add desc"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list multi="">
Expand Down
2 changes: 2 additions & 0 deletions test/unit/menu/__snapshots__/UpdateDescritionABB.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Update method for desc attributes in ABB IEDs working on SCL files wi
defaultaction="close"
heading="[wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list multi="">
Expand Down Expand Up @@ -34,6 +35,7 @@ snapshots["Update method for desc attributes in ABB IEDs working on SCL files co
defaultaction="close"
heading="[wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list multi="">
Expand Down
1 change: 1 addition & 0 deletions test/unit/wizards/__snapshots__/abstractda.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["abstractda wizards renderWizard looks like the latest snapshot"] =
defaultaction="close"
heading="title"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<wizard-textfield
Expand Down
1 change: 1 addition & 0 deletions test/unit/wizards/__snapshots__/address.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["address renderGseSmvAddress looks like the latest snapshot"] =
defaultaction="close"
heading="title"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-formfield label="[connectedap.wizard.addschemainsttype]">
Expand Down
2 changes: 2 additions & 0 deletions test/unit/wizards/__snapshots__/clientln.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["clientln wizards createClientLnWizard looks like the latest snapshot"
defaultaction="close"
heading="[commmap.connectToIED]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<div
Expand Down Expand Up @@ -341,6 +342,7 @@ snapshots["clientln wizards selectClientLnWizard looks like the latest snapshot"
defaultaction="close"
heading="IED2>>CBSW> XSWI 2>ReportCb - IED1"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list multi="">
Expand Down
1 change: 1 addition & 0 deletions test/unit/wizards/__snapshots__/commmap.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["communication mapping wizard looks like the latest snapshot"] =
defaultaction="close"
heading="[commmap.title]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Edit wizard for SCL element ConnectedAP include an edit wizard that f
defaultaction="close"
heading="[wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-formfield label="[connectedap.wizard.addschemainsttype]">
Expand Down Expand Up @@ -133,6 +134,7 @@ snapshots["Edit wizard for SCL element ConnectedAP include an edit wizard that f
defaultaction="close"
heading="[wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-formfield label="[connectedap.wizard.addschemainsttype]">
Expand Down Expand Up @@ -308,6 +310,7 @@ snapshots["Edit wizard for SCL element ConnectedAP include an edit wizard that f
defaultaction="close"
heading="[wizard.title.edit]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<mwc-formfield label="[connectedap.wizard.addschemainsttype]">
Expand Down
1 change: 1 addition & 0 deletions test/unit/wizards/__snapshots__/connectedap.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ snapshots["Wizards for SCL element ConnectedAP include a create wizard that look
defaultaction="close"
heading="[wizard.title.add]"
open=""
style="--mdc-dialog-min-width:calc(100% + 0px)"
>
<div id="wizard-content">
<filtered-list
Expand Down
Loading

0 comments on commit ffe7859

Please sign in to comment.