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

Arbitrary station positions (drag+drop and refactor) #93

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

babbaj
Copy link

@babbaj babbaj commented Aug 18, 2024

  • Simplified the DB schema (made station_id the primary key for stations and stations_status)
  • Squashed all the migrations because we can just reset the DB
  • Removed columns and rows from settings, now computed from xy data
  • Station state(is_broken) is stored in stations_status to avoid being deleted by saving settings
  • Station positions are defined by the station_layout table
  • Improved settings page (drag+drop, number of stations, empty slots)
  • Spammed commits to pad my github activity

Comment on lines +259 to +261
IO.puts("Transaction failed!")
IO.inspect(failed_operation)
IO.inspect(failed_value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Logger.debug/1 here instead of directly printing out with IO.

IO.inspect(failed_value)
socket |> put_flash(:info, "Transaction failed")
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make empty colums/rows disappear from the visual designer when hitting save to reflect the state of the database and other display pages at that moment.

@@ -17,12 +17,10 @@ defmodule Lanpartyseating.SettingsLogic do
end
end

# returns an Ecto.Multi that has to be written
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap this in an @doc """ """ string so it can be rendered out into generated documentation

|> Enum.into(%{})
end

# {columns, rows}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap this in an @doc """ """ string so it can be rendered out into generated documentation

def save_station_positions(table) do
Repo.delete_all(Station)

def save_stations(grid) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this function to something more clear because it does not actually save the stations as it is written now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants