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

[PR] Edit timer #196

Merged
merged 55 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e3b9165
feat: Example UI done.
LuchoTurtle Oct 27, 2022
38e4e32
feat: Adding timer field to item when fetching.
LuchoTurtle Oct 27, 2022
8606526
fix: Removing nil timers.
LuchoTurtle Oct 27, 2022
cdae413
fix: Returning truncated format to LIveview.
LuchoTurtle Oct 27, 2022
57f7911
feat: Finally passing data to server.
LuchoTurtle Oct 28, 2022
3556726
feat: Updating timer info on repo. Fixing IDs.
LuchoTurtle Oct 28, 2022
9fefc71
fix: Fixing when no timers are found.
LuchoTurtle Oct 28, 2022
5c0a97d
fix: Error handling and fixing format issues on CI.
LuchoTurtle Oct 31, 2022
7cb2e9b
fix: Fixing formatting errors.
LuchoTurtle Oct 31, 2022
233b6de
feat: Adding tests for DateTimeParser.
LuchoTurtle Oct 31, 2022
c242dfd
feat: Increasing code coverage.
LuchoTurtle Oct 31, 2022
909918b
feat: Adding docs to DateTimeParser.
LuchoTurtle Oct 31, 2022
38c0d42
fix: Formatting test files.
LuchoTurtle Oct 31, 2022
24d15f9
fix: Fixing test.
LuchoTurtle Oct 31, 2022
684101c
fix: Fixing unwanted commit.
LuchoTurtle Oct 31, 2022
ffd1c72
fix: Fixing broadcast bug.
LuchoTurtle Nov 2, 2022
ecc2ef5
fix: Fixing introduced bug on saving item.
LuchoTurtle Nov 2, 2022
c1fd3ea
feat: Updating BUILD.MD.
LuchoTurtle Nov 3, 2022
17ca24b
feat: Adding timer changeset array to socket assigns and erroring thr…
LuchoTurtle Nov 4, 2022
211a93c
feat: Removing unnecessary list of timers when fetching items on mount.
LuchoTurtle Nov 4, 2022
45df2a1
fix: Fixing duplicate form when error occurs.
LuchoTurtle Nov 4, 2022
db5e040
feat: Creating method to error out timer changeset.
LuchoTurtle Nov 5, 2022
8b09799
fix: Fixing tests.
LuchoTurtle Nov 5, 2022
b255561
feat: Add remaining update tests.
LuchoTurtle Nov 5, 2022
d0789f4
Merge branch 'array_of_changesets' into edit-timer
LuchoTurtle Nov 5, 2022
b538b86
fix: Fixing format.
LuchoTurtle Nov 5, 2022
d8360f7
feat: Updating timer.
LuchoTurtle Nov 7, 2022
2642334
fix: Fixing warnings.
LuchoTurtle Nov 8, 2022
d601dc0
fix: Format code.
LuchoTurtle Nov 8, 2022
0f0b813
update table of contents in BUILDIT.md as per https://github.com/dwyl…
nelsonic Nov 9, 2022
e125fae
fix: Errors are cleared on another submit. #195.
LuchoTurtle Nov 10, 2022
2f9bc89
feat: Checking if timer being edited overlaps with others #195
LuchoTurtle Nov 10, 2022
d2c2b91
fix: Uncommenting update timer line.
LuchoTurtle Nov 10, 2022
ac53751
fix: Editing timers while running works properly. #195
LuchoTurtle Nov 11, 2022
1bcdaca
feat: Adding tests to test behaviour when editing timers. #195
LuchoTurtle Nov 11, 2022
76c0a50
fix: Formatting files. #195
LuchoTurtle Nov 11, 2022
b2171d7
fix: Fixing auth test. #195
LuchoTurtle Nov 11, 2022
356d69a
fix: Format test file.
LuchoTurtle Nov 11, 2022
8d7a449
fix: Deleting parser in favour of using Timex.
LuchoTurtle Nov 14, 2022
be0ba43
fix: Refactoring erroring timer changeset to Timer file.
LuchoTurtle Nov 14, 2022
5f70ee9
fix: Refactoring changeset code to timer.ex.
LuchoTurtle Nov 14, 2022
0e5a49e
fix: Refactoring erroring changeset in Timer.ex. #195
LuchoTurtle Nov 14, 2022
6536a5f
fix: Fixing tests on ongoing timers and refactoring to Timer.ex. #195
LuchoTurtle Nov 14, 2022
71d2f4e
fix: Adding documentation and simplifying controller pattern matching…
LuchoTurtle Nov 14, 2022
1b62bd7
fix: Updating BUILD.md file. #195
LuchoTurtle Nov 14, 2022
10f400b
fix: Formatting files.
LuchoTurtle Nov 14, 2022
358d85a
fix: Commenting adding Timex as dependency.
LuchoTurtle Nov 15, 2022
71592db
fix: Fixing test warning on "handle_info/2 update with editing open".
LuchoTurtle Nov 15, 2022
e4b7f4c
Merge remote-tracking branch 'origin/edit-timer' into edit-timer
LuchoTurtle Nov 15, 2022
60ede76
fix: Pattern matching on `update_timer_inside_changeset_list`.
LuchoTurtle Nov 15, 2022
677f68d
fix: Fixing editing historical timer while there is an ongoing timer.
LuchoTurtle Nov 19, 2022
042a6ce
fix: Formatting files.
LuchoTurtle Nov 19, 2022
8225674
fix: Updating BUILD.md file.
LuchoTurtle Nov 19, 2022
53b7de6
fix: Fix tests for 100% coverage.
LuchoTurtle Nov 21, 2022
38b26ae
remove "environment: dwylauth" from ci.yml
nelsonic Nov 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions lib/app_web/live/app_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,16 @@ defmodule AppWeb.AppLive do
start = DateTimeParser.parse!(timer_start, "%Y-%m-%d %H:%M:%S")
stop = DateTimeParser.parse!(timer_stop, "%Y-%m-%d %H:%M:%S")

Logger.debug("start #{start}")
Logger.debug("stop #{stop}")
bruh = DateTime.compare(start, stop)

Timer.update_timer(%{
id: id,
start: start,
stop: stop
})
case DateTime.compare(start, stop) do
LuchoTurtle marked this conversation as resolved.
Show resolved Hide resolved
:lt -> Timer.update_timer(%{ id: id, start: start, stop: stop })
:eq -> Logger.debug("dates are the same")
:gt -> Logger.debug("Start is newer that stop")
end

rescue
e -> Logger.debug("NO UPDATE, ERROR")
e -> Logger.debug("Date format invalid on either start or stop, #{inspect(e)}")
end

#AppWeb.Endpoint.broadcast(@topic, "update", :update)
Expand Down
4 changes: 2 additions & 2 deletions lib/app_web/live/app_live.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@
<div>
<%= if (length item.timers) > 0 do %>
<h1 class="text-4xl font-bold">Timers</h1>
<%= else %>
<% else %>
<h1 class="text-2xl text-center font-semibold text-slate-400">No timers associated with this item.</h1>
<%= end %>
<% end %>

<div class="flex flex-col w-full mt-2">
<%= for timer <- item.timers do %>
Expand Down