Skip to content

Commit d4eaae2

Browse files
committed
feat(iam): add tag condition for custom policy
resolves: #MANAGER-19326 Signed-off-by: David Arsène <[email protected]>
1 parent ec7ee69 commit d4eaae2

28 files changed

+402
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import controller from './conditionList.controller';
2+
import template from './conditionList.template.html';
3+
4+
export const name = 'iamConditionList';
5+
6+
export default {
7+
bindings: {
8+
conditions: '=',
9+
},
10+
controller,
11+
template,
12+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default class IAMConditionListController {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<p>/!\ Condition List placeholder /!\</p>
2+
<p data-ng-repeat="condition in $ctrl.conditions track by $index">
3+
{{condition.values}}
4+
</p>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import angular from 'angular';
2+
3+
import component, { name } from './conditionList.component';
4+
5+
const moduleName = 'ovhManagerIAMConditionList';
6+
7+
angular.module(moduleName, []).component(name, component);
8+
9+
export default moduleName;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import controller from './createCondition.controller';
2+
import template from './createCondition.template.html';
3+
4+
export const name = 'iamCreateCondition';
5+
6+
export default {
7+
bindings: {
8+
conditions: '=ngModel',
9+
},
10+
require: '^ngModel',
11+
controller,
12+
template,
13+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default class IAMCreateConditionController {
2+
$onInit() {
3+
this.closeModal();
4+
}
5+
6+
openModal() {
7+
this.modalOpen = true;
8+
}
9+
10+
onConfirm = (condition) => {
11+
this.conditions.push(condition);
12+
this.closeModal();
13+
};
14+
15+
closeModal() {
16+
this.modalOpen = false;
17+
}
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<section class="mb-3">
2+
<iam-create-condition-modal
3+
data-ng-if="$ctrl.modalOpen"
4+
data-on-close="$ctrl.closeModal()"
5+
data-on-confirm="$ctrl.onConfirm"
6+
></iam-create-condition-modal>
7+
<oui-button data-on-click="$ctrl.openModal()">
8+
<span data-translate="iam_create_condition_add_button"></span>
9+
</oui-button>
10+
</section>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import component, { name } from './createCondition.component';
2+
import createConditionModal from '../createConditionModal';
3+
4+
const moduleName = 'ovhManagerIAMCreateCondition';
5+
6+
angular
7+
.module(moduleName, [createConditionModal])
8+
.component(name, component)
9+
.run(/* @ngTranslationsInject:json ./translations */);
10+
11+
export default moduleName;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"iam_create_condition_add_button": "Ajouter une condition"
3+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import controller from './createConditionModal.controller';
2+
import template from './createConditionModal.template.html';
3+
4+
export const name = 'iamCreateConditionModal';
5+
6+
export default {
7+
bindings: {
8+
onClose: '&',
9+
onConfirm: '<',
10+
},
11+
controller,
12+
template,
13+
};

0 commit comments

Comments
 (0)