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

Publisher sidebar reactification #2759

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
01724bc
Remove cesium hacks, and add webpack-import-meta-loader to webpack/co…
tuomari Dec 10, 2024
1b68b60
return decoded value from url cleanup function
DenverCoder544 Dec 12, 2024
5ad5990
add unit tests
DenverCoder544 Dec 12, 2024
0d255e1
Merge pull request #2762 from DenverCoder544/layerhandler_url_clean_e…
ZakarFin Dec 13, 2024
1dec812
Update webpack/config.js
ZakarFin Dec 13, 2024
6ab5939
Merge pull request #2761 from tuomari/cesium-hack-master
ZakarFin Dec 13, 2024
b9fabe1
Bump dompurify from 2.3.6 to 2.5.4
dependabot[bot] Dec 2, 2024
e0b82c5
Bump dompurify to latest 2.5.x
ZakarFin Dec 13, 2024
c8e971f
return decoded value from url cleanup function
DenverCoder544 Dec 12, 2024
46bf6f3
add unit tests
DenverCoder544 Dec 12, 2024
c300f85
Remove cesium hacks, and add webpack-import-meta-loader to webpack/co…
tuomari Dec 10, 2024
f6cb258
Update webpack/config.js
ZakarFin Dec 13, 2024
0f98f0b
Make ESLint happy
ZakarFin Dec 13, 2024
ced6021
Bump version
ZakarFin Dec 13, 2024
7e7cacd
Merge hotfix
ZakarFin Dec 13, 2024
9c5d445
Add notes
ZakarFin Dec 13, 2024
1d0bde9
Fix typos
ZakarFin Dec 16, 2024
beff0f4
Merge pull request #2764 from ZakarFin/typo-fixes
ZakarFin Dec 16, 2024
0ce7da6
Merge branch 'hotfix/2.14.1' into develop
ZakarFin Dec 16, 2024
2ea5362
Create codeql.yml
ZakarFin Dec 17, 2024
ab1bb8d
Enable code analysis
ZakarFin Dec 17, 2024
aace79e
Merge pull request #2765 from oskariorg/ZakarFin-patch-1
ZakarFin Dec 17, 2024
e174a93
Merge
ZakarFin Dec 17, 2024
38fee7c
Merge branch 'master' into develop
ZakarFin Dec 17, 2024
5328a86
publishersidebar es-class and first jquery panel added
DenverCoder544 Nov 28, 2024
e640a58
shovel in the rest of the panels (still jQuery)
DenverCoder544 Nov 29, 2024
b325d34
refactor the content dom node
DenverCoder544 Dec 2, 2024
0329473
move jQuery to instance instead of publishersidebar
DenverCoder544 Dec 2, 2024
4fbe4e7
bring in the rest of the publisher sidebar functionalities
DenverCoder544 Dec 2, 2024
4a00820
validation error message react-based modal
DenverCoder544 Dec 2, 2024
ad68888
replace confirm dialog react implementation
DenverCoder544 Dec 3, 2024
e14bf6b
add handler class and utilise localeprovider
DenverCoder544 Dec 3, 2024
b83dc75
react collapse + general info panel as first reactified panel - first…
DenverCoder544 Dec 5, 2024
7fc8b70
remove method
DenverCoder544 Dec 5, 2024
889db17
add react - buttons and localeprovider and refactor sidebar content
DenverCoder544 Dec 10, 2024
182a980
map preview - panel reactified
DenverCoder544 Dec 11, 2024
6b37051
avoid apocalypse by removing additional blank line from file
DenverCoder544 Dec 11, 2024
2548529
general info form refactored - handler + function component
DenverCoder544 Dec 18, 2024
202acff
remove unneeded brackets and proptypes
DenverCoder544 Dec 18, 2024
0207b62
panel map preview reactification
DenverCoder544 Dec 19, 2024
933747e
remove console.log
DenverCoder544 Dec 19, 2024
b7980f9
remove jquery impl and update import
DenverCoder544 Dec 19, 2024
77ff4f5
remove console.logs
DenverCoder544 Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "master", "develop" ]
paths-ignore:
- 'tests/jest/fileTransformer.js'
pull_request:
branches: [ "master", "develop" ]
paths-ignore:
- 'tests/jest/fileTransformer.js'
schedule:
- cron: '36 8 * * 0'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
11 changes: 11 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release Notes

## 2.14.1

For a full list of changes see:
https://github.com/oskariorg/oskari-frontend/milestone/52?closed=1

Fixed an issue where layers with URL templates couldn't be added with the admin UI.

Removed postinstall script that did not work properly when dev-mode was not used. It was replaced with a Babel-plugin that can handle Cesium quirks.

Updated dompurify 2.3.6 -> 2.5.8

## 2.14.0

For a full list of changes see:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export const cleanUrl = (url) => {
keysToDelete.forEach((key) => urlObj.searchParams.delete(key));

const parts = urlObj.toString().split('://');
if (parts.length > 1) {
return parts[1];
}

return urlObj.toString();
const retValString = parts.length > 1 ? parts[1] : urlObj.toString();
const decoded = decodeURIComponent(retValString);
return decoded;
};
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,13 @@ describe('ServiceUrlInputHelper Tests ', () => {
const url = 'www.com/';
expect(cleanUrl(url)).toBe(url);
});

it('should NOT encode URL params', () => {
const url = 'avoin-karttakuva.maanmittauslaitos.fi/kiinteisto-avoin/tiles/wmts/1.0.0/kiinteistojaotus/default/v3/ETRS-TM35FIN/{z}/{y}/{x}.pbf';
expect(cleanUrl(url)).toBe(url);

const url2 = 'www.com/?first=1&SECOND=2&thiRd=3';
expect(cleanUrl(url2)).toBe(url2);
});
});
});
2 changes: 1 addition & 1 deletion bundles/catalogue/metadata/resources/locale/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Oskari.registerLocalization({
"basic": "Grundläggande information",
"inspire": "Inspire metadata",
"jhs": "ISO 19115 metadata",
"quality": "Data kvalität",
"quality": "Datakvalitet",
"actions": "Handlingar"
},
"actions": {
Expand Down
2 changes: 1 addition & 1 deletion bundles/catalogue/metadataflyout/resources/locale/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Oskari.registerLocalization({
"abstract": "Grundläggande information",
"inspire": "Inspire metadata",
"jhs": "ISO 19115 metadata",
"quality": "Data kvalität",
"quality": "Datakvalitet",
"actions": "Handlingar",
"xml": "ISO 19139 XML fil",
"coverage": {
Expand Down
89 changes: 89 additions & 0 deletions bundles/framework/publisher2/handler/PanelGeneralInfoHandler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { StateHandler, controllerMixin } from 'oskari-ui/util';
import { PUBLISHER_BUNDLE_ID } from '../view/PublisherSideBarHandler';

class UIHandler extends StateHandler {
constructor () {
super();
this.state = {
name: null,
domain: null,
language: null
};
}

init (data) {
const { name, domain, language } = data?.metadata || {};
this.updateState({
name: name || null,
domain: domain || null,
language: language || Oskari.getLang()
});
}

getValues () {
return {
metadata: {
...this.getState()
}
};
};

onChange (key, value) {
const { oldState } = this.getState();
const newState = {
...oldState
};
newState[key] = value;
this.updateState({
...newState
});
}

validate () {
let errors = [];
const { name, domain } = this.state;
errors = errors.concat(this.validateName(name));
errors = errors.concat(this.validateDomain(domain));
return errors;
}

validateName (value) {
const errors = [];
const sanitizedValue = Oskari.util.sanitize(value);
if (!value || !value.trim().length) {
errors.push({
field: name,
error: Oskari.getMsg(PUBLISHER_BUNDLE_ID, 'BasicView.error.name')
});
return errors;
}
if (sanitizedValue !== value) {
errors.push({
field: name,
error: Oskari.getMsg(PUBLISHER_BUNDLE_ID, 'BasicView.error.nameIllegalCharacters')
});
return errors;
}
return errors;
}

validateDomain (name, value) {
const errors = [];
if (value && value.indexOf('://') !== -1) {
errors.push({
field: name,
error: Oskari.getMsg(PUBLISHER_BUNDLE_ID, 'BasicView.error.domainStart')
});
return errors;
}
return errors;
}
}

const wrapped = controllerMixin(UIHandler, [
'validate',
'getValues',
'onChange'
]);

export { wrapped as PanelGeneralInfoHandler };
Loading
Loading