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

Feature: Renting manager role #916

Merged
merged 25 commits into from
Dec 30, 2024
Merged

Feature: Renting manager role #916

merged 25 commits into from
Dec 30, 2024

Conversation

Ellen-Wittingen
Copy link
Contributor

@Ellen-Wittingen Ellen-Wittingen commented Mar 18, 2024

Added a role for renting managers with which they have the following permissions:

  • Activities
    • See a list of all activities, also the ones that are locked
    • Create, edit, and delete activities
    • View an activity, including the tabs "Samenvatting", "Bestellingen", and "Producttotalen"
    • Access the order screen and place orders with it, but credit mutations (Geld inleggen)
  • Invoices
    • See a list of all invoices
    • View an invoice, but not edit or send it
  • Pricelists
    • See a list of all unarchived pricelists and the prices for each product, but not edit
  • Users
    • See a list of all manually added users, but not from AMBER except for themselves
    • View a manually added user and their credit, orders, and credit mutations

The following permissions were changed for main bartenders (after talking to Soccie):

  • Activities: In the activity view, only the tabs "Samenvatting" and "Producttotalen" can be viewed now.

I also added tests for the new renting-manager role and added some tests that were missing for some controllers. The syntax used is a bit inconsistent across tests (also in the already existing tests), I will fix this in some another pull request in the future.

To easily log in as the different roles, I added new users to the seeding of AMBER-API which are linked to SOFIA roles in the seeding of SOFIA, see #412

@Ellen-Wittingen Ellen-Wittingen marked this pull request as ready for review March 18, 2024 16:14
Copy link
Contributor

@lodewiges lodewiges left a comment

Choose a reason for hiding this comment

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

I tested and it looks good, you said in the description that test are not written in a consistent way. Could you elaborate on that so it can be fixed in the future? Sorry, it took so long to review it hopefully things improve in the future. for now Good Work Ellen.

app/policies/activity_policy.rb Outdated Show resolved Hide resolved
app/policies/price_list_policy.rb Outdated Show resolved Hide resolved
app/policies/user_policy.rb Outdated Show resolved Hide resolved
app/views/index/index.html.erb Outdated Show resolved Hide resolved
spec/controllers/price_lists_controller/create_spec.rb Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 6 lines in your changes missing coverage. Please review.

Please upload report for BASE (staging@465dc99). Learn more about missing BASE report.

Files with missing lines Patch % Lines
app/policies/activity_policy.rb 69.23% 4 Missing ⚠️
app/policies/price_list_policy.rb 87.50% 1 Missing ⚠️
app/policies/user_policy.rb 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             staging     #916   +/-   ##
==========================================
  Coverage           ?   75.17%           
==========================================
  Files              ?       55           
  Lines              ?     1116           
  Branches           ?        0           
==========================================
  Hits               ?      839           
  Misses             ?      277           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lodewiges
lodewiges previously approved these changes Dec 15, 2024
@lodewiges
Copy link
Contributor

lodewiges commented Dec 15, 2024

nevermind my bug fix broke the tests

@lodewiges lodewiges dismissed their stale review December 15, 2024 22:22

i broke tests

@lodewiges lodewiges self-requested a review December 28, 2024 00:04
@lodewiges
Copy link
Contributor

I implemented some changes, mostly small fixes to improve readability. and fixed an error due to an unpermitted parameter. I also changed the default text in the search bar on the product totals table to be more intuitive. Cause I was unable to determine what I could look op using the search bar.

@lodewiges lodewiges added this pull request to the merge queue Dec 30, 2024
Merged via the queue into staging with commit 37cf38d Dec 30, 2024
5 checks passed
@lodewiges lodewiges deleted the feat/secretary_role branch December 30, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants