From 27bfdf8910a932dfe42430a4a825c325702c20d2 Mon Sep 17 00:00:00 2001 From: Riccardo Beltrami Date: Wed, 17 Jul 2024 14:26:39 +0200 Subject: [PATCH 1/3] add text widget to the edition form --- .../qgisAttributeEditorElement.class.php | 87 +- .../classes/qgisExpressionUtils.class.php | 14 +- lizmap/modules/lizmap/lib/Form/QgisForm.php | 56 + tests/end2end/playwright/edition-form.spec.js | 259 ++++ tests/qgis-projects/tests/test_embed.gpkg | Bin 118784 -> 118784 bytes tests/qgis-projects/tests/tests_dataset.sql | 60 +- tests/qgis-projects/tests/text_widget.qgs | 1168 +++++++++++++++++ tests/qgis-projects/tests/text_widget.qgs.cfg | 202 +++ 8 files changed, 1839 insertions(+), 7 deletions(-) create mode 100644 tests/qgis-projects/tests/text_widget.qgs create mode 100644 tests/qgis-projects/tests/text_widget.qgs.cfg diff --git a/lizmap/modules/lizmap/classes/qgisAttributeEditorElement.class.php b/lizmap/modules/lizmap/classes/qgisAttributeEditorElement.class.php index 9b1eb8be5a..4d1f887f8f 100644 --- a/lizmap/modules/lizmap/classes/qgisAttributeEditorElement.class.php +++ b/lizmap/modules/lizmap/classes/qgisAttributeEditorElement.class.php @@ -20,6 +20,7 @@ class qgisAttributeEditorElement protected $_isGroupBox = false; protected $_isTabPanel = false; protected $_isRelationWidget = false; + protected $_isTextWidget = false; protected $_isVisibilityExpressionEnabled = false; protected $_visibilityExpression = ''; @@ -29,6 +30,7 @@ class qgisAttributeEditorElement protected $childrenBeforeTab = array(); protected $tabChildren = array(); protected $childrenAfterTab = array(); + protected $_textWidgetText = ''; public function __construct( Lizmap\Form\QgisFormControlsInterface $formControls, @@ -56,7 +58,7 @@ public function __construct( $this->label = $getLabel; } - $this->_isContainer = ($name != 'attributeEditorField' && $name != 'attributeEditorRelation'); + $this->_isContainer = ($name != 'attributeEditorField' && $name != 'attributeEditorRelation' && $name != 'attributeEditorTextElement'); if (!$this->_isContainer) { // Field $this->htmlId = $parentId.'-'.$idx; @@ -67,6 +69,13 @@ public function __construct( $this->htmlId = $parentId.'-relation'.$idx; $this->_isRelationWidget = true; } + if ($name == 'attributeEditorTextElement') { + $this->htmlId = $parentId.'-text'.$idx; + $this->_isTextWidget = true; + $this->ctrlRef = $this->getName(); + $stringNode = (string) $node; + $this->_textWidgetText = $stringNode; + } } else { // Manage containers: form, group or tab if ($name == 'attributeEditorForm') { @@ -99,6 +108,7 @@ public function __construct( && $name != 'attributeEditorForm' && $name != 'attributeEditorField' && $name != 'attributeEditorRelation' + && $name != 'attributeEditorTextElement' ) { ++$childIdx; @@ -108,7 +118,7 @@ public function __construct( if (!$child->isContainer()) { // Child is a Field input OR a relation widget - if ($child->getCtrlRef() !== null || $child->isRelationWidget()) { + if ($child->getCtrlRef() !== null || $child->isRelationWidget() || $child->isTextWidget()) { if (count($this->tabChildren)) { $this->childrenAfterTab[] = $child; } else { @@ -165,11 +175,31 @@ public function getAttribute($name) return null; } + /** + * Returns the _textWidgetText property value. + * + * @return string + */ + public function getTextWidgetText() + { + return $this->_textWidgetText; + } + public function isContainer() { return $this->_isContainer; } + /** + * Returns the _isTextWidget property value, that is, whether the element is a text widget or not. + * + * @return bool + */ + public function isTextWidget() + { + return $this->_isTextWidget; + } + public function isGroupBox() { return $this->_isGroupBox; @@ -266,6 +296,59 @@ public function getFields() return $fields; } + /** + * Returns the text widget fields configuration. + * + * @return array[] + */ + public function getTextWidgetFields() + { + $fields = array(); + if (!$this->hasChildren() && $this->isTextWidget() == true) { + $fields[$this->getName()] = array( + 'label' => $this->getName(), + 'name' => $this->getName(), + 'value' => $this->getTextWidgetText(), + ); + + return $fields; + } + + foreach ($this->getChildrenBeforeTab() as $child) { + if ($child->isGroupBox()) { + $fields = array_merge($fields, $child->getTextWidgetFields()); + } else { + if ($child->isTextWidget() == true) { + $fields[$child->getName()] = array( + 'label' => $child->getName(), + 'name' => $child->getName(), + 'value' => $child->getTextWidgetText(), + ); + } + } + } + + foreach ($this->getTabChildren() as $child) { + $fields = array_merge($fields, $child->getTextWidgetFields()); + } + + foreach ($this->getChildrenAfterTab() as $child) { + if ($child->isGroupBox()) { + $fields = array_merge($fields, $child->getTextWidgetFields()); + } else { + if ($this->isTextWidget() == true) { + $fields[$child->getName()] = array( + 'label' => $child->getName(), + 'name' => $child->getName(), + 'value' => $child->getTextWidgetText(), + ); + } + } + } + + return $fields; + } + public function getGroupVisibilityExpressions() { $expressions = array(); diff --git a/lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php b/lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php index c4912a0551..2bd4a411b9 100644 --- a/lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php +++ b/lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php @@ -244,12 +244,13 @@ public static function evaluateExpressions($layer, $expressions, $form_feature = /** * Request QGIS Server and the lizmap plugin to replace QGIS expressions text. * - * @param qgisVectorLayer $layer A QGIS vector layer - * @param array $expressions The expressions text to replace + * @param qgisVectorLayer $layer A QGIS vector layer + * @param array $expressions The expressions text to replace + * @param array $form_feature A feature to add to the evaluation context * * @return null|object the results of expressions text replacement */ - public static function replaceExpressionText($layer, $expressions) + public static function replaceExpressionText($layer, $expressions, $form_feature = null) { // Evaluate the expression by qgis $project = $layer->getProject(); @@ -259,9 +260,14 @@ public static function replaceExpressionText($layer, $expressions) 'map' => $project->getRelativeQgisPath(), 'layer' => $layer->getName(), 'strings' => json_encode($expressions), - 'features' => 'ALL', 'format' => 'GeoJSON', ); + if ($form_feature) { + $params['feature'] = json_encode($form_feature); + $params['form_scope'] = 'true'; + } else { + $params['features'] = 'ALL'; + } // Request replace expression text $json = self::request($params, $project); diff --git a/lizmap/modules/lizmap/lib/Form/QgisForm.php b/lizmap/modules/lizmap/lib/Form/QgisForm.php index 039cd3b687..5725ba80a0 100644 --- a/lizmap/modules/lizmap/lib/Form/QgisForm.php +++ b/lizmap/modules/lizmap/lib/Form/QgisForm.php @@ -207,6 +207,45 @@ public function __construct($layer, $form, $featureId, $loginFilteredOverride, A $privateData['qgis_groupDependencies'] = array(); } + // adding text widget fields to the form + if ($attributeEditorForm) { + $textWidgetFields = $attributeEditorForm->getTextWidgetFields(); + if (count($textWidgetFields) > 0) { + foreach ($textWidgetFields as $textName => $textProp) { + // use jFormsControlOutput instance + $textCtrl = new \jFormsControlOutput($textName); + $textCtrl->label = $textProp['label']; + // add control into the form + $form->addControl($textCtrl); + + // construct the from_feature array including geometry, if any, for geometry based expressions evaluation + $geom = null; + $ref = $form->getData('liz_geometryColumn'); + $wkt = trim($form->getData($ref)); + if ($wkt && \lizmapWkt::check($wkt)) { + $geom = \lizmapWkt::parse($wkt); + if ($geom === null) { + \jLog::log('Parsing WKT failed! '.$wkt, 'error'); + } + } + + $form_feature = array( + 'type' => 'Feature', + 'geometry' => $geom, + 'properties' => $form->getAllData(), + ); + // evaluate expression + $expressionT = $this->evaluateExpressionText(array($textName => $textProp['value']), $form_feature); + // expecting geojson or null + if ($expressionT && is_array($expressionT->features) && count($expressionT->features) == 1 && property_exists($expressionT->features[0], 'properties') && property_exists($expressionT->features[0]->properties, $textName)) { + $form->setData($textName, $expressionT->features[0]->properties->{$textName}); + } else { + $form->setData($textName, ''); + } + } + } + } + $form->getContainer()->privateData = array_merge($form->getContainer()->privateData, $privateData); } @@ -1891,4 +1930,21 @@ public function evaluateWebDavUrlExpression($fieldRef, $storageUrl, $fileName = return null; } + + /** + * Returns the text evaluated from $expression. + * + * @param array $expression The expression to evaluate + * @param null|array $form_feature A feature to add to the evaluation context + * + * @return null|object + */ + public function evaluateExpressionText($expression, $form_feature = null) + { + return \qgisExpressionUtils::replaceExpressionText( + $this->layer, + $expression, + $form_feature + ); + } } diff --git a/tests/end2end/playwright/edition-form.spec.js b/tests/end2end/playwright/edition-form.spec.js index e155f422bb..ecef10e8ae 100644 --- a/tests/end2end/playwright/edition-form.spec.js +++ b/tests/end2end/playwright/edition-form.spec.js @@ -510,3 +510,262 @@ test.describe('Multiple geometry layers', () => { }) }) + +test.describe('Text widget in a form', () => { + + test.beforeEach(async ({ page }) => { + const url = '/index.php/view/map/?repository=testsrepository&project=text_widget'; + await gotoMap(url, page) + }); + + test('Edit form with text widget in it', async ({ page }) => { + + let getFeatureInfoRequestPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData()?.includes('GetFeatureInfo') === true); + + await page.locator('#newOlMap').click({ + position: { + x: 354, + y: 370 + } + }); + + await getFeatureInfoRequestPromise; + + // checking popup + await page.waitForTimeout(500); + + await expect(page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupTitle').first()).toHaveText("Point edit"); + await expect(page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupDiv ul.nav-tabs li')).toHaveCount(3); + await expect(page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupDiv div.tab-pane')).toHaveCount(3); + + // first popup tab + const firstTabFields = page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupDiv div.tab-pane').nth(0).locator('.field'); + + await expect(firstTabFields).toHaveCount(5); + await expect(firstTabFields.nth(0)).toHaveText('1'); + await expect(firstTabFields.nth(1)).toHaveText('text string'); + await expect(firstTabFields.nth(2)).toHaveText('3.8602126068661824'); + await expect(firstTabFields.nth(3)).toHaveText('1'); + await expect(firstTabFields.nth(4)).toHaveText('Widget_test'); + + // second popup tab + const secondTabFields = page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupDiv div.tab-pane').nth(1).locator('.field'); + + await expect(secondTabFields).toHaveCount(1); + await expect(secondTabFields.nth(0)).toHaveText('[%kk[% "ids" %]%]'); + + // third popup tab + const thirdTabFields = page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature .lizmapPopupDiv div.tab-pane').nth(2).locator('.field'); + + await expect(thirdTabFields).toHaveCount(1); + await expect(thirdTabFields.nth(0)).toHaveText('Widget_test'); + + // edit the feature + let editFeatureRequestPromise = page.waitForResponse(response => response.url().includes('editFeature')); + await page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature').nth(0).locator("lizmap-feature-toolbar").first().locator(".feature-toolbar button[data-original-title='Edit']").click(); + await editFeatureRequestPromise; + + // the text widgets in the form should be filled as in the popup + const form = page.locator('#jforms_view_edition'); + await expect(form.locator('div.tab-pane')).toHaveCount(3); + + // first tab + let firstFormTabFields = await form.locator('div.tab-pane').nth(0).locator('div.control-group'); + await expect(firstFormTabFields).toHaveCount(5); + + await expect(firstFormTabFields.nth(0).locator('label')).toHaveText('id'); + await expect(firstFormTabFields.nth(0).locator('input')).toHaveValue('1'); + + await expect(firstFormTabFields.nth(1).locator('label')).toHaveText('Constant'); + let trimText = (await firstFormTabFields.nth(1).locator('input').inputValue()).replace(/\s+/g,' ').trim() + expect(trimText).toBe('text string') + + await expect(firstFormTabFields.nth(2).locator('label')).toHaveText('Geometry X'); + trimText = (await firstFormTabFields.nth(2).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('3.860212606866182'); + + await expect(firstFormTabFields.nth(3).locator('label')).toHaveText('id check'); + trimText = (await firstFormTabFields.nth(3).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('1'); + + await expect(firstFormTabFields.nth(4).locator('label')).toHaveText('Name'); + await expect(firstFormTabFields.nth(4).locator('input')).toHaveValue('Widget_test'); + + // second tab + let secondFormTabFields = await form.locator('div.tab-pane').nth(1).locator('div.control-group'); + await expect(secondFormTabFields).toHaveCount(1); + + await expect(secondFormTabFields.nth(0).locator('label')).toHaveText('Wrong expression'); + trimText = (await secondFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // wrong expressions should not be evaluated + expect(trimText).toBe('[%kk[% "ids" %]%]'); + + // third tab + let thirdFormTabFields = await form.locator('div.tab-pane').nth(2).locator('div.control-group'); + await expect(thirdFormTabFields).toHaveCount(1); + + await expect(thirdFormTabFields.nth(0).locator('label')).toHaveText('Name check'); + trimText = (await thirdFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('Widget_test'); + + // fill and save the form + await firstFormTabFields.nth(4).locator('input').fill("text modified"); + + await page.locator('#jforms_view_edition_liz_future_action').selectOption('edit'); + let editFeatureRequestPromiseUpdate = page.waitForResponse(response => response.url().includes('editFeature')); + await page.locator('#jforms_view_edition__submit_submit').click(); + + await editFeatureRequestPromiseUpdate; + await page.waitForTimeout(300); + + const newForm = page.locator('#jforms_view_edition'); + // inspect the new opened form, the only fields that should be updated are the "Name" and "Name check" fields + firstFormTabFields = newForm.locator('div.tab-pane').nth(0).locator('div.control-group'); + await expect(firstFormTabFields.nth(0).locator('label')).toHaveText('id'); + await expect(firstFormTabFields.nth(0).locator('input')).toHaveValue('1'); + + await expect(firstFormTabFields.nth(1).locator('label')).toHaveText('Constant'); + trimText = (await firstFormTabFields.nth(1).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('text string') + + await expect(firstFormTabFields.nth(2).locator('label')).toHaveText('Geometry X'); + trimText = (await firstFormTabFields.nth(2).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('3.860212606866182') + + await expect(firstFormTabFields.nth(3).locator('label')).toHaveText('id check'); + trimText = (await firstFormTabFields.nth(3).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('1') + + await expect(firstFormTabFields.nth(4).locator('label')).toHaveText('Name'); + await expect(firstFormTabFields.nth(4).locator('input')).toHaveValue('text modified'); + + secondFormTabFields = await newForm.locator('div.tab-pane').nth(1).locator('div.control-group'); + await expect(secondFormTabFields.nth(0).locator('label')).toHaveText('Wrong expression'); + trimText = (await secondFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // wrong expressions should not be evaluated + expect(trimText).toBe('[%kk[% "ids" %]%]'); + + thirdFormTabFields = await newForm.locator('div.tab-pane').nth(2).locator('div.control-group'); + await expect(thirdFormTabFields.nth(0).locator('label')).toHaveText('Name check'); + trimText = (await thirdFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // expression updated + expect(trimText).toBe('text modified'); + }) + + test('Insert new feature', async ({ page }) => { + + // insepct the form, all text widget should be empty except for the "Constat" and "Wrong expression" once + let editFeatureRequestPromise = page.waitForResponse(response => response.url().includes('editFeature')); + await page.locator('#button-edition').click(); + await page.locator('a#edition-draw').click(); + await editFeatureRequestPromise; + + // the text widgets in the form should be filled as in the popup + const form = await page.locator('#jforms_view_edition'); + await expect(form.locator('div.tab-pane')).toHaveCount(3); + + // first tab + let firstFormTabFields = form.locator('div.tab-pane').nth(0).locator('div.control-group'); + await expect(firstFormTabFields).toHaveCount(5); + + await expect(firstFormTabFields.nth(0).locator('label')).toHaveText('id'); + await expect(firstFormTabFields.nth(0).locator('input')).toHaveValue(''); + + await expect(firstFormTabFields.nth(1).locator('label')).toHaveText('Constant'); + let trimText = (await firstFormTabFields.nth(1).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('text string') + + await expect(firstFormTabFields.nth(2).locator('label')).toHaveText('Geometry X'); + trimText = (await firstFormTabFields.nth(2).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('') + + await expect(firstFormTabFields.nth(3).locator('label')).toHaveText('id check'); + trimText = (await firstFormTabFields.nth(3).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('') + + await expect(firstFormTabFields.nth(4).locator('label')).toHaveText('Name'); + await expect(firstFormTabFields.nth(4).locator('input')).toHaveValue(''); + + // second tab + let secondFormTabFields = form.locator('div.tab-pane').nth(1).locator('div.control-group'); + await expect(secondFormTabFields).toHaveCount(1); + + await expect(secondFormTabFields.nth(0).locator('label')).toHaveText('Wrong expression'); + trimText = (await secondFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // wrong expressions should not be evaluated + expect(trimText).toBe('[%kk[% "ids" %]%]'); + + // third tab + let thirdFormTabFields = await form.locator('div.tab-pane').nth(2).locator('div.control-group'); + await expect(thirdFormTabFields).toHaveCount(1); + + await expect(thirdFormTabFields.nth(0).locator('label')).toHaveText('Name check'); + trimText = (await thirdFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // wrong expressions should not be evaluated + expect(trimText).toBe(''); + + // insert a point feature + await page.locator('#map').click({ + position: { + x: 488, + y: 331 + } + }); + + // fill only the name + firstFormTabFields.nth(4).locator('input').fill('text insert'); + + // submit the form + await page.locator('#jforms_view_edition_liz_future_action').selectOption('edit'); + let editFeatureRequestPromiseUpdate = page.waitForResponse(response => response.url().includes('editFeature')); + await page.locator('#jforms_view_edition__submit_submit').click(); + + await editFeatureRequestPromiseUpdate; + await page.waitForTimeout(300); + + // inspect the form + // get geometry + const newForm = page.locator('#jforms_view_edition'); + const geometry = await newForm.locator('#jforms_view_edition_geom').inputValue(); + + expect(geometry.indexOf('POINT(')).toBe(0); + let coords = geometry.match(/\(([^)]+)\)/) || []; + + expect(coords.length).toBe(2); + + const xGeom = coords[1].split(" ")[0]; + + expect(xGeom).toBeTruthy(); + + firstFormTabFields = newForm.locator('div.tab-pane').nth(0).locator('div.control-group'); + await expect(firstFormTabFields.nth(0).locator('label')).toHaveText('id'); + await expect(firstFormTabFields.nth(0).locator('input')).toHaveValue('2'); + + await expect(firstFormTabFields.nth(1).locator('label')).toHaveText('Constant'); + trimText = (await firstFormTabFields.nth(1).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('text string'); + + await expect(firstFormTabFields.nth(2).locator('label')).toHaveText('Geometry X'); + trimText = (await firstFormTabFields.nth(2).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe(xGeom); + + await expect(firstFormTabFields.nth(3).locator('label')).toHaveText('id check'); + trimText = (await firstFormTabFields.nth(3).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + expect(trimText).toBe('2'); + + await expect(firstFormTabFields.nth(4).locator('label')).toHaveText('Name'); + await expect(firstFormTabFields.nth(4).locator('input')).toHaveValue('text insert'); + + secondFormTabFields = await newForm.locator('div.tab-pane').nth(1).locator('div.control-group'); + await expect(secondFormTabFields.nth(0).locator('label')).toHaveText('Wrong expression'); + trimText = (await secondFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // wrong expressions should not be evaluated + expect(trimText).toBe('[%kk[% "ids" %]%]'); + + thirdFormTabFields = await newForm.locator('div.tab-pane').nth(2).locator('div.control-group'); + await expect(thirdFormTabFields.nth(0).locator('label')).toHaveText('Name check'); + trimText = (await thirdFormTabFields.nth(0).locator('input').inputValue()).replace(/\s+/g,' ').trim(); + // wrong expressions should not be evaluated + expect(trimText).toBe('text insert'); + }) +}) diff --git a/tests/qgis-projects/tests/test_embed.gpkg b/tests/qgis-projects/tests/test_embed.gpkg index 1ae5763c5e345f044c186cf1026cb1ad823cd27f..0cedf59f3dc1d146191b51488bcbabf0cff87c1f 100644 GIT binary patch delta 51 zcmZozz}~QcT_!ltC$l6~AuYcsH?c&)m_dMnk&(ecL4kpRL1LneGphuHUbt6d%GMOd GIp+asE)9tQ delta 51 zcmZozz}~QcT_!ltC$l6~AuYcsH?c&)m_dMniHX5ML4kpRL42Z&Gpjg*p7+GYl&vX@ HbIt<*YY+{@ diff --git a/tests/qgis-projects/tests/tests_dataset.sql b/tests/qgis-projects/tests/tests_dataset.sql index 903030e749..d2cad08822 100644 --- a/tests/qgis-projects/tests/tests_dataset.sql +++ b/tests/qgis-projects/tests/tests_dataset.sql @@ -2414,6 +2414,35 @@ CREATE SEQUENCE tests_projects.xss_id_seq ALTER SEQUENCE tests_projects.xss_id_seq OWNED BY tests_projects.xss.id; +-- +-- Name: text_widget_point_edit; Type: TABLE; Schema: tests_projects; Owner: - +-- + +CREATE TABLE tests_projects.text_widget_point_edit ( + id integer NOT NULL, + point_name text, + geom public.geometry(Point, 4326) +); + +-- +-- Name: text_widget_point_edit Type: SEQUENCE; Schema: tests_projects; Owner: - +-- + +CREATE SEQUENCE tests_projects.text_widget_point_edit_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +-- +-- Name: text_widget_point_edit_id_seq; Type: SEQUENCE OWNED BY; Schema: tests_projects; Owner: - +-- + +ALTER SEQUENCE tests_projects.text_widget_point_edit_id_seq OWNED BY tests_projects.text_widget_point_edit.id; + + -- -- Name: attribute_table id; Type: DEFAULT; Schema: tests_projects; Owner: - -- @@ -2925,6 +2954,13 @@ ALTER TABLE ONLY tests_projects.triple_geom ALTER COLUMN id SET DEFAULT nextval( ALTER TABLE ONLY tests_projects.xss ALTER COLUMN id SET DEFAULT nextval('tests_projects.xss_id_seq'::regclass); +-- +-- Name: text_widget_point_edit id; Type: DEFAULT; Schema: tests_projects; Owner: - +-- + +ALTER TABLE ONLY tests_projects.text_widget_point_edit ALTER COLUMN id SET DEFAULT nextval('tests_projects.text_widget_point_edit_id_seq'::regclass); + + -- -- Data for Name: attribute_table; Type: TABLE DATA; Schema: tests_projects; Owner: - -- @@ -3753,7 +3789,6 @@ COPY tests_projects.triple_geom (id, title, geom, geom_l, geom_p) FROM stdin; 1 P2 0101000020E61000009BAFF31C24420F40B0F20C103ECD4540 0102000020E610000003000000F831609D15230F40B6C8ADA872CB45400D2267EAD5350F40CA0ED2F6E3CE4540CD98B4D8D86F0F40013F5C530CCE4540 0103000020E610000001000000040000008CEAFEE73F350F40CE5B430568D2454027CEAF4A464D0F40F4234A1D77D045405E04E2147F7E0F402E327583F7D145408CEAFEE73F350F40CE5B430568D24540 \. - -- -- Data for Name: xss; Type: TABLE DATA; Schema: tests_projects; Owner: - -- @@ -3762,6 +3797,13 @@ COPY tests_projects.xss (id, geom, description) FROM stdin; 1 01010000206A0800000D9D9921FD822741B3C56B7B4DF45741 \. +-- +-- Data for Name: text_widget_point_edit; Type: TABLE DATA; Schema: tests_projects; Owner: - +-- +COPY tests_projects.text_widget_point_edit (id, point_name, geom) FROM stdin; +1 Widget_test 0101000000FBC6B025B7E10E4098DF5229E9CC4540 +\. + -- -- Name: attribute_table_id_seq; Type: SEQUENCE SET; Schema: tests_projects; Owner: - @@ -4288,6 +4330,13 @@ SELECT pg_catalog.setval('tests_projects.triple_geom_id_seq', 1, true); SELECT pg_catalog.setval('tests_projects.xss_id_seq', 1, true); +-- +-- Name: text_widget_point_edit_id_seq; Type: SEQUENCE SET; Schema: tests_projects; Owner: - +-- + +SELECT pg_catalog.setval('tests_projects.text_widget_point_edit_id_seq', 1, true); + + -- -- Name: attribute_table attribute_table_pkey; Type: CONSTRAINT; Schema: tests_projects; Owner: - -- @@ -4912,6 +4961,15 @@ ALTER TABLE ONLY tests_projects.xss ADD CONSTRAINT xss_pkey PRIMARY KEY (id); +-- +-- Name: text_widget_point_edit text_widget_point_edit_pkey; Type: CONSTRAINT; Schema: tests_projects; Owner: - +-- + +ALTER TABLE ONLY tests_projects.text_widget_point_edit + ADD CONSTRAINT text_widget_point_edit_pkey PRIMARY KEY (id); + + + -- -- Name: fki_line_fkey; Type: INDEX; Schema: tests_projects; Owner: - -- diff --git a/tests/qgis-projects/tests/text_widget.qgs b/tests/qgis-projects/tests/text_widget.qgs new file mode 100644 index 0000000000..6b20ca34a3 --- /dev/null +++ b/tests/qgis-projects/tests/text_widget.qgs @@ -0,0 +1,1168 @@ + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + + + + + + + + + _56d2a9bb_3eba_4b84_acc5_501a17280ee3 + text_widget_point_edit_87ab8b55_b3f5_4bf5_ad25_5c540dcd5a97 + + + + + + + + + + + degrees + + 3.80319297969137571 + 43.58432265993102561 + 3.95599911937231985 + 43.65569676700690849 + + 0 + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + 0 + + + + + + + + + + + + + + + + Annotations_ebb7a9e4_e4f0_4569_bca6_df33e99740fd + + + + + Annotations + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + 1 + 1 + 1 + 0 + + + + 1 + 0 + + + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + _56d2a9bb_3eba_4b84_acc5_501a17280ee3 + crs=EPSG:3857&format&type=xyz&url=https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0 + OpenStreetMap + + + + OpenStreetMap + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + OpenStreetMap tiles + + + dataset + OpenStreetMap tiles + OpenStreetMap is built by a community of mappers that contribute and maintain data about roads, trails, cafés, railway stations, and much more, all over the world. + + + + + + Base map and data from OpenStreetMap and OpenStreetMap Foundation (CC-BY-SA). © https://www.openstreetmap.org and contributors. + Open Data Commons Open Database License (ODbL) + Creative Commons Attribution-ShareAlike (CC-BY-SA) + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + 3.86021260686618195 + 43.6008655218749368 + 3.86021260686618195 + 43.6008655218749368 + + + 3.86021260686618195 + 43.6008655218749368 + 3.86021260686618195 + 43.6008655218749368 + + text_widget_point_edit_87ab8b55_b3f5_4bf5_ad25_5c540dcd5a97 + service='lizmapdb' user='lizmap' password='lizmap1234!' sslmode=disable key='id' estimatedmetadata=true srid=4326 type=Point checkPrimaryKeyUnicity='1' table="tests_projects"."text_widget_point_edit" (geom) + text_widget_point_edit + Point edit + + + + text_widget_point_edit + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + postgres + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + tablayout + + + + + + + + + + + + + + + + + [%'text string'%] + + + + [% x(@geometry) %] + + + + [% "id" %] + + + + + + + + + + + + + + [%kk[% "ids" %]%] + + + + + + + + + + + + + [% "name" %] + + + + + + + + + + + + + + + + + + "point_name" + + + + + + + + + + 0 + + + 255 + 255 + 255 + 255 + 0 + 255 + 255 + + + false + + + + + + EPSG:7030 + + + m2 + meters + + + 5 + 2.5 + false + false + false + 1 + 0 + false + false + true + 0 + 255,0,0,255 + + + false + + + true + 2 + + false + + 1 + + + + lizmap_repository + lizmap_user + lizmap_user_groups + + + intranet + + + + + + + + text_widget_point_edit_87ab8b55_b3f5_4bf5_ad25_5c540dcd5a97 + + + 8 + + + + + + + + None + false + true + + + + + + + EPSG:3857 + EPSG:4326 + + 0 + + 3.80319297999999995 + 43.57074346299999945 + 3.9559991189999999 + 43.66927596400000056 + + false + conditions unknown + 90 + + + + 1 + + 8 + text_widget + false + + true + text_widget + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + riccardo + 2024-02-22T09:04:13 + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + diff --git a/tests/qgis-projects/tests/text_widget.qgs.cfg b/tests/qgis-projects/tests/text_widget.qgs.cfg new file mode 100644 index 0000000000..f50b53647a --- /dev/null +++ b/tests/qgis-projects/tests/text_widget.qgs.cfg @@ -0,0 +1,202 @@ +{ + "metadata": { + "qgis_desktop_version": 33403, + "lizmap_plugin_version_str": "4.3.19", + "lizmap_plugin_version": 40319, + "lizmap_web_client_target_version": 30900, + "lizmap_web_client_target_status": "Dev", + "instance_target_url": "http://localhost:8130/", + "instance_target_repository": "intranet" + }, + "warnings": {}, + "debug": { + "total_time": 0.20700000000000002 + }, + "options": { + "projection": { + "proj4": "+proj=longlat +datum=WGS84 +no_defs", + "ref": "EPSG:4326" + }, + "bbox": [ + "3.80319297999999995", + "43.57074346299999945", + "3.9559991189999999", + "43.66927596400000056" + ], + "mapScales": [ + 1, + 1000000000 + ], + "minScale": 1, + "maxScale": 1000000000, + "use_native_zoom_levels": true, + "hide_numeric_scale_value": false, + "initialExtent": [ + 3.80319298, + 43.570743463, + 3.955999119, + 43.669275964 + ], + "popupLocation": "dock", + "pointTolerance": 25, + "lineTolerance": 10, + "polygonTolerance": 5, + "tmTimeFrameSize": 10, + "tmTimeFrameType": "seconds", + "tmAnimationFrameLength": 1000, + "datavizLocation": "dock", + "theme": "dark", + "fixed_scale_overview_map": true, + "dataviz_drag_drop": [] + }, + "layers": { + "text_widget_point_edit": { + "id": "text_widget_point_edit_87ab8b55_b3f5_4bf5_ad25_5c540dcd5a97", + "name": "text_widget_point_edit", + "type": "layer", + "geometryType": "point", + "extent": [ + 3.860212606866182, + 43.60086552187494, + 3.860212606866182, + 43.60086552187494 + ], + "crs": "EPSG:4326", + "title": "Point edit", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "True", + "popupSource": "form", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": false, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "baselayers": { + "id": "baselayers", + "name": "baselayers", + "type": "group", + "title": "baselayers", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "True", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + }, + "OpenStreetMap": { + "id": "_56d2a9bb_3eba_4b84_acc5_501a17280ee3", + "name": "OpenStreetMap", + "type": "layer", + "extent": [ + -20037508.342789244, + -20037508.342789248, + 20037508.342789244, + 20037508.342789248 + ], + "crs": "EPSG:3857", + "title": "OpenStreetMap", + "abstract": "", + "link": "", + "minScale": 1, + "maxScale": 1000000000000, + "toggled": "False", + "popup": "False", + "popupSource": "auto", + "popupTemplate": "", + "popupMaxFeatures": 10, + "popupDisplayChildren": "False", + "popup_allow_download": true, + "legend_image_option": "hide_at_startup", + "groupAsLayer": "False", + "baseLayer": "False", + "displayInLegend": "True", + "group_visibility": [], + "singleTile": "True", + "imageFormat": "image/png", + "cached": "False", + "clientCacheExpiration": 300 + } + }, + "atlas": { + "layers": [] + }, + "locateByLayer": {}, + "attributeLayers": { + "text_widget_point_edit": { + "layerId": "text_widget_point_edit_87ab8b55_b3f5_4bf5_ad25_5c540dcd5a97", + "primaryKey": "id", + "pivot": "False", + "hideAsChild": "False", + "hideLayer": "False", + "custom_config": "False", + "order": 0 + } + }, + "tooltipLayers": {}, + "editionLayers": { + "text_widget_point_edit": { + "layerId": "text_widget_point_edit_87ab8b55_b3f5_4bf5_ad25_5c540dcd5a97", + "snap_vertices": "False", + "snap_segments": "False", + "snap_intersections": "False", + "snap_vertices_tolerance": 10, + "snap_segments_tolerance": 10, + "snap_intersections_tolerance": 10, + "provider": "postgres", + "capabilities": { + "createFeature": "True", + "allow_without_geom": "False", + "modifyAttribute": "True", + "modifyGeometry": "True", + "deleteFeature": "True" + }, + "geometryType": "point", + "order": 0 + } + }, + "layouts": { + "config": { + "default_popup_print": false + }, + "list": [] + }, + "loginFilteredLayers": {}, + "timemanagerLayers": {}, + "datavizLayers": {}, + "filter_by_polygon": { + "config": { + "polygon_layer_id": null, + "group_field": "", + "filter_by_user": false + }, + "layers": [] + }, + "formFilterLayers": {} +} From 3cece8e03570593a69f3ae54e1252a6d1e61484e Mon Sep 17 00:00:00 2001 From: Riccardo Beltrami Date: Tue, 10 Sep 2024 09:01:38 +0200 Subject: [PATCH 2/3] adjust tests specs --- tests/end2end/playwright/edition-form.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end/playwright/edition-form.spec.js b/tests/end2end/playwright/edition-form.spec.js index ecef10e8ae..78652b7f68 100644 --- a/tests/end2end/playwright/edition-form.spec.js +++ b/tests/end2end/playwright/edition-form.spec.js @@ -562,7 +562,7 @@ test.describe('Text widget in a form', () => { // edit the feature let editFeatureRequestPromise = page.waitForResponse(response => response.url().includes('editFeature')); - await page.locator('.lizmapPopupContent > .lizmapPopupSingleFeature').nth(0).locator("lizmap-feature-toolbar").first().locator(".feature-toolbar button[data-original-title='Edit']").click(); + await page.locator('.feature-toolbar > button:nth-child(5)').click(); await editFeatureRequestPromise; // the text widgets in the form should be filled as in the popup From 5897e39aab2e42fecdfc5a222532985e6a3200b8 Mon Sep 17 00:00:00 2001 From: Riccardo Beltrami Date: Mon, 30 Sep 2024 17:48:24 +0200 Subject: [PATCH 3/3] restore embed gpkg test file --- tests/qgis-projects/tests/test_embed.gpkg | Bin 118784 -> 118784 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/qgis-projects/tests/test_embed.gpkg b/tests/qgis-projects/tests/test_embed.gpkg index 0cedf59f3dc1d146191b51488bcbabf0cff87c1f..1ae5763c5e345f044c186cf1026cb1ad823cd27f 100644 GIT binary patch delta 51 zcmZozz}~QcT_!ltC$l6~AuYcsH?c&)m_dMniHX5ML4kpRL42Z&Gpjg*p7+GYl&vX@ HbIt<*YY+{@ delta 51 zcmZozz}~QcT_!ltC$l6~AuYcsH?c&)m_dMnk&(ecL4kpRL1LneGphuHUbt6d%GMOd GIp+asE)9tQ