Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
feat(plan): Add a selection rule to the plan to select it using conte…
Browse files Browse the repository at this point in the history
…xtual data

closes gravitee-io/issues#2220
  • Loading branch information
brasseld committed May 29, 2019
1 parent d4e8ee7 commit b0f9fee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/management/api/portal/plans/plan/plan-wizard-security.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@

<br />

<section ng-if="$ctrl.securitySchema">
<md-subheader>Additional selection rule</md-subheader>
<form name="$ctrl.planGeneralForm">
<div layout-gt-sm="row">
<md-input-container class="md-block" flex-gt-sm>
<label>Rule</label>
<input ng-model="$ctrl.parent.plan.selection_rule" type="text" placeholder="Selection Rule" name="selectionrule">
<div class="hint">Define an additional rule when you're managing multiple plans of the same type to improve the plan's selection process.</div>
</md-input-container>
</div>
</form>
</section>

<md-step-actions layout="row">
<div flex>
<md-button ng-click="$ctrl.parent.moveToPreviousStep()">PREVIOUS</md-button>
Expand Down
9 changes: 7 additions & 2 deletions src/services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ class ApiService {
}

savePlan(apiId, plan): ng.IPromise<any> {
console.log(plan);
console.log(plan.selection_rule);

if (plan.id) {
return this.$http.put(this.apisURL + apiId + '/plans/' + plan.id,
{
Expand All @@ -274,7 +277,8 @@ class ApiService {
characteristics: plan.characteristics, order: plan.order, paths: plan.paths,
excluded_groups: plan.excludedGroups,
comment_required: plan.comment_required,
comment_message: plan.comment_message
comment_message: plan.comment_message,
selection_rule: plan.selection_rule
});
} else {
return this.$http.post(this.apisURL + apiId + '/plans',
Expand All @@ -284,7 +288,8 @@ class ApiService {
characteristics: plan.characteristics, type: plan.type, paths: plan.paths,
security: plan.security, securityDefinition: plan.securityDefinition, excluded_groups: plan.excludedGroups,
comment_required: plan.comment_required,
comment_message: plan.comment_message
comment_message: plan.comment_message,
selection_rule: plan.selection_rule
});
}
}
Expand Down

0 comments on commit b0f9fee

Please sign in to comment.