Remove floor

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-11-06 12:51:17 +01:00
parent 3d2f9e1ad8
commit 0e7cf89492
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
15 changed files with 17 additions and 28 deletions

View file

@ -8,7 +8,6 @@ export const ADDRESS = gql`
id,
description,
geom,
floor,
street,
locality,
postalCode,

View file

@ -18,7 +18,6 @@ const participantQuery = `
const physicalAddressQuery = `
description,
floor,
street,
locality,
postalCode,

View file

@ -1,7 +1,6 @@
export interface IAddress {
id?: number;
description: string;
floor: string;
street: string;
locality: string;
postalCode: string;
@ -15,7 +14,6 @@ export interface IAddress {
export class Address implements IAddress {
country: string = '';
description: string = '';
floor: string = '';
locality: string = '';
postalCode: string = '';
region: string = '';

View file

@ -116,7 +116,7 @@ import {ParticipantRole} from "@/types/event.model";
<div class="address" v-if="event.physicalAddress">
<address>
<span class="addressDescription" :title="event.physicalAddress.description">{{ event.physicalAddress.description }}</span>
<span>{{ event.physicalAddress.floor }} {{ event.physicalAddress.street }}</span>
<span>{{ event.physicalAddress.street }}</span>
<span>{{ event.physicalAddress.postalCode }} {{ event.physicalAddress.locality }}</span>
</address>
<span class="map-show-button" @click="showMap = !showMap" v-if="event.physicalAddress && event.physicalAddress.geom">

View file

@ -14,7 +14,6 @@ defmodule Mobilizon.Addresses.Address do
locality: String.t(),
region: String.t(),
description: String.t(),
floor: String.t(),
geom: Geo.PostGIS.Geometry.t(),
postal_code: String.t(),
street: String.t(),
@ -26,7 +25,6 @@ defmodule Mobilizon.Addresses.Address do
@required_attrs [:url]
@optional_attrs [
:description,
:floor,
:geom,
:country,
:locality,
@ -42,7 +40,6 @@ defmodule Mobilizon.Addresses.Address do
field(:locality, :string)
field(:region, :string)
field(:description, :string)
field(:floor, :string)
field(:geom, Geo.PostGIS.Geometry)
field(:postal_code, :string)
field(:street, :string)

View file

@ -7,7 +7,6 @@ defmodule MobilizonWeb.Schema.AddressType do
object :address do
field(:geom, :point, description: "The geocoordinates for the point where this address is")
field(:floor, :string, description: "The floor this event is at")
field(:street, :string, description: "The address's street name (with number)")
field(:locality, :string, description: "The address's locality")
field(:postal_code, :string)
@ -32,7 +31,6 @@ defmodule MobilizonWeb.Schema.AddressType do
input_object :address_input do
# Either a full picture object
field(:geom, :point, description: "The geocoordinates for the point where this address is")
field(:floor, :string, description: "The floor this event is at")
field(:street, :string, description: "The address's street name (with number)")
field(:locality, :string, description: "The address's locality")
field(:postal_code, :string)

View file

@ -74,7 +74,6 @@ defmodule Mobilizon.Service.Geospatial.Addok do
locality: Map.get(properties, "city"),
region: Map.get(properties, "state"),
description: Map.get(properties, "name") || street_address(properties),
floor: Map.get(properties, "floor"),
geom: geometry |> Map.get("coordinates") |> Provider.coordinates(),
postal_code: Map.get(properties, "postcode"),
street: properties |> street_address()

View file

@ -127,7 +127,6 @@ defmodule Mobilizon.Service.Geospatial.GoogleMaps do
locality: Map.get(components, "locality"),
region: Map.get(components, "administrative_area_level_1"),
description: description,
floor: nil,
geom: [lon, lat] |> Provider.coordinates(),
postal_code: Map.get(components, "postal_code"),
street: street_address(components),

View file

@ -115,7 +115,6 @@ defmodule Mobilizon.Service.Geospatial.MapQuest do
locality: Map.get(address, "adminArea5"),
region: Map.get(address, "adminArea3"),
description: Map.get(address, "street"),
floor: Map.get(address, "floor"),
geom: [lng, lat] |> Provider.coordinates(),
postal_code: Map.get(address, "postalCode"),
street: Map.get(address, "street")

View file

@ -78,7 +78,6 @@ defmodule Mobilizon.Service.Geospatial.Nominatim do
locality: Map.get(address, "city"),
region: Map.get(address, "state"),
description: description(body),
floor: Map.get(address, "floor"),
geom: [Map.get(body, "lon"), Map.get(body, "lat")] |> Provider.coordinates(),
postal_code: Map.get(address, "postcode"),
street: street_address(address),

View file

@ -76,7 +76,6 @@ defmodule Mobilizon.Service.Geospatial.Photon do
locality: Map.get(properties, "city"),
region: Map.get(properties, "state"),
description: Map.get(properties, "name") || street_address(properties),
floor: Map.get(properties, "floor"),
geom: geometry |> Map.get("coordinates") |> Provider.coordinates(),
postal_code: Map.get(properties, "postcode"),
street: properties |> street_address()

View file

@ -0,0 +1,15 @@
defmodule Mobilizon.Storage.Repo.Migrations.RemoveFloorFromAddresses do
use Ecto.Migration
def up do
alter table(:addresses) do
remove(:floor)
end
end
def down do
alter table(:addresses) do
add(:floor, :string)
end
end
end

View file

@ -1,5 +1,5 @@
# source: http://localhost:4000/api
# timestamp: Wed Oct 30 2019 17:12:28 GMT+0100 (Central European Standard Time)
# timestamp: Wed Nov 06 2019 12:50:45 GMT+0100 (Central European Standard Time)
schema {
query: RootQueryType
@ -119,9 +119,6 @@ type Address {
country: String
description: String
"""The floor this event is at"""
floor: String
"""The geocoordinates for the point where this address is"""
geom: Point
id: ID
@ -141,9 +138,6 @@ input AddressInput {
country: String
description: String
"""The floor this event is at"""
floor: String
"""The geocoordinates for the point where this address is"""
geom: Point
id: ID

View file

@ -12,7 +12,6 @@ defmodule Mobilizon.AddressesTest do
locality: "some addressLocality",
region: "some addressRegion",
description: "some description",
floor: "some floor",
postal_code: "some postalCode",
street: "some streetAddress",
geom: %Geo.Point{coordinates: {10, -10}, srid: 4326}
@ -22,7 +21,6 @@ defmodule Mobilizon.AddressesTest do
locality: "some updated addressLocality",
region: "some updated addressRegion",
description: "some updated description",
floor: "some updated floor",
postal_code: "some updated postalCode",
street: "some updated streetAddress",
geom: %Geo.Point{coordinates: {20, -20}, srid: 4326}
@ -32,7 +30,6 @@ defmodule Mobilizon.AddressesTest do
# addressLocality: nil,
# addressRegion: nil,
# description: nil,
# floor: nil,
# postalCode: nil,
# streetAddress: nil,
# geom: nil
@ -54,7 +51,6 @@ defmodule Mobilizon.AddressesTest do
assert address.locality == "some addressLocality"
assert address.region == "some addressRegion"
assert address.description == "some description"
assert address.floor == "some floor"
assert address.postal_code == "some postalCode"
assert address.street == "some streetAddress"
end
@ -66,7 +62,6 @@ defmodule Mobilizon.AddressesTest do
assert address.locality == "some updated addressLocality"
assert address.region == "some updated addressRegion"
assert address.description == "some updated description"
assert address.floor == "some updated floor"
assert address.postal_code == "some updated postalCode"
assert address.street == "some updated streetAddress"
end

View file

@ -83,7 +83,6 @@ defmodule Mobilizon.Factory do
description: sequence("MyAddress"),
geom: %Geo.Point{coordinates: {45.75, 4.85}, srid: 4326},
url: "http://mobilizon.test/address/#{Ecto.UUID.generate()}",
floor: "Myfloor",
country: "My Country",
locality: "My Locality",
region: "My Region",