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

Prepare 1.1.1 #62

Merged
merged 53 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5de8457
Fix responsive issue when the layer is very long in the basemap form.
Sep 7, 2020
3c89ef9
Added missing head title elements in template and views context
chakibBH Sep 8, 2020
674dc21
Fix displ_creator property belong to feature instances
chakibBH Sep 8, 2020
fc35ada
Fix: Handeling project_detail access
chakibBH Sep 8, 2020
d3e75c8
Merge pull request #42 from neogeo-technologies/fix/9253-feature-crea…
sebastiendarocha Sep 15, 2020
6e2eebd
Merge pull request #39 from neogeo-technologies/fix/responsive-issue-…
sebastiendarocha Sep 15, 2020
9f2158d
Merge pull request #41 from neogeo-technologies/fix/9040-missing-title
sebastiendarocha Sep 15, 2020
0433c39
Update CHANGELOG.md
sebastiendarocha Sep 15, 2020
86a0c91
Merge pull request #40 from neogeo-technologies/fix/9242-project-rank…
sebastiendarocha Sep 15, 2020
56052c7
Update CHANGELOG.md
sebastiendarocha Sep 15, 2020
92e85f2
Improve changelog summary
sebastiendarocha Sep 22, 2020
7d8507c
Added missing head title elements
chakibBH Sep 22, 2020
8459815
Merge pull request #43 from neogeo-technologies/fix/9040-missing-title
sebastiendarocha Sep 22, 2020
10a8560
Feat(ProjectDetail): Filtering draft features and related comments
chakibBH Sep 28, 2020
0bee95c
Merge pull request #44 from neogeo-technologies/feat/9321-hide-draft-…
sebastiendarocha Sep 28, 2020
33ff263
Feat(ProjectDetail): Display authors default value
chakibBH Sep 28, 2020
2496d20
Merge pull request #45 from neogeo-technologies/fix/9253-author-display
sebastiendarocha Sep 28, 2020
0af0574
Fix(Templates): Replace displayable fullname
chakibBH Sep 29, 2020
c8fbfc6
Fix(LDAPUserSync): Geocontrib authorizations are kept between each sync
chakibBH Sep 30, 2020
abdfc07
Update forms.py
hcharp Oct 2, 2020
fd1dbab
Update emails.py
hcharp Oct 2, 2020
bae74fb
Update login.html
hcharp Oct 2, 2020
6cb7fb0
Update users.md
hcharp Oct 6, 2020
e2d463a
Merge pull request #48 from hcharp/patch-1
sebastiendarocha Oct 8, 2020
27185dd
Merge pull request #50 from hcharp/patch-3
sebastiendarocha Oct 8, 2020
b2b3e88
Merge pull request #49 from hcharp/patch-2
sebastiendarocha Oct 8, 2020
6ed7447
Merge pull request #46 from neogeo-technologies/fix/9253-replace-disp…
sebastiendarocha Oct 8, 2020
dffa3fa
Merge pull request #47 from neogeo-technologies/fix/9315-sync-ldap-roles
sebastiendarocha Oct 8, 2020
c0b7f9f
apply filters on map features
Oct 13, 2020
c57bca0
make features more visible on map
Oct 13, 2020
b65941b
header menu fully displayed on small screens
Oct 13, 2020
e10889a
fix(FeatureList): display creator in feature list
chakibBH Oct 14, 2020
ab4a1a8
stay on list tab after search
Oct 15, 2020
7a65627
Merge pull request #54 from neogeo-technologies/fix/9253-display-crea…
sebastiendarocha Oct 15, 2020
ea70785
Merge pull request #53 from neogeo-technologies/9039-menu-not-responsive
sebastiendarocha Oct 15, 2020
b454432
Merge pull request #52 from neogeo-technologies/fix/9309-search-resul…
sebastiendarocha Oct 15, 2020
529daaa
Fix(CommentCreate): Fix Attachment without Comment
chakibBH Oct 20, 2020
04b59b4
Fix: add serialized instances into context data
chakibBH Oct 21, 2020
8325a85
remove commented code
Oct 21, 2020
1efbd4f
Merge pull request #56 from neogeo-technologies/fix/9310-map-view-loa…
sebastiendarocha Oct 21, 2020
0ffd341
fix addFeatures function for no filter case
Oct 22, 2020
29d890e
Merge pull request #57 from neogeo-technologies/fix/9491-map-display-…
sebastiendarocha Oct 22, 2020
8d0d246
fix css for menu not responsive on small screens
Oct 22, 2020
242247b
fix const not accessible
Oct 23, 2020
20928b3
Merge pull request #58 from neogeo-technologies/fix/9491-map-display-…
sebastiendarocha Oct 23, 2020
dfd2b54
Merge pull request #59 from neogeo-technologies/fix/9039-menu-not-res…
sebastiendarocha Oct 23, 2020
f9a9907
Merge pull request #55 from neogeo-technologies/fix/9489-comment-create
sebastiendarocha Oct 28, 2020
a765149
Update users.md
hcharp Oct 28, 2020
dca40cf
Merge pull request #51 from hcharp/patch-4
sebastiendarocha Oct 28, 2020
f5c20ab
Prepared changelog 1.1.1
sebastiendarocha Oct 28, 2020
bdc3f11
Elsa sugestions
sebastiendarocha Oct 29, 2020
aba0c61
Update README.md
sebastiendarocha Oct 29, 2020
da78e4b
Merge pull request #60 from neogeo-technologies/prepare_changelog
sebastiendarocha Oct 29, 2020
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
26 changes: 22 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

