Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Allocation details page #366

Merged
merged 5 commits into from
May 4, 2023
Merged

Allocation details page #366

merged 5 commits into from
May 4, 2023

Conversation

samkevin1
Copy link
Contributor

@samkevin1 samkevin1 commented Mar 23, 2023

Page for details on a specific allocation:

Issue: #381

image

Copy link
Contributor

@adbatista adbatista left a comment

Choose a reason for hiding this comment

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

specs missing

Comment on lines 8 to 12
allocation = Allocation.find(params[:id])

@allocation_forecast = RevenueForecastService.allocation_forecast(allocation)
@allocation = allocation.decorate
@allocation_punches = allocation.user_punches
Copy link
Contributor

Choose a reason for hiding this comment

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

@allocation = Allocation.find(params[:id]).decorate
@allocation_forecast = RevenueForecastService.allocation_forecast(allocation)

allocation_punches seems unecessary

app/decorators/allocation_decorator.rb Outdated Show resolved Hide resolved
app/views/new_admin/allocations/show.html.erb Outdated Show resolved Hide resolved
app/views/new_admin/allocations/show.html.erb Outdated Show resolved Hide resolved
app/views/new_admin/allocations/show.html.erb Outdated Show resolved Hide resolved
app/views/new_admin/allocations/show.html.erb Outdated Show resolved Hide resolved
config/routes.rb Outdated Show resolved Hide resolved
app/views/new_admin/allocations/show.html.erb Outdated Show resolved Hide resolved
app/views/new_admin/allocations/show.html.erb Outdated Show resolved Hide resolved
<td class="px-4 py-3">
<div class="flex items-center text-sm">
<p class="text-sm text-gray-600 dark:text-gray-400 font-semibold">
<%= "#{allocation[:month]}/#{allocation[:year]}" %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not decorate it too?

@@ -0,0 +1,224 @@
<% content_for :page_title do %>
Copy link
Contributor

@fabiosammy fabiosammy Mar 23, 2023

Choose a reason for hiding this comment

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

This view seems too big. Can you split it into three partials? For each table

@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch 3 times, most recently from 9db8997 to a19cd41 Compare March 27, 2023 18:02
app/views/new_admin/allocations/_revenue_forecast.html.erb Outdated Show resolved Hide resolved
<td class="px-4 py-3">
<div class="flex items-center text-sm">
<p class="text-sm text-gray-600 dark:text-gray-400 font-semibold">
<%= allocation[:working_hours] %>
Copy link
Contributor

Choose a reason for hiding this comment

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

is allocation a hash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it is

@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch from a19cd41 to ea8ff25 Compare March 28, 2023 16:58
@samkevin1 samkevin1 force-pushed the new-admin-allocation-chart branch from 864ec38 to 3122bbe Compare March 28, 2023 18:03
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch from ea8ff25 to ddccac3 Compare March 28, 2023 18:05
@samkevin1 samkevin1 force-pushed the new-admin-allocation-chart branch from 3122bbe to 294be66 Compare March 28, 2023 18:12
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch 2 times, most recently from 31231f3 to fb9581f Compare March 30, 2023 17:21
@samkevin1 samkevin1 force-pushed the new-admin-allocation-chart branch from 5ea7f4b to 4224db4 Compare March 31, 2023 13:23
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch from fb9581f to ecbbced Compare March 31, 2023 13:35
@samkevin1 samkevin1 force-pushed the new-admin-allocation-chart branch from 4224db4 to 76c483f Compare April 4, 2023 17:03
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch from ecbbced to dd464e4 Compare April 4, 2023 17:07
@samkevin1 samkevin1 force-pushed the new-admin-allocation-chart branch from 76c483f to 920a833 Compare April 5, 2023 18:49
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch 2 times, most recently from 434bec1 to cd49db4 Compare April 6, 2023 13:49
@samkevin1 samkevin1 marked this pull request as ready for review April 6, 2023 18:04
Base automatically changed from new-admin-allocation-chart to feature/369 April 12, 2023 16:40
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch from cd49db4 to d8cbeeb Compare April 12, 2023 17:16
@samkevin1 samkevin1 force-pushed the new-admin-allocation-info branch from d8cbeeb to ca0dc08 Compare April 12, 2023 17:19
it 'returns the allocation forecast' do
get :show, params: { id: allocation.id }

forecast = subject.instance_variable_get(:@allocation_forecast)
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to test the rendered page

