Skip to content

Conversation

@pat270
Copy link

@pat270 pat270 commented Feb 19, 2021

…class when highlighted instead of active table-active

https://issues.liferay.com/browse/LPS-127831

I was trying to figure out how to access the rowSelector string in rowClassNameActive, but couldn't figure it out.

Card View image card doesn't show active border because it is a special case where we can't style the card with the input:checked ~ .card selector or with the active class on the li element. This needs the active class on the card. There was a pr that was merged on the Clay repo that addresses this. See liferay/clay#3937.

active-on-img-card

…class when highlighted instead of active table-active
@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:relevant
  •     ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 1 day 16 hours 53 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: d610360269471ce22dea81957a59d19a64492406

Sender Branch:

Branch Name: LPS-127831
Branch GIT ID: d39915e732be15721347481da00170fbdc4e9296

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 9 out of 9 jobs passed

❌ ci:test:relevant - 20 out of 23 jobs passed in 6 hours 40 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: d610360269471ce22dea81957a59d19a64492406

Upstream Comparison:

Branch GIT ID: d610360269471ce22dea81957a59d19a64492406
Jenkins Build URL: Acceptance Upstream DXP (master) #1566

ci:test:stable - 9 out of 9 jobs PASSED
9 Successful Jobs:
ci:test:relevant - 20 out of 23 jobs PASSED
20 Successful Jobs:
For more details click here.

Failures unique to this pull:


Failures in common with acceptance upstream results at d610360:
  1. test-portal-acceptance-pullrequest-batch(master)/modules-semantic-versioning-jdk8/0
    Job Results:

    0 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #488612

      Please fix semantic versioning on pat270/LPS-127831

           [exec] Note: Some input files use unchecked or unsafe operations.
           [exec] Note: Recompile with -Xlint:unchecked for details.
           [exec] 
           [exec] > Task :apps:configuration-admin:configuration-admin-web:jar
           [exec] > Task :apps:configuration-admin:configuration-admin-web:autoUpdateXml SKIPPED
           [exec] 
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:compileJava
           [exec] 
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:copyLibs SKIPPED
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:classes
           [exec] Note: /opt/dev/projects/github/liferay-portal/modules/apps/frontend-js/frontend-js-portlet-extender/src/main/java/com/liferay/frontend/js/portlet/extender/internal/portlet/action/PortletExtenderConfigurationAction.java uses or overrides a deprecated API.
           [exec] Note: Recompile with -Xlint:deprecation for details.
           [exec] Note: /opt/dev/projects/github/liferay-portal/modules/apps/frontend-js/frontend-js-portlet-extender/src/main/java/com/liferay/frontend/js/portlet/extender/internal/portlet/JSPortlet.java uses unchecked or unsafe operations.
           [exec] Note: Recompile with -Xlint:unchecked for details.
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:jar
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:autoUpdateXml SKIPPED
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:baseline SKIPPED
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:syncVersions
           [exec] Gradle build finished at 2021-02-20 01:38:32.003.
           [exec] 258 actionable tasks: 247 executed, 11 up-to-date
           [exec] 
           [exec] 
           [exec] FAILURE: Build failed with an exception.
           [exec] 
           [exec] * What went wrong:
           [exec] Execution failed for task ':apps:frontend-js:frontend-js-loader-modules-extender-api:baseline'.
           [exec] > A failure occurred while executing com.liferay.gradle.plugins.baseline.internal.work.BaselineWorkAction
           [exec]    > org.gradle.api.GradleException: Semantic versioning is incorrect while checking /opt/dev/projects/github/liferay-portal/tools/sdk/dist/com.liferay.frontend.js.loader.modules.extender.api-5.0.0.jar against /opt/dev/projects/github/liferay-portal/.gradle/caches/modules-2/files-2.1/com.liferay/com.liferay.frontend.js.loader.modules.extender.api/4.3.0/8e87349713aba08ef90797451edca0e4732a6b42/com.liferay.frontend.js.loader.modules.extender.api-4.3.0.jar

@liferay-continuous-integration
Copy link
Collaborator

@wincent
Copy link

wincent commented Feb 22, 2021

Build was aborted

Haven't looked at the code yet (about to do that), but going to run the tests in the meantime...

@wincent
Copy link

wincent commented Feb 22, 2021

ci:test:relevant

@wincent
Copy link

wincent commented Feb 22, 2021

ci:test:bundle

Comment on lines +79 to +89
if (Lang.isString(rowClassNameActive)) {
var active = rowClassNameActive.split(',');
var rowSelector = [
'li[data-selectable="true"]',
'tr[data-selectable="true"]',
];

return active[
rowSelector.indexOf(this.get(STR_ROW_SELECTOR))
];
}
Copy link

