Skip to content

Commit dd5eea0

Browse files
committed
Merge branch 'main' into add-documentation-content-search-help
2 parents ff97bae + 5370e6a commit dd5eea0

File tree

12 files changed

+217
-86
lines changed

12 files changed

+217
-86
lines changed

docs/PxWeb2/documentation/customization.md

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ Replace the font files in the `fonts` directory. Keep file names.
229229

230230
Make sure you have the proper license to self-host fonts.
231231

232+
### Change logo and favicon
233+
To change the logo/favicon in PxWeb replace svgs in the image folder. The names must be the same.
234+
235+
For image replace `images/logo.svg` with your own logo.
236+
Replace `images/favicon.ico` / `images/favicon-darkmode.svg` with your own favicon.
237+
238+
The svg **must** include viewbox and width/height attributes for it to be rendered correctly.
239+
232240
### Adjust or fix text / translations
233241

234242
Edit the relevant `locales/<lang>/translation.json`.
@@ -248,6 +256,69 @@ Keys reflect where in the UI a string is used. Only modify values.
248256
}
249257
```
250258

259+
### Change date format in translation file
260+
261+
Edit the relevant `locales/<lang>/translation.json` file.
262+
We have two date formats defined under `date` in translation files - `simple_date` and `simple_date_with_time`.
263+
264+
Change the format options as needed. **PxWeb2** uses `Intl.DateTimeFormat` for date formatting. See documentation for options here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
265+
266+
Here is an examples configuration used for english and norwegian:
267+
268+
??? tip "english date formats"
269+
```json
270+
"date": {
271+
"simple_date": "{{value, datetime}}",
272+
"simple_date_with_time": "{{value, datetime(year: 'numeric'; month: 'numeric'; day: 'numeric'; hour: 'numeric'; minute: 'numeric')}}"
273+
}
274+
```
275+
276+
Example of how `simple_date_with_time` for english is displayed in PxWeb2 UI:
277+
`2/21/2025, 8:00 AM`
278+
279+
??? tip "norwegian date formats"
280+
```json
281+
"date": {
282+
"simple_date": "{{value, datetime(day: '2-digit'; month: '2-digit'; year: 'numeric')}}",
283+
"simple_date_with_time": "{{value, datetime(year: 'numeric'; month: '2-digit'; day: '2-digit'; hour: 'numeric'; minute: 'numeric')}}"
284+
}
285+
```
286+
287+
Example of how `simple_date_with_time` for norwegian is displayed with two digit configuration in PxWeb2 UI:
288+
`21.02.2025, 08:00`
289+
290+
### Override separators in number formatting per language
291+
Edit the relevant `locales/<lang>/translation.json` file.
292+
We have defined multiple number formatting rules under `number` in translation files. Here are some expamples of number formats that are used:
293+
294+
??? tip "number formats"
295+
```json
296+
"number": {
297+
"simple_number": "{{value, pxNumber}}",
298+
"simple_number_with_zero_decimal": "{{value, pxNumber(minimumFractionDigits: 0; maximumFractionDigits: 0;)}}",
299+
"simple_number_with_one_decimal": "{{value, pxNumber(minimumFractionDigits: 1; maximumFractionDigits: 1;)}}",
300+
"simple_number_with_two_decimals": "{{value, pxNumber(minimumFractionDigits: 2; maximumFractionDigits: 2;)}}",
301+
}
302+
```
303+
304+
- `simple_number`: Default number formatting.
305+
- `simple_number_with_zero_decimal`: Number formatting with no decimal places.
306+
- `simple_number_with_one_decimal`: Number formatting with one decimal place.
307+
- `simple_number_with_two_decimals`: Number formatting with two decimal places.
308+
309+
The group and decimal separators are determined by the language locale. However, if you want to customize the number formatting further, you can add additional options to the `pxNumber` formatter.
310+
311+
To override decimal add `decimalSeparator` to the `number_format` object. Likewise, to override group separator add `thousandSeparator` to the `number_format` object.
312+
313+
If you need to add space as a group separator, you add the value `nbsp` for non-breaking space or `nnbsp` for narrow non-breaking space, e.g. `thousandSeparator: 'nbsp'`.
314+
315+
Here is an example of how to override both decimal and group separators for simple_number_with_two_decimals. Use `,` as decimal separator and non-breaking space as group separator:
316+
```json
317+
"number": {
318+
"simple_number_with_two_decimals": "{{value, pxNumber(minimumFractionDigits: 2; maximumFractionDigits: 2; decimalSeparator: ','; thousandSeparator: 'nbsp';)}}",
319+
}
320+
```
321+
251322
### Hide or show the default language in the URL
252323

253324
Toggle:
@@ -354,15 +425,50 @@ root/content
354425
"detailsSection": {
355426
"enabled": true,
356427
"detailHeader": "More about PxWeb",
357-
"detailContent": []
428+
"detailContent": [
429+
{
430+
"textBlock": {
431+
"header": "When to use this section",
432+
"text": "This is an optional section that can be used for content that may be useful for some users, but is not essential for everyone. Key information that all users need to see should always appear in the lead paragraph."
433+
}
434+
},
435+
{
436+
"links": {
437+
"header": "Useful resources",
438+
"items": [
439+
{
440+
"text": "Example link 1",
441+
"url": "#"
442+
},
443+
{
444+
"text": "Example link 2 (open in new tab)",
445+
"url": "#",
446+
"openInNewTab": true
447+
}
448+
]
449+
}
450+
}
451+
]
358452
},
359453
"noResultSearchHelp": {
360454
"enabled": true,
361455
"helpText": []
362456
}
363457
},
364458
"footer": {
365-
"columns": []
459+
"columns": [
460+
{
461+
"header": "This is a header",
462+
"links": [
463+
{
464+
"text": "Link text",
465+
"url": "https://your.link.here",
466+
"external": true
467+
},
468+
{ "text": "Contact us", "url": "mailto:[email protected]" }
469+
]
470+
}
471+
]
366472
}
367473
}
368474
```
@@ -374,14 +480,16 @@ root/content
374480
`enabled` is `true`, the application renders the **`DetailsSection` component**.
375481
This section can contain multiple entries, and each entry may be either a
376482
`textBlock` (with `header` and `text`) or a `links` block (with `header` and a
377-
list of `items`).
483+
list of `items`). Links described in `items` have `text`, `url`, and an optional
484+
`openInNewTab` boolean. If `openInNewTab` is `true`, the link opens in a new
485+
browser tab.
378486
- **startPage.noResultSearchHelp** – Optional section displayed below
379487
the “no results” message when no tables match the search or filters.
380488
When `enabled` is `true`, each string in the `helpText` array is shown
381489
as a separate list item under a help heading.
382490

