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

Eliminate :contains #665

Merged
merged 4 commits into from
Jul 18, 2024
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
17 changes: 10 additions & 7 deletions src/ostree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,9 @@ const DeploymentActions = ({ deploymentIndex, deploymentIsPinned, isCurrent, isS
const actions = [];
if (!isStaged) {
actions.push(
<DropdownItem key="pin-deployment"
<DropdownItem
data-action={ deploymentIsPinned ? "unpin" : "pin" }
key="pin-deployment"
onClick={() => togglePin()}
>
{deploymentIsPinned ? _("Unpin") : _("Pin")}
Expand All @@ -552,6 +554,7 @@ const DeploymentActions = ({ deploymentIndex, deploymentIsPinned, isCurrent, isS
}
actions.push(
<DropdownItem key="delete-deployment"
data-action="delete"
className="pf-v5-u-danger-color-200"
onClick={() => deleteDeployment()}
>
Expand Down Expand Up @@ -629,7 +632,7 @@ const OStreeSource = ({ ostreeState, refreshRemotes, onChangeBranch, onChangeRem
const Dialogs = useDialogs();

const actions = [
<DropdownItem key="rebase"
<DropdownItem key="rebase" data-action="rebase"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if the key leaked through to the DOM right ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh yea, but it's only a React detail..

isDisabled={!ostreeState.branches && !ostreeState.branchLoadError}
onClick={() => Dialogs.show(
<RebaseRepositoryModal origin={ostreeState.origin}
Expand All @@ -644,14 +647,14 @@ const OStreeSource = ({ ostreeState, refreshRemotes, onChangeBranch, onChangeRem
{_("Rebase")}
</DropdownItem>,
<Divider key="separator-1" />,
<DropdownItem key="add-repository"
<DropdownItem key="add-repository" data-action="add-repository"
onClick={() => Dialogs.show(
<AddRepositoryModal refreshRemotes={refreshRemotes} />
)}
>
{_("Add repository")}
</DropdownItem>,
<DropdownItem key="edit-repository"
<DropdownItem key="edit-repository" data-action="edit-repository"
onClick={() => Dialogs.show(
<EditRepositoryModal remote={ostreeState.origin.remote}
availableRemotes={ostreeState.remotes}
Expand All @@ -660,7 +663,7 @@ const OStreeSource = ({ ostreeState, refreshRemotes, onChangeBranch, onChangeRem
>
{_("Edit repository")}
</DropdownItem>,
<DropdownItem key="remove-repository"
<DropdownItem key="remove-repository" data-action="remove-repository"
onClick={() => Dialogs.show(
<RemoveRepositoryModal origin={ostreeState.origin}
availableRemotes={ostreeState.remotes}
Expand Down Expand Up @@ -893,12 +896,12 @@ class Application extends React.Component {
});

const kebabActions = [
<DropdownItem key="clean-up"
<DropdownItem key="clean-up" data-action="clean-up"
onClick={() => Dialogs.show(<CleanUpModal os={this.state.os} />)}>
{_("Clean up")}
</DropdownItem>,
<Divider key="deployment-separator-1" />,
<DropdownItem key="reset"
<DropdownItem key="reset" data-action="reset"
className="pf-v5-u-danger-color-200"
onClick={() => Dialogs.show(<ResetModal os={this.state.os} />)}>
{_("Reset")}
Expand Down
Loading