Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit 62913df

Browse files
authored
Merge pull request #384 from ovh-ux/master
Sync master to develop
2 parents a59bf96 + 7072ff2 commit 62913df

File tree

10 files changed

+101
-11
lines changed

10 files changed

+101
-11
lines changed

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
<a name="2.28.0"></a>
2+
# [2.28.0](https://github.com/ovh-ux/ovh-ui-angular/compare/v2.27.0...v2.28.0) (2019-04-08)
3+
4+
5+
### Bug Fixes
6+
7+
* **oui-navbar:** replace ng-bind with ng-bind-html for menu links ([#383](https://github.com/ovh-ux/ovh-ui-angular/issues/383)) ([2f3f129](https://github.com/ovh-ux/ovh-ui-angular/commit/2f3f129))
8+
9+
10+
### Features
11+
12+
* **oui-navbar:** display full menu title on hover ([92a1f5d](https://github.com/ovh-ux/ovh-ui-angular/commit/92a1f5d))
13+
* **oui-stepper:** add editable attribute ([#381](https://github.com/ovh-ux/ovh-ui-angular/issues/381)) ([87ac063](https://github.com/ovh-ux/ovh-ui-angular/commit/87ac063))
14+
15+
16+
17+
<a name="2.27.0"></a>
18+
# [2.27.0](https://github.com/ovh-ux/ovh-ui-angular/compare/v2.26.1...v2.27.0) (2019-04-04)
19+
20+
21+
### Bug Fixes
22+
23+
* **oui-select-picker:** update when model changes ([#378](https://github.com/ovh-ux/ovh-ui-angular/issues/378)) ([a59bf96](https://github.com/ovh-ux/ovh-ui-angular/commit/a59bf96))
24+
* **oui-stepper:** call onSubmit when the form is not valid ([#379](https://github.com/ovh-ux/ovh-ui-angular/issues/379)) ([008583c](https://github.com/ovh-ux/ovh-ui-angular/commit/008583c))
25+
26+
27+
28+
<a name="2.26.1"></a>
29+
## [2.26.1](https://github.com/ovh-ux/ovh-ui-angular/compare/v2.26.0...v2.26.1) (2019-03-28)
30+
31+
32+
### Bug Fixes
33+
34+
* **oui-tabs:** add button type ([#376](https://github.com/ovh-ux/ovh-ui-angular/issues/376)) ([b8736c1](https://github.com/ovh-ux/ovh-ui-angular/commit/b8736c1))
35+
36+
37+
138
<a name="2.26.0"></a>
239
# [2.26.0](https://github.com/ovh-ux/ovh-ui-angular/compare/v2.25.1...v2.26.0) (2019-03-26)
340

dist/oui-angular.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/oui-angular.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A set of maintainable components for the OVH ecosystem (Angular).",
44
"license": "BSD-3-Clause",
55
"author": "OVH SAS",
6-
"version": "2.26.0",
6+
"version": "2.28.0",
77
"keywords": [
88
"angular"
99
],

packages/oui-navbar/src/menu/navbar-menu.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ng-if="::!!$ctrl.headerBreadcrumb"
1414
ng-bind="::$ctrl.headerBreadcrumb">
1515
</span>
16-
<h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
16+
<h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle" title="{{::$ctrl.headerTitle}}"></h3>
1717
</header>
1818
<ul class="oui-navbar-list">
1919
<li class="oui-navbar-list__item {{::!!menuLink.class ? menuLink.class : null}}"
@@ -35,7 +35,7 @@ <h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
3535
ng-href="{{::menuLink.url}}"
3636
oui-navbar-group="{{::$ctrl.menuName}}"
3737
oui-navbar-group-last="::$last">
38-
<span ng-bind="::menuLink.title"></span>
38+
<span ng-bind-html="::menuLink.title"></span>
3939
<span class="oui-icon oui-icon-external_link" aria-hidden="true"
4040
ng-if="::!!menuLink.isExternal">
4141
</span>
@@ -51,7 +51,7 @@ <h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
5151
'oui-navbar_desktop-only': !!menuLink.subLinks
5252
}"
5353
ng-click="$ctrl.closeMenuWithCallback($event, menuLink.click)"
54-
ng-bind="::menuLink.title"
54+
ng-bind-html="::menuLink.title"
5555
ui-sref="{{::$ctrl.constructor.getFullSref(menuLink)}}"
5656
oui-navbar-group="{{::$ctrl.menuName}}"
5757
oui-navbar-group-last="::$last">
@@ -64,7 +64,7 @@ <h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
6464
ng-attr-aria-label="{{::!!menuLink.label ? menuLink.label : null}}"
6565
ng-attr-title="{{::!!menuLink.label ? menuLink.label : null}}"
6666
ng-click="$ctrl.closeMenuWithCallback($event, menuLink.click)"
67-
ng-bind="::menuLink.title"
67+
ng-bind-html="::menuLink.title"
6868
oui-navbar-group="{{::$ctrl.menuName}}"
6969
oui-navbar-group-last="::$last">
7070
</button>
@@ -80,7 +80,7 @@ <h3 class="oui-navbar-menu__title" ng-bind="::$ctrl.headerTitle"></h3>
8080
'oui-navbar_mobile-only': !!menuLink.url || !!menuLink.state
8181
}"
8282
ng-click="$ctrl.navbarCtrl.toggleMenu(menuLink.name, true)"
83-
ng-bind="::menuLink.title"
83+
ng-bind-html="::menuLink.title"
8484
oui-navbar-group="{{::$ctrl.menuName}}"
8585
oui-navbar-group-last="::$last">
8686
</button>

packages/oui-stepper/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
| `loading-text` | string | @? | no | n/a | n/a | text for the loading state
172172
| `loading` | boolean | <? | no | `true`, `false` | `false` | display the loading state
173173
| `disabled` | boolean | <? | no | `true`, `false` | `false` | disable the step and shrink it
174+
| `editable` | boolean | <? | no | `true`, `false` | `true` | Define if user can go back on a step and edit it again
174175
| `navigation` | boolean | <? | no | `true`, `false` | `true` | show the navigation buttons
175176
| `skippable` | boolean | <? | no | `true`, `false` | `false` | add button to skip facultative step
176177
| `valid` | boolean | <? | no | `true`, `false` | `true` | custom validation for the form

packages/oui-stepper/src/index.spec.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,52 @@ describe("ouiStepper", () => {
6262
expect(form.hasClass(completeClass)).toBe(false);
6363
});
6464

65+
it("should display a editable step", () => {
66+
let stepForm;
67+
const element = TestUtils.compileTemplate(`
68+
<oui-stepper>
69+
<oui-step-form name='form' on-submit="$ctrl.onSubmitTest(form)"></oui-step-form>
70+
</oui-stepper>`, {
71+
onSubmitTest: (form) => {
72+
stepForm = form;
73+
}
74+
});
75+
const form = element.find("form").eq(0);
76+
$timeout.flush();
77+
78+
form.triggerHandler("submit");
79+
80+
// $submitted is settled to false, fake it by access form directly and set it to true
81+
stepForm.$submitted = true;
82+
element.scope().$digest();
83+
84+
const editLink = angular.element(element[0].querySelector("button.oui-button.oui-button_link"));
85+
expect(editLink.length).toBe(1);
86+
});
87+
88+
it("should display a not-editable step", () => {
89+
let stepForm;
90+
const element = TestUtils.compileTemplate(`
91+
<oui-stepper>
92+
<oui-step-form name='form' on-submit="$ctrl.onSubmitTest(form)" editable="false"></oui-step-form>
93+
</oui-stepper>`, {
94+
onSubmitTest: (form) => {
95+
stepForm = form;
96+
}
97+
});
98+
const form = element.find("form").eq(0);
99+
$timeout.flush();
100+
101+
form.triggerHandler("submit");
102+
103+
// $submitted is settled to false, fake it by access form directly and set it to true
104+
stepForm.$submitted = true;
105+
element.scope().$digest();
106+
107+
const editLink = angular.element(element[0].querySelector("button.oui-button.oui-button_link"));
108+
expect(editLink.length).toBe(0);
109+
});
110+
65111
it("should display a loader", () => {
66112
const element = TestUtils.compileTemplate("<oui-stepper><oui-step-form loading></oui-step-form></oui-stepper>");
67113
$timeout.flush();

packages/oui-stepper/src/step-form/step-form.component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default {
1717
submitText: "@?",
1818

1919
disabled: "<?",
20+
editable: "<?",
2021
loading: "<?",
2122
navigation: "<?",
2223
skippable: "<?",

packages/oui-stepper/src/step-form/step-form.controller.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default class StepFormController {
1313

1414
$onInit () {
1515
addBooleanParameter(this, "disabled");
16+
addBooleanParameter(this, "editable");
1617
addBooleanParameter(this, "skippable");
1718

1819
// Add default name
@@ -23,6 +24,11 @@ export default class StepFormController {
2324
addDefaultParameter(this, "cancelText", this.translations.cancelButtonLabel);
2425
}
2526

27+
// By default, we can edit a step
28+
if (angular.isUndefined(this.$attrs.editable)) {
29+
this.editable = true;
30+
}
31+
2632
// Show validation if no attribute 'navigation'
2733
if (angular.isUndefined(this.$attrs.navigation)) {
2834
this.navigation = true;
@@ -58,9 +64,8 @@ export default class StepFormController {
5864
}
5965

6066
onFormSubmit (form) {
67+
this.onSubmit({ form });
6168
if (form.$valid && this.valid) {
62-
this.onSubmit({ form });
63-
6469
// Focus next step
6570
this.stepperCtrl.addForm(form, this.stepper.index);
6671
}

packages/oui-stepper/src/step-form/step-form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ng-bind="::$ctrl.translations.optionalLabel">
1616
</span>
1717
<button class="oui-button oui-button_link" type="button"
18-
ng-if="!$ctrl.stepper.focused && !$ctrl.stepper.disabled && this[$ctrl.name].$submitted"
18+
ng-if="!$ctrl.stepper.focused && !$ctrl.stepper.disabled && $ctrl.editable && this[$ctrl.name].$submitted"
1919
ng-click="$ctrl.setFocus(this[$ctrl.name])"
2020
ng-bind="::$ctrl.translations.modifyThisStep"></button>
2121
</header>

0 commit comments

Comments
 (0)