giseldo/neodataset huggingface dataset:
Add banner to Customers Portal for admin viewing a blocked customer

## Summary

We need a more obvious notification for internal customers portal admins to know when a customers is blocked (as per https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/1373). 

Let's create a banner displayed to admins when impersonating a customer who is blocked in the customers portal.

The banner should read: "This is a blocked customer account which was sold by a reseller. The user cannot have access to this account."

Story points: 2.0
Extract logic from the SeatLinksController into services

### Problem
The `SeatLinksController` has some complex logic now for creating `LicenseSeatLink` and `Reconciliation` records.

### Proposal
It would might be nice to extract into a service or their own services to simplify the logic in the controller.  This could make testing easier/cleaner as well.  It would also be nice to wrap the `LicenseSeatLink` and `Reconciliation` record saves in a transaction to ensure the Reconciliation is created/updated if the LicenseSeatLink is created.

### Result
A cleaner and reliable `SeatLinksController`.

Story points: 2.0
Make "Manage Purchases" more mobile friendly

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

With dynamic content we're seeing some of our tables span quite a bit of width. This makes for a very unfortunate look on mobile screens.

![Screenshot_2020-05-20_at_09.42.03](/uploads/d6884e342b714ab80134f0657754b060/Screenshot_2020-05-20_at_09.42.03.png)


### Proposal

