-
Notifications
You must be signed in to change notification settings - Fork 26
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
Added waiting time to waiting step (#460) #590
base: master
Are you sure you want to change the base?
Conversation
app/controllers/steps_controller.rb
Outdated
@@ -19,7 +19,7 @@ def update | |||
|
|||
@current_step = @journey.steps.find_by(slug: params[:id]) | |||
@user_step = @user_journey.user_steps.find_or_initialize_by(step: @current_step) | |||
@user_step.update(status: params['status']) | |||
@user_step.update_status(new_status: params['status']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preco tato zmena?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asi tam bola este nejaka logika @crutch? Vratil som tam update.
app/models/user_step.rb
Outdated
@@ -18,6 +18,18 @@ def refresh_status | |||
end | |||
end | |||
|
|||
def update_status(new_status:) | |||
update(status: new_status, submitted_at: new_status == 'waiting' ? Date.today : nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mozno lepsie tu dat waiting_until
ako nejaky datum kedy to vyprsi (nebude potom treba tolko pocitat).
lebo pri nejakom podani ti mozu lehotu aj posunut - cize je to od pripadu k pripadu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zatial som to nechal tak, aby tam ostala informacia kedy to bolo podane, mozno sa na nieco hodi.
Lehota vypršala pred: <strong class="govuk-tag govuk-tag--red"><%= format_past_days_count(-1 * remaining_time) %></strong> | ||
<% else %> | ||
Čakacia lehota: <strong class="govuk-tag govuk-tag--blue"><%= format_remaining_days_count(remaining_time) %></strong> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toto by mal vidiet este nejaky dizajner.
</div> | ||
<% elsif current_user_step.waiting? %> | ||
<div class="govuk-body-s sdn-todo-list-main-action__info"> | ||
<h2 class="govuk-heading-s">Podanie bolo zaslané |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Myslim, si ze tu treba lepsie "copy" lebo toto nemusi vzdy znamenat, ze to bolo podanie (aj ked vacsinou ano).
Zaroven sa mi zda ten navrh prilis vela textu a vela buttonov (velkych primarnych zelenych). Toto bude treba lepsie upratat. @xpavle00 ty si trufas aj na navrh toho ako by to malo vyzerat? (Staci sa pohrat s textami a govuk elementami)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skusil som to zjednodusit. Prilozim screeny.
@xpavle00 chvilu mi trvalo kym som sa prekusal k tomuto, ale uz sa ti venujem. |
Ahojte,
PR vznikol v ramci hackday ako minimalisticke riesenie issue #460. Admin ma moznost pridat lehotu a ta sa zobrazuje pri cakajucich krokoch a odpocitava od posledneho updatu.
Pridal som aj farebne rozlisenie zelena > 5+, oranzova 0 - 5, cervena < 5. (Moze sa upravit alebo zmazat)
Closes #460