## [1.1.1] - 2020-10-29

### Changed
- increase thickness of segments of features and reduced the transparency of dotted features

### Fixed
- The creator is correctly displayed in the features and the feature types
- In the basemaps form, the display of a very long layer name is now responsive
- A browser title (tab) is now displayed for all pages
- Projects with limited access are no longer accessible to everyone
- The features are now filtered when search on the map
- The search in the list of features now stay in the same page
- The Georchestra plugin now keeps user rights defined in GeoContrib
- Draft features are now hidden on the section "Last features"
- Empty comments are now blocked

## [1.1.0] - 2020-08-28

### Changed
Expand All @@ -15,7 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.1.0-rc1] - 2020-08-19
### Added
- geOrchestra plugin: automatically associate role to users when the user database is synchronised (see
- geOrchestra plugin: automatically associate role to users when the user database is synchronised (see
[geOrchestra plugin](plugin_georchestra/README.md))
- add a function to search for places and addresses in the interactive maps. This new feature comes with new settings:
`GEOCODER_PROVIDERS` and `SELECTED_GEOCODER`
Expand All @@ -29,10 +47,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- change the label of the feature type field `title` in the front-end form (Titre -> Nom)
- change the data model for basemaps: one basemap may contain several layers. Layers are declared by GéoContrib
admin users. Basemaps are created by project admin users by selecting layers, ordering them and setting the opacity
of each of them. End users may switch from one basemap to another in the interactive maps. One user can change
the order of the layers and their opacity in the interactive maps. These personnal adjustments are stored in the
of each of them. End users may switch from one basemap to another in the interactive maps. One user can change
the order of the layers and their opacity in the interactive maps. These personnal adjustments are stored in the
web browser of the user (local storage) and do not alter the basemaps as seen by other users.
- change default value for `LOGO_PATH` setting: Neogeo Technologie logo. This new image is located in the media
- change default value for `LOGO_PATH` setting: Neogeo Technologie logo. This new image is located in the media
directory.
- change all visible names in front-end and docs from `Geocontrib` to `GéoContrib`
- set the leaflet background container to white
Expand Down
12 changes: 6 additions & 6 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class UserSerializer(serializers.ModelSerializer):
full_name = serializers.SerializerMethodField()

def get_full_name(self, obj):
return obj.get_full_name()
return obj.get_full_name() or obj.username

class Meta:
model = User
Expand All @@ -99,7 +99,7 @@ class CommentSerializer(serializers.ModelSerializer):

created_on = serializers.DateTimeField(format="%d/%m/%Y", read_only=True)

author = UserSerializer(read_only=True)
display_author = serializers.ReadOnlyField()

related_feature = serializers.SerializerMethodField()

Expand All @@ -122,7 +122,7 @@ class Meta:
fields = (
'created_on',
'comment',
'author',
'display_author',
'related_feature',
)

Expand Down Expand Up @@ -267,7 +267,7 @@ def get_feature_to(self, obj):
'title': str(feature.title),
'feature_url': feature.get_view_url(),
'created_on': feature.created_on.strftime("%d/%m/%Y %H:%M"),
'creator': feature.creator.display_creator,
'creator': feature.display_creator,
}
except Exception:
logger.exception('No related feature found')
Expand All @@ -285,7 +285,7 @@ class EventSerializer(serializers.ModelSerializer):

created_on = serializers.DateTimeField(format="%d/%m/%Y %H:%M", read_only=True)

user = UserSerializer(read_only=True)
display_user = serializers.ReadOnlyField()

related_comment = serializers.SerializerMethodField()

Expand Down Expand Up @@ -344,7 +344,7 @@ class Meta:
'feature_id',
'comment_id',
'attachment_id',
'user',
'display_user',
'related_comment',
'related_feature',
'project_url',
Expand Down
7 changes: 7 additions & 0 deletions docs/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Autorisations attribuables par projet :
Autorisations indépendantes des projets :
* Super utilisateur
* Gestionnaire métier
* Statut équipe