Choose a reason for hiding this comment

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

I must confess that I don't actually understand how this works. Let me try to put it into words and you can confirm for me whether I've understood it:

  • Previously, the value here was active table-active; now it is active,table-active.

  • There is no reference to rowClassNameActive outside of this file, so just based on what I see in here, the value is going to get passed to into addClass or toggleClass. I can't find the docs or the implementation for YUI/AUI addClass, but at least this line suggests to me that it expects a space-separated list of class names; I am not sure what it will do when given a comma-separated list...

  • I don't know AUI/YUI, so I don't know if this setter is magically called somehow; I can't see any setter calls anywhere (and like I said, can't see any references outside of this file). My guess here is that your intent is that your split() call turns the invalid comma-containing "name" into a single name, but I have no idea when the setter is called.

  • There's obviously a relationship between the classes in rowSelector below and the ones on line 81 above, but it seems subtle and fragile, and the whole thing seems roughly equivalent to this:

    return 'active,table-active'.split(',')[
        [
            'li[data-selectable="true"]',
            'tr[data-selectable="true"]',
        ].indexOf('li[data-selectable="true"],tr[data-selectable="true"]'),
    ];

    I don't really get it, as that indexOf() looks like it is always going to return -1, so the access by array-index of -1 into the array will always return undefined. Maybe somebody who knows AUI a bit better can review this? cc @jonmak08

Copy link
Author

Choose a reason for hiding this comment

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

I must confess that I don't actually understand how this works.

You and me both. This is always magic to me.

I don't know if this setter is magically called somehow;

I think setter gets called via aui-component.js and widget-base.js (YUI), maybe these two files will clear up when it gets called? 🤷

Copy link

Choose a reason for hiding this comment

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

Well, I don't think I can forward this without understanding how it works, especially if you also say that you don't understand it. 😬 Can you think of anybody who would be better qualified to review it?

Copy link
Author

Choose a reason for hiding this comment

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

good-point

@jonmak08 could review it but had a power outage yesterday, otherwise @jbalsas haha.

Copy link

@jbalsas jbalsas Feb 23, 2021

Choose a reason for hiding this comment

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

To be honest, I don't know how or why would this work either 😂 @pat270, how did you come up with this script then? Trial and error?

Our main logic is in this same file some lines below:

var row = event.currentTarget.ancestor(
    instance.get(STR_ROW_SELECTOR)
);

[...]

row.toggleClass(instance.get(STR_ROW_CLASS_NAME_ACTIVE));

Where row is the li for cards and descriptive visualizations and the tr for tables. So...

Card View image card doesn't show active border because it is a special case where we can't style the card with the input:checked ~ .card selector or with the active class on the li element.

I'm not sure I understand what's the technical limitation here... 🤔

Copy link

Choose a reason for hiding this comment

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

did what I needed to do.

what-i-had-to-do

Copy link

@jbalsas jbalsas Feb 24, 2021

Choose a reason for hiding this comment

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

So... shot in the dark here:

Is the goal of this PR to simply have the active class in the li and not both active and table-active?

(This doesn't fix the issue, which still needs the new Clay release merged, I think?)

Copy link
Author

Choose a reason for hiding this comment

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

There are two issues:

  1. https://issues.liferay.com/browse/LPS-127450 (Styles for active row is lost). Bootstrap 4 changed the active class on table rows to table-active. The compat layer removal exposes this issue on search container table view.

  2. https://issues.liferay.com/browse/LPS-127831 (Extra styles are added to selected card). The fix from LPS-127450 caused this. The light blue border/background around the card (caused by table-active) is what needs to be fixed.

table-active-on-card

The Clay pr will add the blue border around image card when the card is checked.

Copy link

Choose a reason for hiding this comment

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

Got it now, thanks @pat270!

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for sending the update @jbalsas!

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:bundle - 1 out of 1 jobs passed in 41 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: aa80a9ec2a3bc90349b41faec6f2fa93e99fc0c4

ci:test:bundle - 1 out of 1 jobs PASSED
For more details click here.
Test bundle downloads:

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 9 out of 9 jobs passed

✔️ ci:test:relevant - 22 out of 23 jobs passed in 1 hour 27 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: aa80a9ec2a3bc90349b41faec6f2fa93e99fc0c4

Upstream Comparison:

Branch GIT ID: aa80a9ec2a3bc90349b41faec6f2fa93e99fc0c4
Jenkins Build URL: Acceptance Upstream DXP (master) #1567

ci:test:stable - 9 out of 9 jobs PASSED
9 Successful Jobs:
ci:test:relevant - 21 out of 23 jobs PASSED
21 Successful Jobs:
For more details click here.

This pull contains no unique failures.


Failures in common with acceptance upstream results at aa80a9e:
  1. test-portal-acceptance-pullrequest-batch(master)/modules-semantic-versioning-jdk8/0
    Job Results:

    0 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #459843

      Please fix semantic versioning on pat270/LPS-127831

           [exec] Note: Recompile with -Xlint:deprecation for details.
           [exec] Note: Some input files use unchecked or unsafe operations.
           [exec] Note: Recompile with -Xlint:unchecked for details.
           [exec] 
           [exec] > Task :apps:configuration-admin:configuration-admin-web:compileJSP
           [exec] 
           [exec] > Task :apps:configuration-admin:configuration-admin-web:jar
           [exec] > Task :apps:configuration-admin:configuration-admin-web:autoUpdateXml SKIPPED
           [exec] Note: /opt/dev/projects/github/liferay-portal/modules/apps/frontend-js/frontend-js-portlet-extender/src/main/java/com/liferay/frontend/js/portlet/extender/internal/portlet/action/PortletExtenderConfigurationAction.java uses or overrides a deprecated API.
           [exec] Note: Recompile with -Xlint:deprecation for details.
           [exec] Note: /opt/dev/projects/github/liferay-portal/modules/apps/frontend-js/frontend-js-portlet-extender/src/main/java/com/liferay/frontend/js/portlet/extender/internal/portlet/JSPortlet.java uses unchecked or unsafe operations.
           [exec] Note: Recompile with -Xlint:unchecked for details.
           [exec] 
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:compileJava
           [exec] 
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:copyLibs SKIPPED
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:classes
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:jar
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:autoUpdateXml SKIPPED
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:baseline SKIPPED
           [exec] > Task :apps:frontend-js:frontend-js-portlet-extender:syncVersions
           [exec] 
           [exec] 
           [exec] FAILURE: Build failed with an exception.
           [exec] 
           [exec] * What went wrong:
           [exec] Execution failed for task ':apps:frontend-js:frontend-js-loader-modules-extender-api:baseline'.
           [exec] > A failure occurred while executing com.liferay.gradle.plugins.baseline.internal.work.BaselineWorkAction
           [exec]    > org.gradle.api.GradleException: Semantic versioning is incorrect while checking /opt/dev/projects/github/liferay-portal/tools/sdk/dist/com.liferay.frontend.js.loader.modules.extender.api-5.0.0.jar against /opt/dev/projects/github/liferay-portal/.gradle/caches/modules-2/files-2.1/com.liferay/com.liferay.frontend.js.loader.modules.extender.api/4.3.1/351c6038cef9ee176bfe24835b2f9e7744d22c40/com.liferay.frontend.js.loader.modules.extender.api-4.3.1.jar

@liferay-continuous-integration
Copy link
Collaborator

@jbalsas
Copy link

jbalsas commented Feb 25, 2021

Closing in favour of #837.

@pat270, couldn't push to your fork. Could you please check point 9 of the Frontend Infrastructure Team code review process to expedite this in the future?

Allow edits from maintainers. When you create your pull, please be sure check the "Allow edits and access to secrets by maintainers" box at the bottom of the pull request form. This allows other collaborators on the repo to push to the pull's corresponding branch on your fork, thus updating the pull. This can save wasteful round trips, which can be expensive due to time-zone delays.

Allow edits from maintainers checkbox

Note that if you create PRs with the gh command-line tool you obviously can't see or check a checkbox. In that case, you may wish to add the people who most frequently review your code as collaborators to your repo, as well as the team members who tend to be generally involved in code review:

brunobasto
bryceosterhaus
jbalsas
markocikos
wincent

/cc @wincent, might wanna hide Bruno until he gets back ;)

@jbalsas jbalsas closed this Feb 25, 2021
@jbalsas
Copy link

jbalsas commented Feb 25, 2021

Also, @pat270

Ok I dug around a little...rowSelector gets updated by https://github.com/liferay/liferay-portal/blame/master/portal-web/docroot/html/taglib/ui/search_iterator/lexicon/bottom.jspf#L55-L68. I think we could pass in rowClassNameActive there and revert the changes made in search_container_select.js. Let me know if this is the way.

thisistheway

wincent added a commit to liferay/liferay-frontend-projects that referenced this pull request Feb 25, 2021
As requested here:

    liferay-frontend/liferay-portal#821 (comment)

Adding Jon Mak, in order to bring balance to The Force.
@wincent
Copy link

wincent commented Feb 25, 2021

until he gets back

i-see-what-you-did-there

liferay/liferay-frontend-projects#419

@pat270 pat270 deleted the LPS-127831 branch October 24, 2023 18:02
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.

5 participants