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

Enhancments fixes #215

Merged
merged 23 commits into from May 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a734802
added make command to backfill tastypie keys
khaledboka Apr 16, 2020
f50bf5b
code formatting
khaledboka Apr 24, 2020
1b17d67
disabled restart dialog when install / uninstall an app
khaledboka Apr 25, 2020
c1e1870
app_manager back end don't restart server after uninstall
khaledboka Apr 25, 2020
e123d6a
fixed: could not app info for apps are not added yet in the app store
khaledboka Apr 25, 2020
bef0d0b
code clean up
khaledboka Apr 25, 2020
8b0a8fd
added pending property to AppResource rest api
khaledboka Apr 25, 2020
019147b
Typo enhancement
khaledboka Apr 25, 2020
22d19d1
app manager page: developed manual restart panel
khaledboka Apr 25, 2020
028ffe0
stop / start cherrypy server instead of restart
khaledboka Apr 26, 2020
3221a9f
increased the time period while restarting the django server
khaledboka Apr 26, 2020
7a7d091
fixed: install is not disabled while installing
khaledboka Apr 26, 2020
5ec2f67
fixed: apps in pending states appear in the apps page
khaledboka Apr 26, 2020
3568ef4
fix flake8
khaledboka Apr 26, 2020
2f0f6bf
app manager page edited the note to restart server
khaledboka Apr 27, 2020
cc280b3
added default_ouath_apps_docker django fixture file
khaledboka Apr 27, 2020
dc236df
docker django.env: added nginx_location
khaledboka Apr 27, 2020
5883b94
code formatting
khaledboka Apr 27, 2020
367b7e9
added paver task install geoserver docker data dir
khaledboka Apr 27, 2020
1c034fa
added paver task: prepare docker ouath fixture
khaledboka Apr 27, 2020
fdbb5d3
added prepare_ouath command to Makefile
khaledboka Apr 27, 2020
2537f59
implemented: Mafile load default_oauth_apps_docker.json
khaledboka Apr 27, 2020
c88d193
fixed: remove redundunt geoserver_location from paver task
khaledboka Apr 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions Makefile
Expand Up @@ -6,10 +6,12 @@ sync: up
# set up the database tablea
docker-compose exec cartoview python manage.py migrate
docker-compose exec cartoview python manage.py loaddata sample_admin.json
docker-compose exec cartoview python manage.py loaddata default_oauth_apps.json
docker-compose exec cartoview python manage.py loaddata default_oauth_apps_docker.json
docker-compose exec cartoview python manage.py loaddata app_stores.json
docker-compose exec cartoview python manage.py loaddata initial_data.json

backfill_api_keys:
docker-compose exec cartoview python manage.py backfill_api_keys

prepare_manager: up
#make migration for app_manager
Expand All @@ -34,7 +36,12 @@ reset: down up wait sync

collect_static: up
docker-compose exec cartoview python manage.py collectstatic --noinput
run: up wait prepare_manager sync collect_static

prepare_oauth:
docker-compose exec cartoview paver prepare_docker_oauth_fixture
docker-compose exec cartoview paver install_docker_data_dir

run: up wait prepare_oauth prepare_manager sync collect_static backfill_api_keys

static_db: up sync wait collect_static

Expand Down
9 changes: 6 additions & 3 deletions cartoview/app_manager/installer.py
Expand Up @@ -71,13 +71,16 @@ def restart_server(cls):
def cherry_restart(cls):
try:
import cherrypy
cherrypy.engine.restart()
# completely stop the cherrypy server instead of reloading
# to avoid waiting to stop used threads error
cherrypy.engine.stop()
cherrypy.engine.start()
except ImportError:
exit(0)


def remove_unwanted(info):
dictionary = info.__dict__.get('_data', {})
dictionary = info.__dict__.get('_data', {}) if info else {}
app_fields = [
str(field.name)
for field in sorted(App._meta.fields + App._meta.many_to_many)
Expand Down Expand Up @@ -139,7 +142,7 @@ def get_store(self, store_id=None):

def get_app_version(self):
if not self.version or self.version == 'latest' or \
self.info.latest_version.version == self.version:
(self.info and self.info.latest_version.version == self.version):
self.version = self.info.latest_version
else:
data = self._request_rest_data("appversion/?app__name=", self.name,
Expand Down
6 changes: 6 additions & 0 deletions cartoview/app_manager/rest.py
Expand Up @@ -97,6 +97,7 @@ class AppResource(ModelResource):
store = fields.ForeignKey(AppStoreResource, 'store', full=False, null=True)
order = fields.IntegerField()
active = fields.BooleanField()
pending = fields.BooleanField()
categories = fields.ListField()

default_config = fields.DictField(default={})
Expand All @@ -119,6 +120,11 @@ def dehydrate_active(self, bundle):
active = bundle.obj.config.active
return active

def dehydrate_pending(self, bundle):
app = bundle.obj
cartoview_app = CartoviewApp.objects.get(app.name)
return cartoview_app.pending

def dehydrate_categories(self, bundle):
return [category.name for category in bundle.obj.category.all()]

Expand Down
4 changes: 2 additions & 2 deletions cartoview/app_manager/settings.py
Expand Up @@ -48,10 +48,10 @@ def load_apps(APPS_DIR):
APPS_SETTINGS += (app_settings_file,)
if os.path.exists(libs_dir) and libs_dir not in sys.path:
logger.info(
"Install {} libs folder to the system.\n".format(
"Append {} libs folder to the system path.\n".format(
app.name))
sys.path.append(libs_dir)
logger.info("add {} to INSTALLED_APPS.\n".format(app.name))
logger.info("add {} to django INSTALLED_APPS.\n".format(app.name))
if app.name not in CARTOVIEW_APPS:
# app_config.name.__str__() because Django don't like
# unicode_literals
Expand Down
1 change: 1 addition & 0 deletions cartoview/app_manager/static/app_manager/css/manager.css
Expand Up @@ -625,6 +625,7 @@ div {
.actions-wrapper {
margin-top: 10px;
padding: 0 10px;
min-height: 30px;
}
.actions-wrapper button {
margin-right: 10px;
Expand Down