1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/static/directives/org-binding.html
Marcus Kok f69716b867 marketplace: splittable sku for MW02702 (PROJQUAY-8151) (#3389)
* marketplace: splittable sku for MW02702 (PROJQUAY-8151)
* Alembic migration to drop unique constraint on the orgrhsubscriptions
  table
* Can split sub quantities of MW02702 across multiple orgs
* Can specify quantity for the MW02702 SKU across orgs on react UI
* Update angular UI to allow user to specify quantities for MW02702
2025-01-09 09:37:09 -05:00

54 lines
2.6 KiB
HTML

<div class="org-binding-settings-element" >
<span><h3>Subscriptions From Red Hat Customer Portal</h3></span>
<div class="cor-loader-inline" ng-show="marketplaceLoading"></div>
<span ng-show="!organization && !marketplaceLoading">
<div ng-repeat="subscription in userMarketplaceSubscriptions">
{{subscription.quantity}}x {{ subscription.metadata.privateRepos > 15000 ? 'unlimited' : subscription.metadata.privateRepos }} private repos
{{subscription.assigned_to_org ? "attached to org " + subscription.assigned_to_org : ""}}
</div>
</span>
<table ng-show="organization && !marketplaceLoading">
<tr class="indented-row" ng-repeat="subscription in orgMarketplaceSubscriptions">
<td>
{{ subscription.quantity }}x {{ subscription.metadata.privateRepos > 15000 ? 'unlimited' : subscription.metadata.privateRepos }} private repos attached to this org
</td>
</tr>
<tr class="indented-row">
<td style="padding: 10px">
<select class="form-control" ng-model="subscriptionBinding" ng-options="subscription as (subscription.quantity + 'x ' + (subscription.metadata.privateRepos > 15000 ? 'unlimited' : subscription.metadata.privateRepos) + ' private repos') for subscription in availableSubscriptions">
<option value="">Select a subscription</option>
</select>
<input
type="number"
class="form-control"
ng-show="subscriptionBinding.sku === 'MW02702'"
ng-model="bindingQuantity"
min="1"
max="{{subscriptionBinding.quantity}}"
ng-init="bindingQuantity = 1"
>
<a class="btn btn-primary" ng-click="bindSku(subscriptionBinding, subscriptionBinding.sku === 'MW02702' ? bindingQuantity : undefined)">Attach subscriptions</a>
</td>
<td style="padding: 10px">
<select class="form-control" ng-model="subscriptionRemovals">
<option ng-repeat="orgSubscription in orgMarketplaceSubscriptions" value="{{orgSubscription}}">
{{orgSubscription.quantity}}x {{orgSubscription.metadata.privateRepos > 15000 ? 'unlimited' : subscription.metadata.privateRepos}} private repos
</option>
</select>
<a class="btn btn-default" ng-click="batchRemoveSku(subscriptionRemovals, numRemovals)">
Remove subscriptions
</a>
</td>
</tr>
<div class="co-alert co-alert-success" ng-show="bindOrgSuccess">
Successfully bound subscription to org
</div>
<div class="co-alert co-alert-success" ng-show="removeSkuSuccess">
Successfully removed subscription from org
</div>
<tr>
</tr>
</table>
</div>