User tests: Successful: Unsuccessful:
Pull Request for Issue multiple .
Replace the very limited javascript used to display the diff between the core and the overriden file in com_templates with something much more useful
Apply this PR and then composer install and npm i
or use on of the prebuilt packages
There are two different views for the override: side by side and inline
side by side is the default - you can swtich to the inline version in the component options
both show the line numbers
A message is displayed if the override is identical to the core original file
too ugly to display ;)
probably just updated screenshot
For more information on the library used and possible extras that could be added see https://github.com/jfcherng/php-diff
@richard67 a file is removed - shall I add it to the script or shall I ?
There may be some tweaks to the build scripts required to remove stuff from the library but I can only check when the package is built here ;)
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin Postgresql com_templates Language & Strings Repository NPM Change JavaScript External Library Composer Change Installation |
Labels |
Added:
Language Change
Composer Dependency Changed
NPM Resource Changed
?
|
Category | SQL Administration com_admin Postgresql com_templates Language & Strings Repository NPM Change JavaScript External Library Composer Change Installation | ⇒ | SQL Administration com_admin Postgresql com_templates Language & Strings Repository NPM Change JavaScript External Library Composer Change Installation Libraries |
Labels |
Added:
PR-4.3-dev
|
@Kostelano I agree BUT I might have to ask for some help with the css from someone
@Kostelano I agree BUT I might have to ask for some help with the css from someone
Add to that first row:
position: sticky;
top: 0;
Not quite that simple.
You can only add it to a th not a tr. But that's not the problem I have. It's messing up all the borders
Not quite that simple.
You can only add it to a th not a tr. But that's not the problem I have. It's messing up all the borders
Applying it to the thead th works. Regarding the borders-something to do with border-collapse on the table: https://stackoverflow.com/questions/50361698/border-style-do-not-work-with-sticky-position-element
dont forget the css needs to work in both inline and sidebyside
Those table
s have different classes btw.
<table class="diff diff-html diff-inline">
<table class="diff diff-html diff-side-by-side">
Thanks Jack - I will probably spend a little time later to create unique css for this using your tip
will be updated - hopefu;lly soon - with support for displaying tabs and spaces
everything updated now and ready for further testing.
ANY css changes required should be verified in both modes and submitted as a pr to my branch.
Looking forward to testing tomorrow, didn't have a chance to be at my computer this weekend beyond a few minutes yesterday otherwise I would have made more concrete comments/a PR. Thanks Brian.
I am offline for the next 48 hours
Labels |
Removed:
?
|
Great work thank you @brianteeman happy to test.
HI @brianteeman forgive my newness to this. I tried composer install but it says it's missing a composer.json file. I also tried it in the libraries/vendor/composer
directory but no such joy. I searched my install and I find no composer.json
files except in Yootheme. Are there any instructions anywhere that I can complete this task? It would seem like it would be a pretty common task.
So I guess I'm onto or "use one of the prebuilt packages". Where do I find them?
@brianteeman once I use that file it doesn't show any updated files. Even if I install something with overrides that are out of date it doesn't show them. Or if I create an override that doesn't work either. Is there a better way to test this?
The diff view is available for any template override it is not restricted to outdated overrides.
Just go to the template manager and create an override. Edit the override and save the edits
Open the override again and top right are two toggle switches - show original and show diff
Oh I see, I was expecting it to be in the updated overrides file part. I see it working, great job, thank you. A million times better.
I have tested this item
I see the diff system and it works well
@uglyeoin you submitted a successful test but i get this problem. Are you not?
@Kostelano I'm sorry I don't really understand the issue you are having. I have tried looking again and I can't identify it. Please can you provide further information to help me to test. Maybe a short video might help?
@Kostelano how can I choose position inline? My options are:
Show original file yes/no
Show differences yes/no
Have I missed something?
@uglyeoin yes there is a setting in the template component options that lets you switch from the default side by side view to the inline view that @Kostelano is showing
@Kostelano pretty sure I have fixed the wrap on the headers now
Thanks @brianteeman . I applied the latest patch using patch tester but I still see the columns wrapping as per @Kostelano 's screenshot. Is that the correct way to see the latest version?
I don't need to tell you but this seems to fix it.
.diff-wrapper.diff thead th {
min-width: 66px;
}
patchtester can not be used when there are css or js changes. You will need to test with a prebuilt download or the custom update server - both referred to on the same page you had before.
I don't need to tell you but this seems to fix it.
No it won't. It might fix it for en-GB but what if the word in french is much much longer ;)
The changes I made account for that
Ah yes of course, I had forgotten about multilingual. Thanks for the update. I will download and retest.
@brianteeman yes, now everything is fixed and working well.
Before submitting the test, I would like to make one last suggestion - to indent the columns a little more than 4 pixels (or make the column wider with +/-
signs. It seems to me that everything is a little stuck there. Consider this possibility. And I am ready to submit a successful test.
@Kostelano I am happy with it as it is.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
@HLeithner Drone fails cloning the repo and complains in the log about no IP-V4 address being available in the address pool (or something like that): https://ci.joomla.org/joomla/joomla-cms/58363 . Do you have an idea what the problem could be? I think it's not related to this PR.
Labels |
Added:
?
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-10-09 17:04:41 |
Closed_By | ⇒ | obuisard |
Thank you Brian for this major improvement. Makes a huge difference!
woohoo
Thanks @brianteeman and @jfcherng :)
@brianteeman Just Double checking. I create an override and added some text. For some reason the whole compare area is colored. At first the added line was darker green after adding a second line. the darker color is gone. I'm on windows.
Just saving the override without adding text will add the full color background.
I just checked out the 4.3 branch and did an install. I'm curious what went wrong in my installation... I'll check tomorrow.
the line ending changed?
Brian is on Windows too. Line endings shouldn't be the problem I guess.
Just saving the override without adding text will add the full color background.
not sure whether he was aware of this "saving" step.
Did some further investigation. When I edit the file in VScode the diff works. When I edit and save the override in Joomla the color problem occurs.
@brianteeman Hope you have a tip or a fix. IMHO this is the most useful new feature in J4.3.
I have strong feeling that this is a line ending issue. If it is, @brianteeman can rtrim($line, '\r\n')
before sending to the diff lib. Or maybe I can add a new option to ignore line ending in my diff lib.
@brianteeman if you create a new PR, please let me know so I do the tests!
Cool feature!
A "double" border of 1 px on the block, because of this, the frame is thicker than on the blocks above. And an empty space in case we only need to change a couple of lines - it should be removed.