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

FeaturesTable structure & columns improvements #5013

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

neo-garaix
Copy link
Contributor

@neo-garaix neo-garaix commented Nov 28, 2024

Added

  • Replace the items <div> by an HTML <table> to prepare the addition of columns
  • Allow to add columns from the layer fields : now we can add several columns by adding some <lizmap-field ... > ... </lizmap-field> children inside the <lizmap-features-table> element
  • Add labels of columns in the table
  • Add a regular expression verification for the used QGIS expressions in child fields. At present, we only accept expressions requesting fields like "libsquart" and not expressions like rand(10,34).
  • If fields have the same expression or aliases (except empty ones), only the first one is used.

Example code:

<lizmap-features-table 
	layertitle="child sub-districts" 
	layerid="sousquartiers_24ceec66_e7fe_46a2_b57a_af5c50389649" 
	uniquefield="id" 
	expressionfilter="quartmno = '[% "quartmno" %]'" 
	withgeometry="1" 
	sortingfield="libsquart" 
	sortingorder="asc" 
	draggable="yes"
>
	<lizmap-field 
		data-alias="Name" 
		data-description="Label of sub-district's"
	>"libsquart"</lizmap-field>
	
	<lizmap-field 
		data-alias="Code" 
		data-description="Code of sub-district's name"
	>"squartmno"</lizmap-field>
</lizmap-features-table>

How it is rendered (in release_3_9, not in master since bootstrap migration is not finished yet)

image

Fixed

  • Fixed the end2end playwright test about FeaturesTable

Fix version of #4922

Funded by 3liz

@github-actions github-actions bot added this to the 3.10.0 milestone Nov 28, 2024
@mdouchin mdouchin added run end2end If the PR must run end2end tests or not backport release_3_9 enhancement user interface javascript Pull requests that update Javascript code labels Nov 28, 2024
@mdouchin mdouchin requested review from rldhont and mdouchin and removed request for rldhont November 28, 2024 11:14
@neo-garaix neo-garaix force-pushed the add-table-features-table branch from 40c78d3 to a23211f Compare December 2, 2024 08:46
Copy link
Collaborator

@mdouchin mdouchin left a comment

Choose a reason for hiding this comment

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

I modified the component & CSS to fix broken styles (blue background on hover, margins, fonts, etc.). It has been tested for release_3_9. Style is broken in master, as for other parts of LWC

@mdouchin mdouchin merged commit ff84f5b into 3liz:master Dec 5, 2024
14 checks passed
@3liz-bot
Copy link
Contributor

3liz-bot commented Dec 5, 2024

The backport to release_3_8 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply ce00f1aba... lizmap-features-table component - Use a table with additionnal columns from fields
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging assets/src/modules/FeaturesTable.js
Auto-merging lizmap/www/assets/css/map.css
CONFLICT (content): Merge conflict in lizmap/www/assets/css/map.css

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_8 release_3_8
# Navigate to the new working tree
cd .worktrees/backport-release_3_8
# Create a new branch
git switch --create backport-5013-to-release_3_8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ce00f1aba8ba1b217cda69a0e8aa7cac98203530
# Push it to GitHub
git push --set-upstream origin backport-5013-to-release_3_8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_8

Then, create a pull request where the base branch is release_3_8 and the compare/head branch is backport-5013-to-release_3_8.

@3liz-bot
Copy link
Contributor

3liz-bot commented Dec 5, 2024

The backport to release_3_9 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply ce00f1aba... lizmap-features-table component - Use a table with additionnal columns from fields
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging lizmap/www/assets/css/map.css
CONFLICT (content): Merge conflict in lizmap/www/assets/css/map.css

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_9 release_3_9
# Navigate to the new working tree
cd .worktrees/backport-release_3_9
# Create a new branch
git switch --create backport-5013-to-release_3_9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ce00f1aba8ba1b217cda69a0e8aa7cac98203530
# Push it to GitHub
git push --set-upstream origin backport-5013-to-release_3_9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_9

Then, create a pull request where the base branch is release_3_9 and the compare/head branch is backport-5013-to-release_3_9.

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

Successfully merging this pull request may close these issues.

5 participants