383491
- **footer**
384-
One or more footer columns with `header` and list of `links`.
492+
One or more footer columns with `header` and list of `links`. If links have `external` set to `true`, they automatically will have the icon for external links and will open in a new tab. See example above.
385493

386494
This setup allows administrators to adjust localized content (text and links)
387495
for each language without modifying the application code.
Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# Install PxWebApi 2.0 on your IIS server
1+
# Install PxWeb 2 on your IIS server
22

3-
This instruction guides you in how to install PxWeb 2.0 on IIS.
3+
This instruction guides you in how to install PxWeb 2 on IIS.
44

55
## Prerequisites
66

77
- A supported Windows server with IIS installed.
8-
- ApiUrl to your PxWebapi2 installation.
8+
- The [URL Rewrite module](https://www.iis.net/downloads/microsoft/url-rewrite) must be installed on your IIS.
9+
- ApiUrl to your PxWebApi 2 installation.
910
If your tables endpoint is at `https://your.api.server/PxWeb/api/v2/tables`
1011
then your ApiUrl is `https://your.api.server/PxWeb/api/v2` (omit a trailing slash, one is added automatically)
1112

@@ -14,23 +15,53 @@ This instruction guides you in how to install PxWeb 2.0 on IIS.
1415
1. Download the [zip file for the latest release](https://github.com/pxtools/PxWeb2/releases/latest) from GitHub.
1516
It is found inside the Asserts heading.
1617
Make sure to _Unblock_ it if its block by right clicking on it in _File Explorer_ and check the `Unblock` checkbox.
17-
1. Put the contents of the zip file to the location of your choice. E.g `C:\inetpub\wwwroot\pxweb2`.
18-
1. Adjust `baseApplicationPath` and `apiUrl` in `config\config.js`:
18+
2. Put the contents of the zip file to the location of your choice. E.g `C:\inetpub\wwwroot\pxweb2`.
19+
3. Adjust `baseApplicationPath` and `apiUrl` in `config\config.js`:
1920

2021
```js
2122
baseApplicationPath: "/pxweb2/"
2223

2324
apiUrl: "your api url"
2425
```
2526

26-
1. In `index.html`, adjust the `<base>` tag:
27+
4. In `index.html`, adjust the `<base>` tag:
2728

2829
```html
2930
<base href="/pxweb2/">
3031
```
3132

32-
1. I didnt need this: Ensure the web server rewrites (if needed) static file requests correctly to that subpath.
33+
5. In `web.config`, adjust the `Content-Security-Policy` to allow calls to your PxWebApi 2 installation. Within the `Content-Security-Policy` replace the text `https://enter-your-api-domain-here` with the domain of your PxWebApi (for example https://api.scb.se):
3334

34-
1. In IIS find the folder and convert it to application. ( Concider using a separate Application pool for this :-) )
35+
```html
36+
<add name="Content-Security-Policy" value="default-src 'self'; connect-src 'self' https://api.scb.se; script-src 'self'" />
37+
```
38+
39+
1. In IIS find the folder and convert it to an application. (Consider using a separate Application pool for this)
3540

3641
1. Open "http(s)://"server adress"/pxweb2 .
42+
43+
## Troubleshooting
44+
45+
### Problem running PxWeb on localhost
46+
47+
If you are trying to run PxWeb directly on the server under localhost you might get an error looking like this in the console of your browser:
48+
49+
```
50+
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
51+
```
52+
53+
#### Solution
54+
55+
Change localhost in the URL to the computer name of the server.
56+
57+
### PxWeb refuses to connect to PxWebApi
58+
59+
If you get an error message looking like this in the console of your browser:
60+
61+
```
62+
Refused to connect to 'https://your-api-url' because it violates the following Content Security Policy directive: "connect-src 'self' https://enter-your-api-domain-here".
63+
```
64+
65+
#### Solution
66+
67+
You need to enter the domain of your PxWebApi in the Content Security Policy section in web.config, see step 5 of the installation steps above.

docs/PxWeb2/project/Solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# PxWeb solution
2-
In this project, we have made some choices about how we will work in the project across two countries, in order to create opportunities for other countries to contribute in the long term with both development and user testing of PxWeb 2.0. In addition, we have made some choices to find the best solution for installing PxWeb. All this to reach the main goal to create a user-friendly PxWeb.
2+
In the project, we have made some choices about how we will work in the project across two countries, in order to create opportunities for other countries to contribute in the long term with both development and user testing of PxWeb 2.0. In addition, we have made some choices to find the best solution for installing PxWeb. All this to reach the main goal to create a user-friendly PxWeb.
33
## WCAG and Search Engine Optimization (SEO)
44
- The new interface will follow the rules for A and AA in [WCAG 2.1](https://www.w3.org/TR/WCAG21/)
55
- SEO is the use of methods that achieve better visibility or "ranking" on search engines result page.
@@ -15,7 +15,7 @@ It will be possible to change
1515
- corner radius of the elements in the interface.
1616
## Open source at GitHub
1717
The new interface will be able do install directly from GitHub. Also documentation will be found here.
18-
[PxTools at GitHub](https://github.com/pxtools)
18+
[PxTools at GitHub](https://www.pxtools.net/documentation/overview/)
1919
## Usertest
2020
We are following the UX design process in this project.
2121
![The Ux design process](https://github.com/PxTools/PxWeb2/assets/81364833/8534bfdb-1d0c-49ef-8f2b-5b59357a37bf)

docs/PxWeb2/project/overview.md

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,25 @@
1-
# Project overview
1+
# Introduction to PxWeb
22
## Background
3-
The user interface in PxWeb can no longer be further developed effectively due to technological limitations, while the users needs and expectations are constantly changing. Statistics Sweden and Statistics Norway will therefore together create a new user interface based on PxWebApi 2.0
4-
5-
## New user interface for PxWeb
6-
- PxWebApi 2.0 Beta was released i March
7-
- The API gives us the opportunity to make a new user interface for PxWeb on a new technical platform
8-
- The project is a cooperation between Statistics Sweden and Statistics Norway
9-
10-
## Two project goals
11-
- The project will work on a new userfriendly interface based on PxWebApi 2.0 during 2024 - 2025 with the launch of the first test-version in mid-2024
12-
13-
- The project will test and establish good and sustained collaboration processes between SCB and SSB at both operational level and management level in the further development of PX-tools
14-
15-
3+
PxWeb is an application for disseminating statistics in dynamic tables from an SQL or file-based database on the web. The user interface in the current version of PxWeb could no longer be effectively developed due to technological limitations, and users needs and expectations are constantly changing so Statistics Sweden and Statistics Norway jointly initiated a project in January 2024. The aim of the project was to create a new user interface based on PxWebApi 2 and was released in its first version in October 2025.
4+
## Two goals of the Project (January 2024 - October 2025)
5+
The project had two goals
6+
- A new user-friendly interface for PxWeb based on PxWebApi 2
7+
- Test and establish effective and sustainable collaboration processes between Statistics Sweden, SCB and Statistics Norway, SSB at both operational level and management level in the further development of PX-tools
168
## Organization
17-
189
### Steering group
19-
The steering group consists of managers at Communication and IT in SCB and SSB.
20-
10+
The steering group consist of managers at Communication and IT in SCB and SSB.
2111
### Project team
22-
The team has participants from both Statistics Sweden and Statistics Norway.
12+
The team had participants from both Statistics Sweden and Statistics Norway.
2313
The team is set up with
2414
- Project leader
2515
- Scrum master
2616
- Architects
27-
- Designer (UX and UI)
17+
- UX/UI Designer
2818
- Developers
2919
- Specialists
30-
- Tech lead
20+
- Technical lead
3121
- Test leader
3222
- Testers
33-
34-
### Cooperation
35-
The other Nordic countries will be involved in tessting and participate at the demos.
36-
37-
## Contact for questions and comments
38-
Project leader: Kristin Glomsås, Statistics Norway [[email protected]](mailto:[email protected])
39-
40-
Scrum master: Åsa Arrhén, Statistics Sweden [[email protected]](mailto:[email protected])
41-
42-
43-
44-
45-
23+
## Contact for questions and comments
24+
Kristin Glomsås, Statistics Norway [[email protected]](mailto:[email protected])
25+
Åsa Arrhén, Statistics Sweden [[email protected]](mailto:[email protected])

docs/PxWeb2/project/plans.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
11
# Plans
22

3-
The project launched two test versions in June and December 2024 and from then and on the new interface of PxWeb 2.0 is updated every third Monday after the demo.
4-
The goal is to deliver a version of PxWeb 2.0 based on PxWebApi 2.0 during September 2025.
5-
6-
## PxWebApi 2.0 Release end of August 2025
7-
- Follows JSON-stat2 format
8-
- Save to file
9-
- Saved query
10-
- Pivot
3+
## Remaining to develop 2025
4+
- Show PxWebApi 2 in PxWeb
5+
- Button to improve table layout
6+
- Freeze table head
7+
- Improve search at start page (search for content in tables)
8+
- Search in beginning of words in variable list
9+
- Hide empty rows from table
10+
- Chose to show code or text
11+
- Manual pivoting
12+
- Possibility for text and links in Help
13+
- Possibility for own link in logo
14+
- WCAG-fixes
15+
- Saved query as alternative to the algorithm (documentation)
16+
17+
## Remaining to develop after 2025 in PxWeb 2
18+
- Graph
19+
- Hierarchy
20+
- Sort order
21+
- Sum
22+
- more...
1123

12-
## PxWeb 2.0 Release end of September 2025
24+
## PxWeb 2 Release October 2025
1325
- Startpage
1426
- Save to file
1527
- Saved query
1628
- URL and breadcrumb
17-
- Saved queary as alternative to the algorithm
1829
- Pivoting
1930
- Head and footer
20-
- Show PxWebApi 2.0
2131

22-
## Remaining to develop after September 2025 in PxWeb 2.0
23-
- Graph
24-
- code/text
25-
- Hierarchy
26-
- Sort order
27-
- Sum
32+
## PxWebApi 2.0 Release September 2025
33+
- Follows JSON-stat2 format
34+
- Save to file
35+
- Saved query
36+
- Pivot
37+
2838
-------------------------------------------------------------------------------------------
2939
## PxWeb 2.0 testversion December 2024
3040
- Comprehensible table at first glance - Using an algorithm to show an understandable table the first time you look at it

docs/PxWeb2/project/process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Scrum process
1+
# Process in the project (January 2024 - October 2025)
22
- The project group work in sprints of three weeks.
33
- The group follow the scrum rituals with sprintplanning, refinement, retro and daily stand-up.
44
- The sprints end with a demo (sprint review) on Monday every third week at twelve o'clock.

docs/PxWeb2/project/try.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# Follow the development of PxWeb 2.0
2-
The new interface is updated every third Monday after the demo. Follow the development on these pages.
3-
## Tables from the Swedish database
4-
- [Table638](https://test.pxweb2.pages.dev/sv/table/tab638)
5-
- [Table5737](https://test.pxweb2.pages.dev/sv/table/TAB5737)
6-
- [Table4246](https://test.pxweb2.pages.dev/sv/table/TAB4246)
1+
# Follow the development of PxWeb 2
2+
3+
## Tables from Statistics Sweden database
4+
- [Database from Statistics Sweden](https://test.pxweb2.pages.dev/sv/)
5+
6+
## Tables from Statistics Norway database
7+
- [Database from Statistics Norway](https://test-ssb.pxweb2.pages.dev/no/)
78

89
## Try it with your own data
9-
You are free to test the database with your own data. It works both with px-files and cnmm database
10-
[How to make a local installation](../documentation/docker.md)
10+
You are free to test PxWeb2 with your own data. It works both with px-files and cnmm database
11+
- [Read the documentation](https://www.pxtools.net/documentation/overview/)
12+
1113

docs/PxWebApi/documentation/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Configuring PxWebApi 2.0
1+
# Configuring PxWebApi 2
22
The configuration is split into several different files, each with a specific purpose. The main file you will need to modify is `appsettings.json`.
33

44
## appsettings.json

0 commit comments

Comments
 (0)