-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Master ui for archived followers jgi #32084
Conversation
@@ -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': '' }}" |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>
+ empty newline before
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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': '' }}"/> |
There was a problem hiding this comment.
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
@@ -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 () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Promise.resolve({
/* ... */
});
4ae4b1c
to
3b2e640
Compare
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
3b2e640
to
a5b8ff7
Compare
robodoo r+ |
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>
Merged, thanks! |
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