Skip to content

Commit

Permalink
Merge pull request #251 from aodn/features/6116-spatial-map-focus-det…
Browse files Browse the repository at this point in the history
…ail-map

Features/6116 spatial map focus detail map
  • Loading branch information
NekoLyn authored Jan 5, 2025
2 parents 2484074 + a351caa commit 50ba766
Show file tree
Hide file tree
Showing 29 changed files with 625 additions and 449 deletions.
5 changes: 0 additions & 5 deletions .env.config.edge
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@
# The access token cannot store in secret store due to static website nature, the vite build with correct mode
# will read the target env value and therefore need to store it in git
VITE_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoiaW1vcy1hb2RuIiwiYSI6ImNsdTY3cHFvdTA0b3gyamwzMHhtNTNwZGkifQ.8PoBlJyFaM06mbI7rv4NYA

# Score to control your search relevance on query (or fuzzy) search, the higher the number the more accruate result
# return, but fewer result hit. The value will increase automatically if user doing text search, the longer the text the higher
# the number increase, so you think this as a min score of empty string search. This value do not applies to filter only search
VITE_ELASTIC_RELEVANCE_SCORE=1.8
5 changes: 0 additions & 5 deletions .env.config.prod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@
# The access token cannot store in secret store due to static website nature, the vite build with correct mode
# will read the target env value and therefore need to store it in git
VITE_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoiaW1vcy1hb2RuIiwiYSI6ImNseW1jNHA5ZDBoZWMya29qZmV5YzBxMzIifQ.CnpEdlEkB7-RZSahxo5uAQ

# Score to control your search relevance on query (or fuzzy) search, the higher the number the more accruate result
# return, but fewer result hit. The value will increase automatically if user doing text search, the longer the text the higher
# the number increase, so you think this as a min score of empty string search. This value do not applies to filter only search
VITE_ELASTIC_RELEVANCE_SCORE=1.8
5 changes: 0 additions & 5 deletions .env.config.staging
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@
# The access token cannot store in secret store due to static website nature, the vite build with correct mode
# will read the target env value and therefore need to store it in git
VITE_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoiaW1vcy1hb2RuIiwiYSI6ImNsdTY4NHJ2bTBtOWQya3Vmd2lwN3ZxdWEifQ.tM9icQJaO6K__pelwDpDvg

# Score to control your search relevance on query (or fuzzy) search, the higher the number the more accruate result
# return, but fewer result hit. The value will increase automatically if user doing text search, the longer the text the higher
# the number increase, so you think this as a min score of empty string search. This value do not applies to filter only search
VITE_ELASTIC_RELEVANCE_SCORE=1.8
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ To set up this project locally, follow these steps using Yarn and Vite for a smo
## Prerequisites

- Node.js installed on your system with version 18.x || >=20.0.0 (you can use [nvm](https://github.com/nvm-sh/nvm) for changing the node version).
- Current work node is 18.19.1
- Npm installed on your system with version >=8.0.0

## Installation
Expand All @@ -26,6 +27,12 @@ cd <project-name>
3. **Install the project dependencies:**

```bash
# Install nvm (you may want a later version)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

nvm install 18.20.5
nvm use 18.20.5

npm install -g corepack
yarn install
```
Expand Down
2 changes: 1 addition & 1 deletion playwright/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the official Playwright image
FROM mcr.microsoft.com/playwright/python:v1.43.0-jammy
FROM mcr.microsoft.com/playwright/python:v1.47.0-jammy

WORKDIR /app

Expand Down
3 changes: 3 additions & 0 deletions playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ To install `Conda`, please refer to the [official guide](https://conda.io/projec
poetry install
```
6. Install all supported browsers with system dependencies:

```bash
# If this command still fail with dependency lib, you may need to upgrade your lib or playwright version
playwright install --with-deps
```

7. Configure project related settings:

a) Open the `settings.toml` file
Expand Down
10 changes: 5 additions & 5 deletions playwright/pages/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class BasePage:
def __init__(self, page: Page):
self.page = page
load_common_js_functions(page)
load_common_js_functions(self.page)

# Common locators
self.body = page.locator('body')
Expand Down Expand Up @@ -82,10 +82,10 @@ def get_collapse_item_title(self, title: str) -> Locator:
"""Returns the given collapse item title"""
return self.page.get_by_test_id(f'collapse-item-{title}')

def scroll_To_Bottom(self) -> None:
def scroll_to_bottom(self) -> None:
"""Scroll to the bottom of the page"""
execute_js(self.page, 'scrollToBottom')
execute_js(self.page, 'window.__custom.scrollToBottom')

def get_Page_Scroll_Y(self) -> int:
def get_page_scroll_y(self) -> int:
"""Get the current page scroll Y position"""
return execute_js(self.page, 'getPageScrollY')
return execute_js(self.page, 'window.__custom.getPageScrollY')
5 changes: 5 additions & 0 deletions playwright/pages/js_scripts/common_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ function scrollToBottom() {
function getPageScrollY() {
return window.scrollY;
}

window.__custom = {
scrollToBottom: scrollToBottom,
getPageScrollY: getPageScrollY,
};
1 change: 0 additions & 1 deletion playwright/pages/js_scripts/js_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def load_js_functions(page: Page, js_file_name: str) -> None:
js_code = file.read()
page.add_init_script(js_code)


def load_map_js_functions(page: Page) -> None:
load_js_functions(page, 'map_functions.js')

Expand Down
Loading

0 comments on commit 50ba766

Please sign in to comment.