From: Tom Hughes Date: Fri, 18 Aug 2023 18:32:38 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/4185' X-Git-Tag: live~667 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/9790d779f482e332dfba7cfdc5502fd4d9052026?hp=1acd8e25a7d531dd264efa2c98265d6abf8f0b74 Merge remote-tracking branch 'upstream/pull/4185' --- diff --git a/app/controllers/api/versions_controller.rb b/app/controllers/api/versions_controller.rb index 7de335091..d5c9c5f87 100644 --- a/app/controllers/api/versions_controller.rb +++ b/app/controllers/api/versions_controller.rb @@ -2,6 +2,7 @@ module Api class VersionsController < ApiController authorize_resource :class => false + before_action :set_request_formats around_action :api_call_handle_error, :api_call_timeout # Show the list of available API versions. This will replace the global diff --git a/app/views/api/versions/show.json.jbuilder b/app/views/api/versions/show.json.jbuilder new file mode 100644 index 000000000..7336902bd --- /dev/null +++ b/app/views/api/versions/show.json.jbuilder @@ -0,0 +1,5 @@ +json.partial! "api/root_attributes" + +json.api do + json.versions @versions +end diff --git a/test/controllers/api/versions_controller_test.rb b/test/controllers/api/versions_controller_test.rb index a1a616ad1..1c70831c9 100644 --- a/test/controllers/api/versions_controller_test.rb +++ b/test/controllers/api/versions_controller_test.rb @@ -9,10 +9,18 @@ module Api { :path => "/api/versions", :method => :get }, { :controller => "api/versions", :action => "show" } ) + assert_routing( + { :path => "/api/versions.json", :method => :get }, + { :controller => "api/versions", :action => "show", :format => "json" } + ) assert_recognizes( { :controller => "api/versions", :action => "show" }, { :path => "/api/versions", :method => :get } ) + assert_recognizes( + { :controller => "api/versions", :action => "show", :format => "json" }, + { :path => "/api/versions.json", :method => :get } + ) end def test_versions @@ -25,6 +33,14 @@ module Api end end + def test_versions_json + get api_versions_path, :params => { :format => "json" } + assert_response :success + js = ActiveSupport::JSON.decode(@response.body) + assert_not_nil js + assert_equal [Settings.api_version], js["api"]["versions"] + end + def test_no_version_in_root_element get api_versions_path assert_response :success diff --git a/vendor/assets/iD/iD.css.erb b/vendor/assets/iD/iD.css.erb index 851b8cf1c..b1a0176ee 100644 --- a/vendor/assets/iD/iD.css.erb +++ b/vendor/assets/iD/iD.css.erb @@ -2749,9 +2749,11 @@ background-position: center; background-repeat: no-repeat; } + .ideditor #ideditor-viewer-mapilio-simple-wrap { height: 100%; } + .ideditor #ideditor-viewer-mapilio-simple { width: 100%; height: 100%; @@ -2760,6 +2762,14 @@ transform-origin: 0 0; } +.ideditor #ideditor-viewer-mapilio-simple img { + width: 100%; + height: 100%; + -o-object-fit: cover; + object-fit: cover; + overflow: hidden +} + /* Streetside Viewer (pannellum) */ .ideditor .ms-wrapper .photo-attribution .image-link { display: block; diff --git a/vendor/assets/iD/iD.js b/vendor/assets/iD/iD.js index d89cd30da..0401484a0 100644 --- a/vendor/assets/iD/iD.js +++ b/vendor/assets/iD/iD.js @@ -22820,7 +22820,7 @@ // package.json var package_default = { name: "iD", - version: "2.27.0", + version: "2.27.1", description: "A friendly editor for OpenStreetMap", main: "dist/iD.min.js", repository: "github:openstreetmap/iD", @@ -22897,7 +22897,7 @@ "@fortawesome/free-regular-svg-icons": "~6.4.2", "@fortawesome/free-solid-svg-icons": "~6.4.2", "@mapbox/maki": "^8.0.1", - "@openstreetmap/id-tagging-schema": "^6.3.0", + "@openstreetmap/id-tagging-schema": "^6.4.1", "@rapideditor/temaki": "~5.4.0", "@transifex/api": "^5.4.0", autoprefixer: "^10.4.15", @@ -22931,7 +22931,7 @@ "node-fetch": "^2.6.12", "npm-run-all": "^4.0.0", "osm-community-index": "~5.5.4", - postcss: "^8.4.27", + postcss: "^8.4.28", "postcss-selector-prepend": "^0.5.0", shelljs: "^0.8.0", shx: "^0.3.0", @@ -25869,24 +25869,13 @@ } return value2 === null || value2 === void 0 ? valueNull : typeof value2 === "function" ? valueFunction : valueConstant; } - function stickyCursor(func) { - const supportedTypes = ["text", "search", "url", "tel", "password"]; - if (!supportedTypes.includes(selection2.node()?.type)) { - return func; - } - return function() { - const cursor = { start: this.selectionStart, end: this.selectionEnd }; - func.apply(this, arguments); - this.setSelectionRange(cursor.start, cursor.end); - }; - } if (arguments.length === 1) { return selection2.property("value"); } if (shouldUpdate === void 0) { shouldUpdate = (a2, b2) => a2 !== b2; } - return selection2.each(stickyCursor(setValue(value, shouldUpdate))); + return selection2.each(setValue(value, shouldUpdate)); } // modules/util/keybinding.js diff --git a/vendor/assets/iD/iD/img/fa-sprite.svg b/vendor/assets/iD/iD/img/fa-sprite.svg index 7b4442c91..941c5c649 100644 --- a/vendor/assets/iD/iD/img/fa-sprite.svg +++ b/vendor/assets/iD/iD/img/fa-sprite.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 5ff60cd30..6256a8aef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -568,9 +568,9 @@ optionator@^0.9.3: type-check "^0.4.0" osm-community-index@^5.2.0: - version "5.5.4" - resolved "https://registry.yarnpkg.com/osm-community-index/-/osm-community-index-5.5.4.tgz#8e5ed12eed07206b507bfee594e264500f2d7cd3" - integrity sha512-n53euxtwFlJHaTkMCyRxPK+OZJnqkI4zwp9rmEbuzIV57kgkci7qaLDDjt44tszLcXfi8eCTLhKtykU0xIRpVQ== + version "5.5.5" + resolved "https://registry.yarnpkg.com/osm-community-index/-/osm-community-index-5.5.5.tgz#dd7a4d333d01dc83ac1b5cf83c3f0f99f4339ec4" + integrity sha512-bGl9WqkfPhIsAkv62QW2erlTQolSjMODmiH0Dp7ld2k1bTUz1D3ZRKRyjGi7fFuUwlrkE1MrbP0mRFezmPbaww== dependencies: diacritics "^1.3.0"