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

[14.0] shopfloor_mobile: improve list-item action handling #582

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

simahawk
Copy link
Contributor

@simahawk simahawk commented Feb 24, 2023

You can now decide if the action goes to the left or the right of the title.

ref: cos-3950

<div class="item-counter" v-if="opts.showCounters">
<span>{{ index + 1 }} / {{ count }}</span>
</div>
<span v-text="_.result(record, opts.key_title)" />
<list-item-title-action v-bind="$props" v-if="show_title_action_by_position('right')"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are this detail action and the one that existed before (v-btn in this component) mutually exclusive? They do the same thing right?

If so, should we hide the v-btn if there's a title action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't get your point. I want to render this action on one side or the other.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I was just thinking that the detail action you introduce in the title does the same thing as the action in the details part of this component:

    <v-btn icon class="detail-action"
            v-if="has_detail_action(record, field)"
            @click="on_detail_action(record, field, opts)">
        <btn-info-icon />
    </v-btn>

So maybe we could make them mutually exclusive to avoid making the frontend too crowded. But it's true that this all comes from the conditions in the props so there shouldn't be an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. That's another one and - in fact - I could reuse this component there too. I check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, the scope and the behavior is different, I prefer to not touch it for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good then!

You can now decide if the action goes to the left or the right of the title.
@simahawk
Copy link
Contributor Author

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-582-by-simahawk-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 9755ac2 into OCA:14.0 Feb 24, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 9412b7e. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants