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

Master ui for archived followers jgi #32084

Closed

Conversation

jgi-odoo
Copy link
Contributor

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Mar 25, 2019
@alexkuhn alexkuhn added the RD research & development, internal work label Mar 25, 2019
@@ -36,12 +36,12 @@
-->
<t t-name="mail.Followers.partner">
<div role="menuitem" class="o_partner">
<a class="dropdown-item o_mail_redirect"
<a t-attf-class="dropdown-item o_mail_redirect {{ record.active === false ? 'o_inactive_partner': '' }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

record.active === false => !record.active

@@ -110,6 +114,9 @@
@include o-position-absolute(6px, 18px);
cursor: pointer;
}
.o_inactive_partner_img{
Copy link
Contributor

Choose a reason for hiding this comment

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

best to use > when you can, also space before {

@@ -97,6 +97,10 @@
text-overflow: ellipsis;
height: $o-mail-partner-avatar-size;
padding: 3px $o-mail-partner-avatar-size + 8px;
&.o_inactive_partner {
Copy link
Contributor

Choose a reason for hiding this comment

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

> + empty newline before

Copy link
Contributor

Choose a reason for hiding this comment

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

oops, no > here, but still newline before

session: {partner_id: 1},
});

assert.strictEqual(form.$('.o_inactive_partner').length, 1, 'there is 1 inactive follower');
Copy link
Contributor

Choose a reason for hiding this comment

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

assert.containsOnce() or assert.isVisible()

});

assert.strictEqual(form.$('.o_inactive_partner').length, 1, 'there is 1 inactive follower');
assert.strictEqual(form.$('.o_inactive_partner_img').length, 1, 'there is 1 inactive follower\'s avatar');
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be much better to assert on each follower list item. Could use [data-oe-id="<id>"] in the jQuery selector.

active: false,
}];

var def;
Copy link
Contributor

Choose a reason for hiding this comment

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

unused

id: 1,
name: "Admin",
email: "admin@example.com",
res_id: resID,
Copy link
Contributor

Choose a reason for hiding this comment

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

does not really make sense to have same res_id for all followers.

if (route === '/mail/read_followers') {
return Promise.resolve(def).then(function () {
return {
followers: _.filter(followers, function (follower) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks basically the server-side behaviour of this method. Would be nice to define this in mail/mock_server, so that it does that by default when there are followers in this.data. (You may need to adapt some other tests in this file)

Copy link
Contributor

Choose a reason for hiding this comment

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

to do with read_followers refactoring, so let's keep it that way for the moment

@@ -110,6 +114,9 @@
@include o-position-absolute(6px, 18px);
cursor: pointer;
}
.o_inactive_partner_img{
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be in the o_partner section too

href="#"
t-att-title="record.name"
t-att-data-oe-model="record.res_model"
t-att-data-oe-id="record.res_id"><t t-esc="record.name"/></a>
<img t-att-src="record.avatar_url" alt="Avatar"/>
<img t-att-src="record.avatar_url" alt="Avatar" t-attf-class="{{ record.active === false ? 'o_inactive_partner_img': '' }}"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it wouldn't be cleaner to add a class on div.o_partner and adapt the css accordingly since you are using this condition twice. in the same dom element

@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Mar 26, 2019
@@ -2307,7 +2306,7 @@ QUnit.test('followers widget: display inactive followers with a different style'
'</form>',
mockRPC: function (route, args) {
if (route === '/mail/read_followers') {
return Promise.resolve(def).then(function () {
return Promise.resolve().then(function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

return Promise.resolve({
   /* ... */
});

@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Mar 26, 2019
@jgi-odoo jgi-odoo force-pushed the master-ui-for-archived-followers-jgi branch from 4ae4b1c to 3b2e640 Compare March 26, 2019 14:59
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Mar 26, 2019
When displaying the followers of a document, followers who are set as inactive will be displayed in a different layout than the active ones. The purpose is to mark a clear difference between active and inactive followers.

Task #1957849
@jgi-odoo jgi-odoo force-pushed the master-ui-for-archived-followers-jgi branch from 3b2e640 to a5b8ff7 Compare March 27, 2019 16:07
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Mar 27, 2019
@Xavier-Do
Copy link
Contributor

robodoo r+

@robodoo robodoo added the r+ 👌 label Apr 2, 2019
robodoo pushed a commit that referenced this pull request Apr 2, 2019
When displaying the followers of a document, followers who are set as inactive will be displayed in a different layout than the active ones. The purpose is to mark a clear difference between active and inactive followers.

Task #1957849

closes #32084

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
@robodoo
Copy link
Contributor

robodoo commented Apr 2, 2019

Merged, thanks!

@robodoo robodoo closed this Apr 2, 2019
@fw-bot fw-bot deleted the master-ui-for-archived-followers-jgi branch October 19, 2019 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants