Skip to content

Commit

Permalink
Release 0.9.5 (#407)
Browse files Browse the repository at this point in the history
* several fixes

* several geodata fixes

* fix node dropdown show/hide

Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
  • Loading branch information
v1r0x authored Nov 7, 2022
1 parent f5d05e6 commit 9e70d01
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 39 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog
All notable changes to this project will be documented in this file.

## 0.9.5
### Fixed
- Display option to access analysis tool in _Tools_ (if available)
- height of notification panel if larger than screen
- Missing styling in _Add Entitytype_ component
- Several geodata related bugs
- Node dropdown not closed on outside click

## 0.9.4
### Fixed
- Error on deleting plugin (Plugin not found)
Expand Down
30 changes: 30 additions & 0 deletions app/Geodata.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App;

use MStaack\LaravelPostgis\Geometries\Geometry;
use MStaack\LaravelPostgis\Eloquent\PostgisTrait;
use MStaack\LaravelPostgis\Exceptions\UnknownWKTTypeException;

class Geodata
{
use PostgisTrait;

protected static $availableGeometryTypes = [
'Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon'
];

public static function getAvailableGeometryTypes() {
return self::$availableGeometryTypes;
}

public static function parseWkt($wkt) {
try {
$geom = Geometry::getWKTClass($wkt);
$parsed = $geom::fromWKT($wkt);
return $parsed;
} catch(UnknownWKTTypeException $e) {
return null;
}
}
}
1 change: 1 addition & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function getGlobalData() {
'concepts' => $concepts,
'entityTypes' => $entityTypeMap,
'colorsets' => sp_get_themes(),
'analysis' => sp_has_analysis(),
]);
}

Expand Down
3 changes: 2 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Providers;

use App\Geodata;
use App\Preference;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\ServiceProvider;
Expand Down Expand Up @@ -67,7 +68,7 @@ public function boot()
// (*Point, *LineString and *Polygon)
// or 'any'
Validator::extend('geometry', function ($attribute, $value, $parameters, $validator) {
$isActualGeometry = in_array($value, \App\Geodata::getAvailableGeometryTypes());
$isActualGeometry = in_array($value, Geodata::getAvailableGeometryTypes());
if(!$isActualGeometry) {
return $value == 'Any';
}
Expand Down
7 changes: 7 additions & 0 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,10 @@ function th_tree_builder($langCode = null, $detailLevel = 2) {
}
}
}

if(!function_exists('sp_has_analysis')) {
function sp_has_analysis() {
$analysisDir = base_path("../analysis");
return is_dir($analysisDir);
}
}
2 changes: 2 additions & 0 deletions database/migrations/2018_09_06_092028_setup_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ private function migrateEntityRelations() {
}

