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, id,
description, description,
geom, geom,
floor,
street, street,
locality, locality,
postalCode, postalCode,

View File

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

View File

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

View File

@ -116,7 +116,7 @@ import {ParticipantRole} from "@/types/event.model";
<div class="address" v-if="event.physicalAddress"> <div class="address" v-if="event.physicalAddress">
<address> <address>
<span class="addressDescription" :title="event.physicalAddress.description">{{ event.physicalAddress.description }}</span> <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> <span>{{ event.physicalAddress.postalCode }} {{ event.physicalAddress.locality }}</span>
</address> </address>
<span class="map-show-button" @click="showMap = !showMap" v-if="event.physicalAddress && event.physicalAddress.geom"> <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(), locality: String.t(),
region: String.t(), region: String.t(),
description: String.t(), description: String.t(),
floor: String.t(),
geom: Geo.PostGIS.Geometry.t(), geom: Geo.PostGIS.Geometry.t(),
postal_code: String.t(), postal_code: String.t(),
street: String.t(), street: String.t(),
@ -26,7 +25,6 @@ defmodule Mobilizon.Addresses.Address do
@required_attrs [:url] @required_attrs [:url]
@optional_attrs [ @optional_attrs [
:description, :description,
:floor,
:geom, :geom,
:country, :country,
:locality, :locality,
@ -42,7 +40,6 @@ defmodule Mobilizon.Addresses.Address do
field(:locality, :string) field(:locality, :string)
field(:region, :string) field(:region, :string)
field(:description, :string) field(:description, :string)
field(:floor, :string)
field(:geom, Geo.PostGIS.Geometry) field(:geom, Geo.PostGIS.Geometry)
field(:postal_code, :string) field(:postal_code, :string)
field(:street, :string) field(:street, :string)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -76,7 +76,6 @@ defmodule Mobilizon.Service.Geospatial.Photon do
locality: Map.get(properties, "city"), locality: Map.get(properties, "city"),
region: Map.get(properties, "state"), region: Map.get(properties, "state"),
description: Map.get(properties, "name") || street_address(properties), description: Map.get(properties, "name") || street_address(properties),
floor: Map.get(properties, "floor"),
geom: geometry |> Map.get("coordinates") |> Provider.coordinates(), geom: geometry |> Map.get("coordinates") |> Provider.coordinates(),
postal_code: Map.get(properties, "postcode"), postal_code: Map.get(properties, "postcode"),
street: properties |> street_address() 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 # 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 { schema {
query: RootQueryType query: RootQueryType
@ -119,9 +119,6 @@ type Address {
country: String country: String
description: String description: String
"""The floor this event is at"""
floor: String
"""The geocoordinates for the point where this address is""" """The geocoordinates for the point where this address is"""
geom: Point geom: Point
id: ID id: ID
@ -141,9 +138,6 @@ input AddressInput {
country: String country: String
description: String description: String
"""The floor this event is at"""
floor: String
"""The geocoordinates for the point where this address is""" """The geocoordinates for the point where this address is"""
geom: Point geom: Point
id: ID id: ID

View File

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

View File

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