1. Add `gl-overflow-x-auto` to GitLab-UI
1. Use `gl-overflow-x-auto` [in Subscription Product details](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/app/frontend/javascripts/subscription/components/subscription_product_details.vue#L101)

Story points: 2.0
Remove temporary rake task for backfilling zuora_subscription_id

### Problem
In https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/1422, we introduced a rake task for backfilling the `zuora_subscription_id` on the `license_seat_links` table.  After this task is run in staging and production, we should be able to safely remove it from the codebase.

### Proposal
Remove the [rake task](https://gitlab.com/gitlab-org/customers-gitlab-com/blob/5f1e585c5ea2cd96f74cca70f9f9f7017268a78b/lib/tasks/seat_link.rake).

Story points: 0.0
Backfill zuora_subscription_id in license_seat_links table

The following discussion from !1401 should be addressed:

- [ ] @asubramanian1 started a [discussion](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1401#note_344593969):  (+2 comments)

    > Should we also backfill existing data?
    > 
    > The column may not be usable to query if only part of records have values.

Story points: 1.0
Add ability to run Sidekiq inline for testing

### Problem

For some areas of the app, mainly during feature tests we might want to validate the job's execution,
to accomplish this we want to enable the sidekiq inline testing mode on demand for some blocks of code 
but we don't have the configuration in place today to do so.

### Proposal

To improve end to end testing we want to allow the jobs to run inline when executing some tests.
To do this we want to configure sidekiq for testing in the same way it is configured for Gitlab
to be able to use blocks:

```ruby
Sidekiq::Testing.inline! do
...
end
```
to wrap the test parts where we don't want the execution to wait for the job to be done.

Reference: https://github.com/mperham/sidekiq/wiki/Testing

### Result

### Next steps (if any)

### How will we measure success?

Story points: 2.0
Identify Sentry errors related to customers portal failing to update GitLab.com

### Problem

In order to resolve support requests for .com customers, and to ensure messaging (banners etc) on .com accounts are correct we need to first identify the existing errors where the `customers portal` has failed to update GitLab.com accounts. 

As a follow up, a decision on what to do with these errors can be made. 

### Proposal

Review Sentry errors for the `customers portal`, identify all specific and generic (Runtime) errors that relate to the portal not updating GitLab.com accounts, and provide instructions on how to access these in Sentry (a link, or a list of error types / messages).

### Result

1. PMs and Engineers can find related errors in Sentry
1. PMs can decide on next steps (email, slack integration, etc)
1. Engineers can make recommendations to add error classes to handle any related Runtime errors, or other code changes to assist with initial triage of support requests.

Sentry link: https://sentry.gitlab.net/gitlab/customersgitlabcom/?query=is%3Aunresolved+Error+updating+subscription

Story points: 1.0
Handle blocking .com Customers in reseller deals

### Problem
In #1373, Logic was added to prevent customers created via reseller subscriptions from logging into the Customers Portal.  In addition, the welcome/new customers email is also skipped for these blocked customers (where `customer.login_activated == false`).  However, for .com customers there is [an additional email](https://gitlab.com/gitlab-org/customers-gitlab-com/blob/6820453fb6eae264dd4b3c91c3f44bb4700729ee/app/views/customer_mailer/gl_com_purchase_from_sf.html.haml) delivered to instruct the customer to login to the Portal and apply the new subscription to a namespace.

### Proposal
This issue was brought up in [this coversation](https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/1373#note_343474790).  @amandarueda and I decided to handle this in a separate issue but we still need to determine how to handle these.  It could possibly be a different email but we need to figure out how the namespace will be applied.

The feature flag for this issue, `:block_reseller_customer`, cannot be enabled until we either handle this use case, or skip blocking these types of customers.

Story points: 2.0
Follow-up: Verify change namespace page in staging


This is a follow-up to #956, while the development work is done and merged, we need to verify the changes on staging before we enable the feature flag.

The change will be under [`pajamas_purchase_change_group`](https://gitlab.com/gitlab-org/customers-gitlab-com/-/feature_flags/11/edit) feature flag.

### Next Steps

- [x] Verify the change on staging
- [x] Send the issue to Amanda and Tim for approval
- [x] Enable the feature flag for production
- [x] Create a follow-up issue to clean up the change namespace page after 6 weeks #1466

Story points: 3.0
Add curly: all to eslint config

### Problem

### Proposal

Adopt [`curly: all`](https://eslint.org/docs/rules/curly#all) in our eslint config to enhance code readability.

The rule can fix its errors automatically with `--fix` or using `yarn run eslint-fix`, no overhead on the engineer.

The implementation could be done on two steps:

- Add the rule to `.eslintrc.yml`
- Fix any violation with `--fix`

### Result

Happy engineers where they can have more readability over the code :smile: 

### Next steps (if any)

Schedule it for development

### How will we measure success?

Story points: 2.0
Include zuora_subscription_id when saving license seat link data

### Problem
As @derekatwood mentioned [here](https://gitlab.com/gitlab-data/analytics/-/issues/4709#note_342810124), `zuora_subscription_id` is commonly used in the data warehouse.  We aren't currently tracking this in the `license_seat_links` table.

### Proposal
Add the column `zuora_subscription_id` to the `license_seat_links` table.  Persist this data when the receiving a seat link API request.

### Result
Better data for data warehouse reporting.

Story points: 1.0
Follow-up: remove bootstrap-switch from js, scss and dependencies

Original discussion https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1357#note_342431497

With https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1357 merged we're no longer using the HAML implementation to render purchased subscriptions.

We've got some JS to handle client side interactivity that has been deprecated; downloading license, cancelling/resuming subscriptions. We should remove this.

Looking at [`dispatcher.js`](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/app/assets/javascripts/dispatcher.js#L41-45)

```
import LicenseFinder from './license_finder';
import SubscriptionCards from './subscription_cards';
...
    case 'subscriptions:show':
    case 'subscriptions:index':
      SubscriptionCards();
      LicenseFinder();
      break;
```

Bootstrap-switch should also be removable at this point.

Story points: 2.0
Make the VAT field in customer account detail alphanumeric

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

Some country requires VAT ID and from time to time the VAT ID requires an alphabetical prefix like DEXXXXXXXX or DE-XXXXXXX.

### Proposal

Allow other characters in the VAT fields so that customer can enter their VAT ID correctly. 



This is affecting: https://gitlab.zendesk.com/agent/tickets/156724

Story points: 1.0
BE: Allow users to manually renew subscription up to 30 days post expiration

## Summary

When the subscription expiration date is reached, we remove purchase event buttons (upgrade, add-on, renew, autorenew) from the subscription card. We specifically removed the `Renew` button because the system wasn't processing the renewal properly upon selection. 

## Proposal
As per the Sales/Finance [policy](https://gitlab.com/gitlab-com/sales-team/field-operations/sales-operations/-/issues/1653#note_422409896) of updating customer subscriptions to cancelled and closing the respective Renewal opportunity 30 days after subscription term end date, we should allow the customer to renew their expired subscription within customers.gitlab.com with a 30 day grace period as well.

## Success Criteria

1. This applies to both GitLab.com and Self-Managed subscriptions
1. This change does not extend the paid entitlement (SM license/GitLab.com paid features), nor the period in which the customer is entitled to paid support 
1. In customers.gitlab.com, when the expiration date is reached, all action buttons (upgrade, add seats, autorenew) should be removed except `Renew`
1. The user should be able to select the `Renew` button for a period of 30 days post the expiration date
1. Customers.gitlab.com should present the standard Renewal purchase flow to the customer and accept payment during checkout
     1. If payment fails, the transaction should not be processed and no change should be sent to Zuora
     1. If payment is successful, customers.gitlab.com should send a renewal amendment to Zuora with the subscription details

## Testing & Availability
1. `Renew` button is available on CustomersDot manage plan page if plan's expiration date is within last 30 days
1. For SaaS user, `Renew` button is also available on personal/group billing page
1. Hide `renew` button if the subscription expired more than 30 days ago
1. Upon clicking `renew` button, user enters the normal upgrade + renew flow.


## Reported examples

1. https://gitlab.zendesk.com/agent/tickets/156267
1. https://gitlab.zendesk.com/agent/tickets/157817
1. https://gitlab.zendesk.com/agent/tickets/162428
1.

Story points: 3.0
Graduate Auto Renew cancel experiment from feature flag

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

The auto renew cancellation experiment has been running at 100% for a while.

We can safely say it the results are a success and we should graduate this out of the feature flag stage.

* Remove mentions of `auto_renew_cancellation` in code
* Remove specs covering this
* Remove [feature flag](https://gitlab.com/gitlab-org/customers-gitlab-com/-/feature_flags/1/edit)

Story points: 2.0
No Portal access for customers in reseller deals

### Problem
In #1169, we've identified new workflows necessary to better facilitate reseller deals.  However, those new workflows, like allowing resellers access to the Customers Portal, could have big implications for the app and implementing those features could take significant effort.

### Proposal
As an MVC, we want to block all users from reseller deals from gaining access to the Customers Portal.  The Customers Portal should still create Customer records, necessary for keep existing features working like subscription creation and license management, but simply do not allow those Customers to sign in.  In addition, these Customers should not receive welcome emails from the Portal.  They should however, still receive emails for EULA acceptance and license delivery.

### Result
The end user in reseller deals can't login to the Customers Portal for reseller deals.

/cc @amandarueda

Story points: 3.0
Change ENV key for Zuora CC Page ID for test env

At the moment the ENV key for `zuora_cc_payment_page_id` is the same for all environments. But there is a specific Page ID for `CI Pipelines` that has to be used for the test environment to allow Capybara's app host url. Therefore we should make clear that there's a different in the keys and rename the one that's used for the test env.

Story points: 1.0
Allow customers to turn off auto-renew feature for EE subscriptions if EE instance does not send seat link data

This is a follow-up issue from #1264.

We disallow the customer with a EE subscription to turn on `auto-renew` if they don't have seat link data (this is covered by the current implementation). But if the customer has a EE subscription with `auto-renew` toggle on then we **should** allow to turn it off but if they don't send seat link data they can't turn it back on.

Story points: 1.0
Introduce URL builder

Our [client side api](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/app/frontend/javascripts/api.js) is growing a bit.

Maybe it's time to adopt a [buildUrl helper](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1343#note_338722780) similar to the one in the [gitlab repo](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/api.js#L543)

Probably makes sense to have an interface similar to

```
urlBuilder(PREVIEW_UPGRADE_SUBSCRIPTION_URL, {
  subscription_name: subscriptionName
})
```


### Pros

* Clear way of how to build urls
* Central place for existing urls (makes discovery easier)

### Cons

* It's more code to maintain

Story points: 3.0
Update change namespace portal design

### Problem

Thanks to @aalakkad we have a new `Change namespace` flow https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/860. I think that we can refine the experience and make it even easier for users to change the namespace associated with a subscription.

### Proposal

| Design | Info |
| ------ | ------ |
| ![GitLab.com_-_Change_subscription_namespace](/uploads/3adc9bdf1b7eaeb5cafeda1afb2495be/GitLab.com_-_Change_subscription_namespace.png) | **Select namespace**<br>[**Design Specs**](https://www.figma.com/file/yjusTZF6Qgr4DzXkvE5bK2/Customers-Portal-Templates?node-id=264%3A397)<br><br>Namespace details section now occupies the white space to the right. |
| ![GitLab.com_-_Change_subscription_namespace_-_No_charge](/uploads/db2abdf38e2cd0648941db7848f5dda4/GitLab.com_-_Change_subscription_namespace_-_No_charge.png) | **Select namespace - No charge**<br>[**Design Specs**](https://www.figma.com/file/yjusTZF6Qgr4DzXkvE5bK2/Customers-Portal-Templates?node-id=261%3A3946)<br><br>If no additional charges apply the confirm button is activated. | 
| ![GitLab.com_-_Change_subscription_namespace_-_Additional_charge](/uploads/d92145bbe715fcd62ceb740300f08090/GitLab.com_-_Change_subscription_namespace_-_Additional_charge.png) | **Select namespace - Additional charges**<br>[**Design Specs**](https://www.figma.com/file/yjusTZF6Qgr4DzXkvE5bK2/Customers-Portal-Templates?node-id=264%3A204)<br><br>If additional charges apply the left details section expands with details on charge and rebate with final total sum calculated. | 

### Result

*  Better use of space
*  Clearer breakdown when additional charges apply

Story points: 3.0
Create a helper for accessing or setting up the Unleash context in models

The following discussion from !1247 should be addressed:

- [ ] @tyleramos started a [discussion](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1247#note_334529405):  (+4 comments)

    > I was thinking that all new feature flags would use [Unleash](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/README.md#feature-flags-unleash).  I think it might be good to switch this (and the others below) if it's easy.  WDYT?

Story points: 2.0
Create a concern for sharing methods between Order and Subscription

The following discussion from !1247 should be addressed:

- [ ] @tyleramos started a [discussion](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/1247#note_333945666):  (+1 comment)

    > **Suggestion:**  I realize now that this is on the order, we might be able to use the `product_rate_plan_id` on the order to determine if this is a dot com plan, rather than querying the subscription. Actually, going a bit further, there are a lot of methods on subscription that could apply to the order as well (`belongs_to_gitlab_ee_plan?`, `legacy_plan?`, etc).  Basically anything that refers to the plan could be shared.  It's a minor point as this way works too, but it would be more efficient to avoid the call to Zuora.  I'm happy to tackle this in a followup issue though as we could move multiple methods to a concern shared between order and subscription.

Story points: 2.0
Consider changing VAT field to be optional

### Problem

When a customer is registering through the customers portal from EU country, we show a required VAT field.

Maybe if the customer registering for a personal account they don't want to add the VAT field, but they are forced to do it in order to complete the registration form.

### Proposal

When a customer is registering from an EU country, we show the VAT field but without it being required.

### Result


### Next steps (if any)

- Validate the proposal
- Schedule

### How will we measure success?

Story points: 1.0
Do not print error messages from Salesforce worker in development

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

Running any test in development prints the following message: `2020-04-28T13:09:08.251Z 8114 TID-ow1fn9te8 ERROR: {"message"=>"Error creating Salesforce Account", "customer_id"=>5, "subscription_name"=>"A-S00000000", "invoice_id"=>""}`
This message is a bit annoying because it breaks the output:

```
AmendSubscriptionService
  #execute
    on renewal
      with renew only
2020-04-28T13:07:45.837Z 8114 TID-ow1fn9te8 ERROR: {"message"=>"Error creating Salesforce Account", "customer_id"=>1, "subscription_name"=>"A-S00000000", "invoice_id"=>""}
        renews the subscription
        when passed quantity (1) less than actual (3)
2020-04-28T13:08:02.859Z 8114 TID-ow1fn9te8 ERROR: {"message"=>"Error creating Salesforce Account", "customer_id"=>2, "subscription_name"=>"A-S00000000", "invoice_id"=>""}
          generates amendment with the actual quantity
      with a trueup
2020-04-28T13:08:25.442Z 8114 TID-ow1fn9te8 ERROR: {"message"=>"Error creating Salesforce Account", "customer_id"=>3, "subscription_name"=>"A-S00000000", "invoice_id"=>""}
        generates two amendments
    when updating quantity
2020-04-28T13:08:46.702Z 8114 TID-ow1fn9te8 ERROR: {"message"=>"Error creating Salesforce Account", "customer_id"=>4, "subscription_name"=>"A-S00000000", "invoice_id"=>""}
      updates the quantity
2020-04-28T13:09:08.251Z 8114 TID-ow1fn9te8 ERROR: {"message"=>"Error creating Salesforce Account", "customer_id"=>5, "subscription_name"=>"A-S00000000", "invoice_id"=>""}
      doesnt explode
```

These messages are also visible in CI env.

### Proposal

**1st Option:** Remove or silence these messages.

**2nd Option:** Disable `CreateSalesforceAccountWorker` in `test` environment.

### Result

Clean and nice output without error messages.

### Next steps (if any)

### How will we measure success?

Story points: 2.0
Update Zuora iFrame CSS styles to match recently updated colors in @gitlab/ui

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

Color variables were [changed](https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/1099) in `@gitlab/ui` that commit introduced differences between current colors in `@gitlab/ui` and colors in `zuora.scss`.

For example, mismatched background color:

![image](/uploads/885b24367211a4fc1615ee68fadcab8d/image.png)

### Proposal

Update color variables in `zuora.scss` to match current.

### Result

### Next steps (if any)

### How will we measure success?

Story points: 3.0
Graduate Pajamas Update: "Manage Purchases" from feature flag (cleanup)

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->
Pajamas Update: "Manage Purchases" has been live for 3 weeks at the time of writing.

We should clean up after ourselves :)

* Remove instances of `pajamas_subscriptions`
* Remove old HAML implementation of Manage Purchases
* Remove old HAML specific styles
* Remove specs that test Manage Purchases page without feature flag
* Remove feature flag from https://gitlab.com/gitlab-org/customers-gitlab-com/-/feature_flags
### How will we measure success?

Story points: 3.0