private function migrateFromScratch() {
// enable the postgis extension
Schema::getConnection()->statement('CREATE EXTENSION IF NOT EXISTS postgis');
// Create Bibliography
Schema::create('bibliography', function (Blueprint $table) {
$table->increments('id');
Expand Down
47 changes: 16 additions & 31 deletions resources/js/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{{ state.unreadNotifications.length }}
</span>
</a>
<div class="dropdown-menu dropdown-menu-end stays-open row bg-dark text-light py-1" aria-labelledby="notifications-navbar" style="min-width: 30rem; right: 0 !important;">
<div class="dropdown-menu dropdown-menu-end stays-open row bg-dark text-light py-1 end-0 minw-30" aria-labelledby="notifications-navbar">
<div class="col-12 d-flex flex-row justify-content-between pb-1">
<span>
{{ t('global.notifications.count', {cnt: state.notifications.length}) }}
Expand All @@ -49,7 +49,7 @@
{{ t('global.notifications.mark_all_as_read') }}
</a>
</div>
<div class="col-12 bg-light text-dark px-0">
<div class="col-12 bg-light text-dark px-0 mh-75v scroll-y-auto">
<notification-body
v-for="(n, idx) in state.notifications"
:key="n.id"
Expand All @@ -65,10 +65,7 @@
</p>
</div>
<div class="text-center pt-1">
<!-- <router-link :to="{name: 'notifications', params: { id: $auth.user().id }}" class="text-light">
{{ t('global.notifications.view_all') }}
</router-link> -->
<router-link :to="{name: 'notifications', params: { id: 1 }}" class="text-light">
<router-link :to="{name: 'notifications', params: { id: state.authUser.id || -1 }}" class="text-light">
{{ t('global.notifications.view_all') }}
</router-link>
</div>
Expand Down Expand Up @@ -104,28 +101,18 @@
<i class="fas fa-fw" :class="plugin.icon"></i>
{{ t(plugin.label) }}
</router-link>
<template v-if="hasPreference('prefs.link-to-thesaurex')">
<div class="dropdown-divider"></div>
<h6 class="dropdown-header">
{{ t('global.tools.external') }} <sup class="fas fa-fw fa-sm fa-fw fa-external-link-alt"></sup>
</h6>
</template>
<template v-if="hasPreference('prefs.link-to-thesaurex')">
<a class="dropdown-item" :href="getPreference('prefs.link-to-thesaurex')" target="_blank">
<i class="fas fa-fw fa-paw"></i>
{{ t('global.tools.thesaurex') }}
</a>
</template>
<template>
<a class="dropdown-item" href="../db" target="_blank">
<i class="fas fa-fw fa-chart-bar"></i>
{{ t('global.tools.dbwebgen') }}
</a>
<a class="dropdown-item" href="../analysis" target="_blank">
<i class="fas fa-fw fa-chart-bar"></i>
{{ t('global.tools.analysis') }}
</a>
</template>
<div class="dropdown-divider"></div>
<h6 class="dropdown-header">
{{ t('global.tools.external') }} <sup class="fas fa-fw fa-sm fa-fw fa-external-link-alt"></sup>
</h6>
<a class="dropdown-item" :href="getPreference('prefs.link-to-thesaurex')" target="_blank" v-if="hasPreference('prefs.link-to-thesaurex')">
<i class="fas fa-fw fa-paw"></i>
{{ t('global.tools.thesaurex') }}
</a>
<a class="dropdown-item" href="../analysis" target="_blank" v-if="state.hasAnalysis">
<i class="fas fa-fw fa-chart-bar"></i>
{{ t('global.tools.analysis') }}
</a>
</div>
</li>
<li class="nav-item dropdown" v-if="state.loggedIn">
Expand Down Expand Up @@ -158,9 +145,6 @@
<i class="fas fa-fw" :class="plugin.icon"></i>
{{ t(plugin.label) }}
</router-link>
<!-- <router-link class="dropdown-item" v-for="plugin in state.plugins.settings" :to="plugin.href" :key="plugin.key">
<i class="fas fa-fw" :class="plugin.icon"></i> {{ t(plugin.label) }}
</router-link> -->
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" @click.prevent="showAboutModal">
<i class="fas fa-fw fa-info-circle"></i>
Expand Down Expand Up @@ -309,6 +293,7 @@
recordingTimeout: 0,
isRecording: false,
plugins: computed(_ => store.getters.slotPlugins()),
hasAnalysis: computed(_ => store.getters.hasAnalysis),
auth: auth,
appName: computed(_ => getProjectName()),
init: computed(_ => store.getters.appInitialized),
Expand Down
1 change: 1 addition & 0 deletions resources/js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export async function fetchPreData(locale) {
store.commit('setPreferences', response.data.preferences);
store.commit('setSystemPreferences', response.data.system_preferences);
store.dispatch('setColorSets', response.data.colorsets);
store.dispatch('setAnalysis', response.data.analysis);

if(auth.ready()) {
auth.load().then(_ => {
Expand Down
8 changes: 8 additions & 0 deletions resources/js/bootstrap/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const store = createStore({
settings: [],
},
vfm: {},
hasAnalysis: false,
}
},
mutations: {
Expand Down Expand Up @@ -430,6 +431,9 @@ export const store = createStore({
setColorSets(state, data) {
state.colorSets = data;
},
setAnalysis(state, data) {
state.hasAnalysis = data;
},
},
actions: {
setAppState({commit}, data) {
Expand Down Expand Up @@ -638,6 +642,9 @@ export const store = createStore({
setColorSets({commit}, data) {
commit('setColorSets', data);
},
setAnalysis({commit}, data) {
commit('setAnalysis', data);
},
},
getters: {
appInitialized: state => state.appInitialized,
Expand Down Expand Up @@ -686,6 +693,7 @@ export const store = createStore({
return slot ? p[slot] : p;
},
colorSets: state => state.colorSets,
hasAnalysis: state => state.hasAnalysis,
vfm: state => state.vfm,
}
},
Expand Down
1 change: 0 additions & 1 deletion resources/js/components/Preferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@
// FUNCTIONS
const trackChanges = (label, data) => {
console.log(label, data);
state.dirtyData[label] = {
value: data.value,
};
Expand Down
3 changes: 3 additions & 0 deletions resources/js/components/modals/entitytype/Add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<div class="col-md-9">
<multiselect
v-model="state.entityType.geometryType"
:classes="multiselectResetClasslist"
:name="'geometry-type-selection'"
:object="true"
:label="'label'"
Expand Down Expand Up @@ -77,6 +78,7 @@
import {
getConceptLabel,
multiselectResetClasslist,
} from '@/helpers/helpers.js';
export default {
Expand Down Expand Up @@ -134,6 +136,7 @@
// HELPERS
searchLabel,
getConceptLabel,
multiselectResetClasslist,
// PROPS
// LOCAL
add,
Expand Down
10 changes: 4 additions & 6 deletions resources/js/components/tree/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{ data.name }}
</span>
</a>
<ul class="dropdown-menu" :id="`tree-node-${data.id}-contextmenu`" v-if="state.ddVisible">
<ul class="dropdown-menu" :id="`tree-node-${data.id}-contextmenu`">
<li>
<h6 class="dropdown-header" @click.stop.prevent="" @dblclick.stop.prevent="">
{{ data.name }}
Expand Down Expand Up @@ -106,21 +106,18 @@
// FUNCTIONS
const hidePopup = _ => {
state.bsElem.hide();
state.bsElem.dispose();
state.bsElem = null;
state.ddVisible = false;
state.ddDomElem.classList.add('disabled');
};
const showPopup = _ => {
state.ddVisible = true;
nextTick(_ => {
// To prevent opening the dropdown on normal click on Node,
// the DD toggle must have class 'disabled'
// This also prevents BS API call .show() to work...
// Thus we remove the 'disabled' class before the API call and add it back afterwards
state.bsElem = new Dropdown(state.ddDomElem);
// Thus we remove the 'disabled' class before the API call and add it back on hide
state.ddDomElem.classList.remove('disabled');
state.bsElem.show();
state.ddDomElem.classList.add('disabled');
})
};
const togglePopup = _ => {
Expand Down Expand Up @@ -169,6 +166,7 @@
state.ddDomElem.addEventListener('hidden.bs.dropdown', _ => {
hidePopup();
});
state.bsElem = new Dropdown(state.ddDomElem);
});
// RETURN
Expand Down
8 changes: 8 additions & 0 deletions resources/sass/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@
max-height: 300px !important;
}

.mh-75v {
max-height: 75vh !important;
}

.minw-30 {
min-width: 30rem !important;
}

.align-middle {
vertical-align: middle;
}
Expand Down

0 comments on commit 9e70d01

Please sign in to comment.