-
-
Notifications
You must be signed in to change notification settings - Fork 725
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
Add external billing id on enterprises #12980
base: master
Are you sure you want to change the base?
Add external billing id on enterprises #12980
Conversation
ccd284b
to
193be72
Compare
Oops, it seems I have some failing specs, working on it asap. |
LGTM! Many thanks @pacodelaluna ❤️ |
@pacodelaluna FYI the OFN docker image changed recently: #12905 |
@pacodelaluna sorry me again. Apologies I didn't pay a close attention to the screenshot the first time, and now that i'm playing with it I'm noticing that you've moved fields in the admin section that should remain accessible to enterprise managers/owners: These two need to stay in "primary details tab'. |
Hi @pacodelaluna sorry that you're having issues with Cuprite. I don't have time to help until next year sorry, but you can try posting in Slack #dev channel in case someone else can help. |
Apologies, I see I must have overridden you on the staging-FR server. I hope I did not cause too much trouble 🙏 |
no don't worry @filipefurtad0 and I see I've forgotten to remove the label 🤦♀️ please use it as much as you need on your timezone. FR team is developing a tool to automate invoices to OFN users, and this PR is needed for the tests, so I will stage it again in the next couples of days, but again feel free to use the staging during your time 💪 |
193be72
to
d90ca53
Compare
737f40b
to
b40e8a1
Compare
738bf85
to
3ddc08c
Compare
3ddc08c
to
3230159
Compare
I have finally succeeded in fixing the specs! |
if params[:is_primary_producer].present? | ||
@enterprise.is_primary_producer = params[:is_primary_producer] | ||
end | ||
@enterprise.sells = params[:enterprise_sells] if params[:enterprise_sells].present? |
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.
As the values can come from 2 different sides (Primary Details tab or Admin only tab), we need to control the presence of the value first.
@@ -15,8 +15,6 @@ | |||
%span.unavailable.hidden{data: { "permalink-target": "unavailable" }} | |||
= t('js.unavailable') | |||
%i.icon-remove-sign | |||
|
|||
- unless @enterprise.sells == 'none' |
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.
This control is already present on line 2.
@@ -0,0 +1,29 @@ | |||
import { Controller } from "stimulus"; | |||
|
|||
export default class extends Controller { |
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.
We need to cut down the initial logic into a new JS controller handling the Admin Only tab.
@@ -0,0 +1,5 @@ | |||
class AddExternalBillingIdOnEnterprises < ActiveRecord::Migration[7.0] | |||
def change | |||
add_column :enterprises, :external_billing_id, :string, limit: 128 |
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.
I put the limit at 128 chars as it seems enough, but it can be of course changed in case.
uncheck 'enterprise_is_primary_producer' | ||
click_button 'Update' |
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.
We need now to save explicitly the data before switching the tabs.
@pacodelaluna I'm not sure I understand
Can you provide more detail? Many thanks for the rest! The PR is now in code review |
@pacodelaluna when saving it sometimes tells me the business address company can't be blank: Yet business address company is in another tab, and it's often not the address that is missing but the company legal name. In production, this info is mandatory but only if you edit the tab, if you are on another tab, the tab is not checking the value of other tabs. Is this something we are introducing here? If yes, maybe we shouldn't try something new here and keep it simple / not add a new tab. I feel like we are spending a lot of time on this new tab, when we only need one new field 😅 Also FYI the PR needs a rebase. |
What? Why?
The objective is to improve the links between OFN enterprises and external billing tools, through the admin reports.
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
Add external billing id on enterprises
The title of the pull request will be included in the release notes.
Documentation updates
No. The tip section should explain the objective of the new field with enough details.