## Autorisations liées aux projets
Expand Down Expand Up @@ -89,3 +90,9 @@ Un gestionnaire métier peut :

Le créateur d'un nouveau projet en devient automatiquement administrateur projet du projet en question.


### Statut équipe

Un utilisateur avec le statut équipe peut se connecter à l'interface administrateur.
Il accède aux fonctionnalités de l'interface selon les permissions qui lui ont été accordées.

5 changes: 3 additions & 2 deletions geocontrib/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

from django.conf import settings

from geocontrib.models import Authorization
import json
import logging

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion geocontrib/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def notif_creator_published_feature(emails, context):

context['url_feature'] = urljoin(CURRENT_SITE_DOMAIN, feature.get_view_url())

subject = "[Collab:{project_slug}] Confirmation de la publication de l'un de vos signalement.".format(
subject = "[Collab:{project_slug}] Confirmation de la publication de l'un de vos signalements.".format(
project_slug=feature.project.slug
)

Expand Down
8 changes: 4 additions & 4 deletions geocontrib/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def clean(self):
continue
name = form.cleaned_data.get('name')
if name in names:
raise forms.ValidationError("Les champs supplémentaires ne peuvent avoir des nom similaires.")
raise forms.ValidationError("Les champs supplémentaires ne peuvent avoir des noms similaires.")
names.append(name)


Expand Down Expand Up @@ -149,7 +149,7 @@ class CommentForm(forms.ModelForm):
attachment_file = forms.FileField(label="Fichier joint", required=False)

info = forms.CharField(
label="Information additonelle au fichier joint", required=False, widget=forms.Textarea())
label="Information additionnelle au fichier joint", required=False, widget=forms.Textarea())

class Meta:
model = Comment
Expand Down Expand Up @@ -205,7 +205,7 @@ class AuthorizationForm(forms.ModelForm):

username = forms.CharField(label="Nom d'utilisateur")

email = forms.EmailField(label="Adresse email")
email = forms.EmailField(label="Adresse email", required=False)

level = forms.ModelChoiceField(
label="Niveau d'autorisation",
Expand Down Expand Up @@ -414,7 +414,7 @@ def __init__(self, *args, **kwargs):

self.fields['feature_to'].choices = tuple(
(feat.feature_id, "{} ({} - {})".format(
feat.title, feat.creator.display_creator, feat.created_on.strftime("%d/%m/%Y %H:%M"))) for feat in qs
feat.title, feat.display_creator, feat.created_on.strftime("%d/%m/%Y %H:%M"))) for feat in qs
)

except Exception:
Expand Down
16 changes: 15 additions & 1 deletion geocontrib/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def all_permissions(cls, user, project, feature=None):

user_rank = cls.get_rank(user, project)

if user_rank >= project_rank_min or project_rank_min < 2:
if user_rank >= project_rank_min or project_rank_min == 0:
user_perms['can_view_project'] = True
user_perms['can_view_feature'] = True
user_perms['can_view_feature_type'] = True
Expand Down Expand Up @@ -592,6 +592,13 @@ def save(self, *args, **kwargs):
self.created_on = timezone.now()
super().save(*args, **kwargs)

@property
def display_author(self):
res = "Utilisateur supprimé"
if self.author:
res = self.author.get_full_name() or self.author.username
return res


class Attachment(AnnotationAbstract):

Expand Down Expand Up @@ -684,6 +691,13 @@ def save(self, *args, **kwargs):
self.created_on = timezone.now()
super().save(*args, **kwargs)

@property
def display_user(self):
res = "Utilisateur supprimé"
if self.user:
res = self.user.get_full_name() or self.user.username
return res

@property
def contextualize_action(self):
evt = 'Aucun evenement'
Expand Down
9 changes: 9 additions & 0 deletions geocontrib/static/geocontrib/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ main {
color: #9f3a38;
}

/* Fix semantic ui overflow when is too long */
.layer-item .form div.text {
width: 100%
}

.ui.selection.dropdown .menu>.item {
word-break: break-all;
}

/* Needs this unfortunatly, because semantic overrides the background-color */
#form-layers .blue-background-class {
background-color: rgb(205, 229, 245);
Expand Down
67 changes: 40 additions & 27 deletions geocontrib/static/geocontrib/js/map-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,37 +99,50 @@ const mapUtil = {
this.addLayers(layers);
},

addFeatures: function (features) {
addFeatures: function (features, filter) {
featureGroup = new L.FeatureGroup();
features.forEach((feature) => {
const geomJSON = turf.flip(feature.geometry);

const popupContent = this._createContentPopup(feature);
let filters = [];

if (geomJSON.type === 'Point') {
L.circleMarker(geomJSON.coordinates, {
color: feature.properties.feature_type.color,
radius: 4,
fillOpacity: 0.3,
weight: 1,
})
.bindPopup(popupContent)
.addTo(featureGroup);
} else if (geomJSON.type === 'LineString') {
L.polyline(geomJSON.coordinates, {
color: feature.properties.feature_type.color,
weight: 1.5,
})
.bindPopup(popupContent)
.addTo(featureGroup);
} else if (geomJSON.type === 'Polygon') {
L.polygon(geomJSON.coordinates, {
color: feature.properties.feature_type.color,
weight: 1.5,
fillOpacity: 0.3,
})
.bindPopup(popupContent)
.addTo(featureGroup);
if (filter) {
const typeCheck = filter.featureType && feature.properties.feature_type.slug === filter.featureType;
const statusCheck = filter.featureStatus && feature.properties.status.value === filter.featureStatus;
const titleCheck = filter.featureTitle && feature.properties.title.includes(filter.featureTitle);
filters = [typeCheck, statusCheck, titleCheck];
}

if (!filter || !Object.values(filter).some(val => val) || Object.values(filter).some(val => val) && filters.length && filters.every(val => val !== false)) {

const geomJSON = turf.flip(feature.geometry);

const popupContent = this._createContentPopup(feature);

if (geomJSON.type === 'Point') {
L.circleMarker(geomJSON.coordinates, {
color: feature.properties.feature_type.color,
radius: 4,
fillOpacity: 0.5,
weight: 3,
})
.bindPopup(popupContent)
.addTo(featureGroup);
} else if (geomJSON.type === 'LineString') {
L.polyline(geomJSON.coordinates, {
color: feature.properties.feature_type.color,
weight: 3,
})
.bindPopup(popupContent)
.addTo(featureGroup);
} else if (geomJSON.type === 'Polygon') {
L.polygon(geomJSON.coordinates, {
color: feature.properties.feature_type.color,
weight: 3,
fillOpacity: 0.5,
})
.bindPopup(popupContent)
.addTo(featureGroup);
}
}
});
map.addLayer(featureGroup);
Expand Down
13 changes: 11 additions & 2 deletions geocontrib/templates/geocontrib/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<!-- Turf.js -->
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@5/turf.min.js"></script>

<!-- Asual -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.address/1.6/jquery.address.js"></script>

<!-- Custom -->
<link rel="stylesheet" href="{% static 'geocontrib/css/base.css' %}"/>
<link rel="stylesheet" href="{% static 'geocontrib/css/sidebar-layers.css' %}"/>
Expand All @@ -52,7 +55,7 @@
</head>

<body>
<header>
<header class="header-menu">
<div class="ui container">
<div class="ui inverted icon menu">
<a href="{% url 'geocontrib:index' %}" class="header item">
Expand Down Expand Up @@ -135,4 +138,10 @@

</body>

</html>
</html>

<style lang="less">
.header-menu {
min-width: 560px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% if event.event_type == 'delete' %}
{% if event.object_type == 'feature' %}
{{ event.created_on }} - "{{ event.data.feature_title }}"
Signalement supprimé par {{ event.user.full_name }}
Signalement supprimé par {{ event.display_user }}
{% endif %}
{% else %}

Expand All @@ -29,10 +29,10 @@
{% if event.event_type == 'create' %}

{% if event.object_type == 'feature' %}
Signalement créé par {{ event.user.full_name }}
Signalement créé par {{ event.display_user }}

{% elif event.object_type == 'comment' %}
- Commentaire créé par {{ event.user.full_name }}
- Commentaire créé par {{ event.display_user }}
<strong>{{ event.related_comment.comment }}</strong>
{% if event.related_comment.attachments %}
{% for att in event.related_comment.attachments %}
Expand All @@ -41,16 +41,16 @@
{% endif %}

{% elif event.object_type == 'attachment' %}
{{ event.created_on }} - Pièce-jointe ajoutée par {{ event.user.full_name }}
{{ event.created_on }} - Pièce-jointe ajoutée par {{ event.display_user }}
{% endif %}

{% elif event.event_type == 'update' %}

{% if event.object_type == 'feature' %}
Signalement mis à jour par {{ event.user.full_name }}
Signalement mis à jour par {{ event.display_user }}

{% elif event.object_type == 'attachment' %}
Pièce-jointe mise à jour par {{ event.user.full_name }}
Pièce-jointe mise à jour par {{ event.display_user }}
{% endif %}

{% endif %}
Expand Down
Loading