Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(editors/cleanup) Provide appearing/disappearing edit button on hover #747

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions src/editors/cleanup/control-blocks-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ export class CleanupControlBlocks extends LitElement {
><span class="unreferencedControl"
>${controlBlock.getAttribute('name')!}
</span>
<span>
<mwc-icon-button
label="warning"
icon="warning_amber"
class="cautionItem"
title="${translate(
'cleanup.unreferencedControls.addressDefinitionTooltip'
)}"
?disabled="${!(getCommAddress(controlBlock) !== null)}"
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
label="Edit"
Expand All @@ -196,18 +208,6 @@ export class CleanupControlBlocks extends LitElement {
}}
></mwc-icon-button>
</span>
<span>
<mwc-icon-button
label="warning"
icon="warning_amber"
class="cautionItem"
title="${translate(
'cleanup.unreferencedControls.addressDefinitionTooltip'
)}"
?disabled="${!(getCommAddress(controlBlock) !== null)}"
>
</mwc-icon-button>
</span>
<span slot="secondary"
>${controlBlock.tagName} -
${controlBlock.closest('IED')?.getAttribute('name')}
Expand Down Expand Up @@ -352,6 +352,17 @@ export class CleanupControlBlocks extends LitElement {
--mdc-icon-size: 16px;
}

.editItem {
visibility: hidden;
opacity: 0;
}

.cleanupListItem:hover .editItem {
visibility: visible;
opacity: 1;
transition: visibility 0s, opacity 0.5s linear;
}

.cautionItem {
color: var(--yellow);
}
Expand Down
11 changes: 11 additions & 0 deletions src/editors/cleanup/datasets-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ export class CleanupDatasets extends LitElement {
--mdc-icon-size: 16px;
}

.editItem {
visibility: hidden;
opacity: 0;
}

.checkListItem:hover .editItem {
visibility: visible;
opacity: 1;
transition: visibility 0s, opacity 0.5s linear;
}

.cleanupDeleteButton {
float: right;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
<span class="unreferencedControl">
GCB2_NP
</span>
<span>
<mwc-icon-button
class="editItem"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="cautionItem"
Expand All @@ -150,6 +142,14 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="editItem"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
<span slot="secondary">
GSEControl -
IED1
Expand All @@ -174,18 +174,18 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
</span>
<span>
<mwc-icon-button
class="editItem"
icon="edit"
label="Edit"
class="cautionItem"
icon="warning_amber"
label="warning"
title="[cleanup.unreferencedControls.addressDefinitionTooltip]"
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="cautionItem"
icon="warning_amber"
label="warning"
title="[cleanup.unreferencedControls.addressDefinitionTooltip]"
class="editItem"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
Expand Down Expand Up @@ -213,20 +213,20 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
</span>
<span>
<mwc-icon-button
class="editItem"
class="cautionItem"
disabled=""
icon="edit"
label="Edit"
icon="warning_amber"
label="warning"
title="[cleanup.unreferencedControls.addressDefinitionTooltip]"
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="cautionItem"
class="editItem"
disabled=""
icon="warning_amber"
label="warning"
title="[cleanup.unreferencedControls.addressDefinitionTooltip]"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
Expand All @@ -252,14 +252,6 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
<span class="unreferencedControl">
ReportCb
</span>
<span>
<mwc-icon-button
class="editItem"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="cautionItem"
Expand All @@ -270,6 +262,14 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="editItem"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
<span slot="secondary">
ReportControl -
IED2
Expand All @@ -294,18 +294,18 @@ snapshots["Cleanup: Control Blocks Container With a test file loaded looks like
</span>
<span>
<mwc-icon-button
class="editItem"
icon="edit"
label="Edit"
class="cautionItem"
icon="warning_amber"
label="warning"
title="[cleanup.unreferencedControls.addressDefinitionTooltip]"
>
</mwc-icon-button>
</span>
<span>
<mwc-icon-button
class="cautionItem"
icon="warning_amber"
label="warning"
title="[cleanup.unreferencedControls.addressDefinitionTooltip]"
class="editItem"
icon="edit"
label="Edit"
>
</mwc-icon-button>
</span>
Expand Down