Skip to content

Commit be6f194

Browse files
committed
Merge branch 'next' into ftr/rotate-map
2 parents 9df9639 + 4f692df commit be6f194

26 files changed

+841
-5361
lines changed

.github/workflows/test-postgis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
redmine_version: [4.2-stable, 5.0-stable, master]
28-
ruby_version: [2.7, 3.0, 3.1]
28+
ruby_version: ['2.7', '3.0', '3.1']
2929
db_version: [11-2.5, 14-3.2]
3030
exclude:
3131
- redmine_version: 4.2-stable
@@ -45,14 +45,14 @@ jobs:
4545

4646
steps:
4747
- name: Checkout Redmine
48-
uses: actions/checkout@v2
48+
uses: actions/checkout@v3
4949
with:
5050
repository: redmine/redmine
5151
ref: ${{ matrix.redmine_version }}
5252
path: redmine
5353

5454
- name: Checkout Plugin
55-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
5656
with:
5757
path: redmine/plugins/${{ env.PLUGIN_NAME }}
5858

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"MD029": false,
3+
"MD033": false,
4+
"MD038": false,
5+
"MD041": false
6+
}

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
22

33
gem 'deface'
44
gem 'immutable-struct'
5-
gem "rgeo"
5+
gem "rgeo", "~> 2.4.0"
66
gem "rgeo-geojson"
77
gem "pg", (ENV['GEM_PG_VERSION'] ? "~> #{ENV['GEM_PG_VERSION']}" : "~> 1.2.2") # make sure we use a version compatible with AR
88
gem "rgeo-activerecord", (ENV['GEM_RGEO_ACTIVERECORD_VERSION'] ? "~> #{ENV['GEM_RGEO_ACTIVERECORD_VERSION']}" : "~> 7.0.1") # same as above

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ The Geo-Task-Tracker (GTT) plugin adds spatial capabilities to Redmine:
1414

1515
## Requirements
1616

17-
Redmine GTT plugins **require PostgreSQL/PostGIS** and will not work with SQLite or MariaDB/MySQL!!!
17+
Redmine GTT plugins **require PostgreSQL/PostGIS** and will not work with SQLite
18+
or MariaDB/MySQL!!!
1819

1920
- Redmine >= 4.2.0
2021
- PostgreSQL >= 10
@@ -31,7 +32,8 @@ createdb -U postgres -O redmine redmine
3132
psql -U postgres -d redmine -c "CREATE EXTENSION postgis;"
3233
```
3334

34-
To install Redmine GTT plugin, download or clone this repository in your Redmine installation plugins directory!
35+
To install Redmine GTT plugin, download or clone this repository in your Redmine
36+
installation plugins directory!
3537

3638
```sh
3739
cd path/to/plugin/directory
@@ -51,11 +53,14 @@ bundle install
5153
bundle exec rake redmine:plugins:migrate
5254
```
5355

54-
Before restarting Redmine, you need to set `postgis` adapter instead of `postgres` adapter in your `config/database.yml`.
56+
Before restarting Redmine, you need to set `postgis` adapter instead of
57+
`postgres` adapter in your `config/database.yml`.
5558

56-
After restarting Redmine, you should be able to see the Redmine GTT plugin in the Plugins page.
59+
After restarting Redmine, you should be able to see the Redmine GTT plugin in
60+
the Plugins page.
5761

58-
More information on installing (and uninstalling) Redmine plugins can be found in the [Redmine Plugin docs](http://www.redmine.org/wiki/redmine/Plugins).
62+
More information on installing (and uninstalling) Redmine plugins can be found
63+
in the [Redmine Plugin docs](http://www.redmine.org/wiki/redmine/Plugins).
5964

6065
## How to use
6166

@@ -65,15 +70,17 @@ More information on installing (and uninstalling) Redmine plugins can be found i
6570
4. Define the project boundary in `GTT` project settings
6671
5. Create a new issue with a point, line or polygon
6772

68-
For more information with screenshots see the [Getting Started](doc/getting-started.md) guide.
73+
For more information with screenshots see the [Getting Started](doc/getting-started.md)
74+
guide.
6975

7076
## Plugin API
7177

7278
For more information see the [Redmine GTT API](doc/api.md) docs.
7379

7480
## Contributing and Support
7581

76-
The GTT Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)! Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md).
82+
The GTT Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)!
83+
Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md).
7784

7885
Help us to translate GTT Project using [OSGeo Weblate](https://weblate.osgeo.org/engage/gtt-project/):
7986

@@ -100,7 +107,8 @@ RAILS_ENV=test NAME=redmine_gtt bundle exec rake redmine:plugins:test
100107

101108
## Version History
102109

103-
See [all releases](https://github.com/gtt-project/redmine_gtt/releases) with release notes.
110+
See [all releases](https://github.com/gtt-project/redmine_gtt/releases) with
111+
release notes.
104112

105113
## Authors
106114

app/views/issues/index.api.rsb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ api.array :issues, api_meta(:total_count => @issue_count, :offset => @offset, :l
2121
api.estimated_hours issue.estimated_hours
2222

2323
if issue.geom
24-
api.geojson issue.geojson.to_json
24+
api.geojson (params[:format] == "json") ? issue.geojson : issue.geojson.to_json
2525
else
26-
api.geojson ""
26+
api.geojson nil
2727
end
2828

2929
if issue.distance

app/views/issues/show.api.rsb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ api.issue do
2424
end
2525

2626
if @issue.geom
27-
api.geojson @issue.geojson
27+
api.geojson (params[:format] == "json") ? @issue.geojson : @issue.geojson.to_json
2828
else
29-
api.geojson ""
29+
api.geojson nil
3030
end
3131

3232
render_api_custom_values @issue.visible_custom_field_values, api

app/views/projects/index.api.rsb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
1111

1212
if @include_geometry
1313
if project.geom
14-
api.geojson project.geojson.to_json
14+
api.geojson (params[:format] == "json") ? project.geojson : project.geojson.to_json
1515
else
16-
api.geojson ""
16+
api.geojson nil
1717
end
1818
end
1919

app/views/projects/show.api.rsb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ api.project do
99
api.is_public @project.is_public?
1010

1111
if @project.geom
12-
api.geojson @project.geojson
12+
api.geojson (params[:format] == "json") ? @project.geojson : @project.geojson.to_json
1313
else
14-
api.geojson ""
14+
api.geojson nil
1515
end
1616

1717
render_api_custom_values @project.visible_custom_field_values, api
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="dialog-geojson-upload" title="<%= l(:title_geojson_upload) %>">
1+
<div id="dialog-geojson-upload" title="<%= l(:title_geojson_upload) %>" style="display:none;">
22
<textarea placeholder="<%= l(:placeholder_geojson_upload) %>" class="ui-widget ui-state-default ui-corner-all"></textarea>
33
<input type="file" id="file-selector" accept=".json,.geojson">
44
</div>

app/views/users/index.api.rsb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ api.array :users, api_meta(:total_count => @user_count, :offset => @offset, :lim
1010
api.last_login_on user.last_login_on
1111

1212
if user.geom
13-
api.geojson user.geojson
13+
api.geojson (params[:format] == "json") ? user.geojson : user.geojson.to_json
1414
else
15-
api.geojson ""
15+
api.geojson nil
1616
end
1717

1818
render_api_custom_values user.visible_custom_field_values, api

0 commit comments

Comments
 (0)