@adbatista adbatista merged commit 7d69d49 into feature/369 May 4, 2023
@adbatista adbatista deleted the new-admin-allocation-info branch May 4, 2023 14:01
adbatista pushed a commit that referenced this pull request Jul 14, 2023
* feat: create new_admin/monitoring route

* feat: copy windmill-dashboard style

* feat: remove windmill dependencies

* feat: create mentorings dashboard

* feat: add grouped mentors and mentees table

* feat: add navbar switch tabs

* change rows text style

* add mentors gravatar

* add style to tab button for new mentoring page

* add initial class for bg color for tab buttons

* Add Header for new_admin layout

* Add Sidebar for new_admin layout

* Add Header and Sidebar into new_admin layout

* Add toggle to switch to Dark mode

* Layout fixes

* Save theme in local storage

* Update theme icon

* Add profile image to header

* Add dynamic page title

* Update sidebar links

* Add mentoring icon to sidebar

* feat: New admin allocation chart (#363)

* feat: create allocation chart table

* Creating allocation chart decorator

* Changing sidebar icon

* Changing allocation decorator

* Fixing indentation and I18n call

* Changing allocation decorator and adding AllocationController tests

* Changing svg files used on the sidebar

* Changing controller tests approach

* Allocation details page (#366)

* Allocation details page

* Refactoring 'show' allocations view into smaller components

* Adding tests

* CSS fixes for light theme

* Changing behaviour of some tests

* feat: page for punch info (#367)

* Page for punch info

* Adding tests

* Edit allocation page (#376)

Co-authored-by: Alessandro Dias Batista <[email protected]>

* feature: new admin page for user info (#388)

* New admin page for user info

* Adding tests

---------

Co-authored-by: Alessandro Dias Batista <[email protected]>

* feat: new admin page for user allocations (#395)

* new admin page for user allocations

* feature test for user allocations tab

* add I18n translations

* finish user allocation details and tests

* fix: add route path in allocations page and fix allocation translation in show page

* improve test assertions

* feat: new admin page for user performance evaluations (#402)

* new admin page for user allocations

* feature test for user allocations tab

* finish user allocation details and tests

* improve test assertions

* new admin page for user allocations

* add translations in locale files

* new admin page for user evaluations

* feat: add message for no performance evaluations

* fix: query to performance evaluations

* fix: performance evaluations button in tab menu

* fix: create decorator to display correct evaluation date

* refactor: change performance evaluations query to use merge function

* fix: typo in 'performance' word

* refactor: add composable matchers

* fix: delete feature test inside controller spec

* feat: new admin user english evaluation page (#403)

* new admin page for user allocations

* feature test for user allocations tab

* finish user allocation details and tests

* improve test assertions

* new admin page for user allocations

* Adding tests

* update locale files

* new admin page for user english evaluations

* fix: evaluator name in assert condition

* fix: decorator to display correct date

* fix: delete feature test inside controller spec

* refactor: add composable matchers

* refactor: change english  evaluation query with merge method

---------

Co-authored-by: Samuel <[email protected]>

* feat: new admin user punches (#416)

* new admin page for user allocations

* feature test for user allocations tab

* finish user allocation details and tests

* improve test assertions

* new admin page for user allocations

* Adding tests

* add event listener to make punches tab active after filter punches

* new admin page for user punches

* add translations in locale files

* new admin user punches page

* test: add spec for filter_by_date punch scope

* test: spec for punch decorator extra_hour translation

* fix: delete feature test inside controller spec

* fix: add spacing to avoid overlapping elements in Capybara spec

* test: filter feature test

* fix: add literal words in the asserts

* fix: delete 'all' from query

* fix: from the fix: add composable matchers in the spec

---------

Co-authored-by: Samuel <[email protected]>

* Fix regressions in new admin pages (#468)

* fix regressions introduced by (#388)

* fix regressions introduced by (#402)

---------

Co-authored-by: felipe.richter <[email protected]>
Co-authored-by: feliperli <[email protected]>
Co-authored-by: André Moreira <[email protected]>
Co-authored-by: Antonio Paulino <[email protected]>
Co-authored-by: EmersonAraki <[email protected]>
Co-authored-by: mateusbw <[email protected]>
Co-authored-by: samkevin1 <[email protected]>
Co-authored-by: Alessandro Dias Batista <[email protected]>
Co-authored-by: u can call me Fabi <[email protected]>
Co-authored-by: Samuel <[email protected]>
Co-authored-by: Daniel M Brasil <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants