forked from GeoNodeUserGroup-DE/geonode-blueprint-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
249 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
from django.apps import AppConfig | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def run_setup_hooks(*args, **kwargs): | ||
from django.conf import settings | ||
|
||
settings.MAPSTORE_TRANSLATIONS_PATH += ( | ||
"/static/mapstore/ea-translations", | ||
) | ||
|
||
|
||
class LitterAssessmentConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'litter_assessment' | ||
type = 'GEONODE_APP' | ||
|
||
def ready(self): | ||
super().ready() | ||
run_setup_hooks() | ||
|
||
|
||
default_app_config = 'litter_assessment.LitterAssessmentConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
node_modules/ | ||
node/ | ||
dist/ | ||
build/ | ||
target/ | ||
*.sublime-* | ||
npm-debug.log | ||
package-lock.json | ||
coverage/ | ||
web/client/libs/Cesium/ | ||
web/cesium.zip | ||
web/.classpath | ||
web/.project | ||
.idea | ||
*.iml | ||
_site | ||
.sass-cache | ||
.jekyll-metadata | ||
*.lock | ||
docs/developer-guide/reference/ | ||
web/client/mapstore/docs/ | ||
web/docs | ||
.classpath | ||
.project | ||
.settings/ | ||
debug.log | ||
.vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (c) 2015-2023, 52°North GmbH | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are | ||
permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list | ||
of conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | ||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | ||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The views and conclusions contained in the software and documentation are those | ||
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the MapStore2 Project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"plugins": [ | ||
{ | ||
"name": "LitterAssessmentPlugin" | ||
} | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
geonode/apps/litter_assessment/client/assets/translations/data.en-US.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"locale": "en-US", | ||
"messages": { | ||
"extension": { | ||
"message": "Message!" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
geonode/apps/litter_assessment/client/assets/translations/data.it-IT.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"locale": "it-IT", | ||
"messages": { | ||
"extension": { | ||
"message": "Messaggio!" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
geonode/apps/litter_assessment/client/js/extension/assets/style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* extension css */ | ||
|
||
.extension { | ||
position: absolute; | ||
background-color: red; | ||
top: 50%; | ||
left: 50%; | ||
padding: 8px; | ||
transform: translate(-50%, -50%); | ||
z-index: 100000; | ||
font-size: 100px; | ||
} |
30 changes: 30 additions & 0 deletions
30
geonode/apps/litter_assessment/client/js/extension/plugins/Extension.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2021, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import Message from "@mapstore/framework/components/I18N/Message"; | ||
import '@js/extension/assets/style.css'; | ||
|
||
function Extension() { | ||
return ( | ||
<div className="extension"> | ||
<Message msgId="extension.message" /> | ||
</div> | ||
); | ||
} | ||
|
||
const ConnectedExtension = connect(() => ({}))(Extension); | ||
|
||
export default { | ||
name: __MAPSTORE_EXTENSION_CONFIG__.name, | ||
component: ConnectedExtension, | ||
reducers: {}, | ||
epics: {}, | ||
containers: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "client", | ||
"version": "1.0.0", | ||
"description": "mapstore extension", | ||
"eslintConfig": { | ||
"extends": [ | ||
"@mapstore/eslint-config-mapstore" | ||
], | ||
"parserOptions": { | ||
"babelOptions": { | ||
"configFile": "./node_modules/mapstore/build/babel.config.js" | ||
} | ||
}, | ||
"globals": { | ||
"__MAPSTORE_PROJECT_CONFIG__": false, | ||
"__MAPSTORE_EXTENSION_CONFIG__": false | ||
} | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.5%", | ||
"not dead", | ||
"not op_mini all", | ||
"not IE 11", | ||
"not UCAndroid 12.12" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"scripts": { | ||
"compile": "mapstore-project compile extension && node ./postCompile.js", | ||
"lint": "eslint js --ext .jsx,.js", | ||
"start": "mapstore-project start extension", | ||
"test": "mapstore-project test extension", | ||
"test:watch": "mapstore-project test:watch extension" | ||
}, | ||
"devDependencies": { | ||
"@mapstore/project": "1.0.27" | ||
}, | ||
"dependencies": { | ||
"mapstore": "git+https://github.com/geosolutions-it/MapStore2.git#2022.02.xx" | ||
}, | ||
"mapstore": { | ||
"extensionName": "LitterAssessmentPlugin" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const extensionsPath = path.join(__dirname, '..', '..', 'geonode', 'static', 'mapstore', 'extensions'); | ||
// const extensionIndexPath = path.join(extensionsPath, 'index.json'); | ||
// const extensionIndex = fs.existsSync(extensionIndexPath) ? require(extensionIndexPath) : {}; | ||
|
||
const EXTENSION_NAME = 'LitterAssessmentPlugin'; | ||
|
||
// let error = false; | ||
// Object.keys(extensionIndex).forEach(extensionName => { | ||
// const endpoints = extensionIndex[extensionName]; | ||
// Object.keys(endpoints).forEach(key => { | ||
// if (endpoints[key].match('http://localhost:8082/extension')) { | ||
// error = true; | ||
// console.error(''); | ||
// console.error('//////////////////////////////////////'); | ||
// console.error('/// Error: dev url ' + key + ': ' + endpoints[key]); | ||
// console.error('/// -> please replace http://localhost:8082/extension with /static/mapstore/extensions/' + extensionName); | ||
// console.error('//////////////////////////////////////'); | ||
// console.error(''); | ||
// } | ||
// }); | ||
// }); | ||
|
||
//if (!error) { | ||
fs.moveSync( | ||
path.resolve(__dirname, 'dist'), | ||
path.resolve(extensionsPath, EXTENSION_NAME), | ||
{ overwrite: true }); | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client-v1.0.0- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,7 @@ | |
|
||
|
||
INSTALLED_APPS += ( | ||
"litter_assessment", | ||
"externalapplications", | ||
"customizations", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"LitterAssessmentPlugin": { | ||
"bundle": "http://localhost:8082/extension/index.js", | ||
"translations": "http://localhost:8082/extension/translations", | ||
"assets": "http://localhost:8082/extension/assets" | ||
} | ||
} |