Skip to content

Commit fd65698

Browse files
committed
fix spacing, update to use nested dropdown
1 parent 70e870b commit fd65698

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

services/manage/app/controllers/manage/orgs/view/apps/view/users/edit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@ import Controller from '@ember/controller';
22
import ActionMixin from '@identity-x/manage/mixins/action-mixin';
33
import AppQueryMixin from '@identity-x/manage/mixins/app-query';
44
import { inject } from '@ember/service';
5+
import { computed } from '@ember/object';
56

67
export default Controller.extend(ActionMixin, AppQueryMixin, {
78
router: inject(),
89

10+
isCustomActive: computed('router.currentRouteName', function() {
11+
return this.router.currentRouteName.includes('users.edit.custom-');
12+
}),
13+
customDropdownClasses: computed('isCustomActive', function() {
14+
const classes = ['nav-link', 'dropdown-toggle'];
15+
if (this.isCustomActive) classes.push('active');
16+
return classes.join(' ');
17+
}),
18+
919
actions: {
1020
returnToList() {
1121
return this.router.transitionTo('manage.orgs.view.apps.view.users');

services/manage/app/templates/manage/orgs/view/apps/view/users/edit.hbs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@
1111
Address
1212
{{/link-to}}
1313
</li>
14-
<li class="nav-item">
15-
{{#link-to "manage.orgs.view.apps.view.users.edit.custom-select-fields" class="nav-link"}}
16-
Custom Selects
17-
{{/link-to}}
18-
</li>
19-
<li class="nav-item">
20-
{{#link-to "manage.orgs.view.apps.view.users.edit.custom-boolean-fields" class="nav-link"}}
21-
Custom Checkboxes
22-
{{/link-to}}
23-
</li>
24-
<li class="nav-item">
25-
{{#link-to "manage.orgs.view.apps.view.users.edit.custom-text-fields" class="nav-link"}}
26-
Custom Inputs
27-
{{/link-to}}
14+
<li class="nav-item dropdown">
15+
<a class={{customDropdownClasses}} data-toggle="dropdown" href="#" role="button" aria-expanded="false">Custom Fields</a>
16+
<div class="dropdown-menu">
17+
{{#link-to "manage.orgs.view.apps.view.users.edit.custom-boolean-fields" class="dropdown-item"}}
18+
Checkboxes
19+
{{/link-to}}
20+
{{#link-to "manage.orgs.view.apps.view.users.edit.custom-text-fields" class="dropdown-item"}}
21+
Text fields
22+
{{/link-to}}
23+
{{#link-to "manage.orgs.view.apps.view.users.edit.custom-select-fields" class="dropdown-item"}}
24+
Selects
25+
{{/link-to}}
26+
</div>
2827
</li>
2928
<li class="nav-item">
3029
{{#link-to "manage.orgs.view.apps.view.users.edit.external-ids" class="nav-link"}}

services/manage/app/templates/manage/orgs/view/apps/view/users/edit/custom-text-fields.hbs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<form {{action "save" on="submit"}}>
22
<fieldset disabled={{this.isActionRunning}}>
33
<BsModal::Body>
4-
<div class="row">
5-
{{#each this.model.customTextFieldAnswers as |answer|}}
6-
<div class="col-sm-6">
7-
<div class="form-group">
8-
<FormElements::Label>
9-
<CustomField::Label @value={{answer.field.label}} />
10-
<br>
11-
<span class="small text-muted">({{answer.field.name}})</span>
12-
{{#if (not answer.field.active)}}<span class="small text-warning">[inactive]</span>{{/if}}
13-
</FormElements::Label>
14-
<Input
15-
@type="text"
16-
@value={{answer.value}}
17-
/>
18-
</div>
4+
{{#each this.model.customTextFieldAnswers as |answer|}}
5+
<div class="col-sm-6">
6+
<div class="form-group">
7+
<FormElements::Label>
8+
<CustomField::Label @value={{answer.field.label}} />
9+
<br>
10+
<span class="small text-muted">({{answer.field.name}})</span>
11+
{{#if (not answer.field.active)}}<span class="small text-warning">[inactive]</span>{{/if}}
12+
</FormElements::Label>
13+
<Input
14+
@type="text"
15+
@value={{answer.value}}
16+
/>
1917
</div>
20-
{{else}}
18+
</div>
19+
{{else}}
20+
<div class="col">
2121
<div class="row">
22-
<p class="text-muted">No custom fields have been created.</p>
22+
<p class="text-muted">No custom inputs have been created.</p>
2323
</div>
24-
{{/each}}
25-
</div>
24+
</div>
25+
{{/each}}
2626
</BsModal::Body>
2727
<BsModal::Footer>
2828
<FormElements::SubmitButton @class="btn btn-success" @isSaving={{this.isActionRunning}} />

0 commit comments

Comments
 (0)