Skip to content

Commit

Permalink
Add new category in User prefrences related to Macros config [SDNTB-8…
Browse files Browse the repository at this point in the history
…76] (#4664)
  • Loading branch information
devketanpro authored Oct 22, 2024
1 parent ff3da34 commit 676be23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/apps/users/directives/UserPreferencesDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export function UserPreferencesDirective(
});
}

p[key] = _.extend(val, scope.preferences[key]);
p[key] = _.merge(val, scope.preferences[key]);
});
return p;
}
Expand Down
12 changes: 12 additions & 0 deletions scripts/apps/users/views/user-preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<button class="sd-left-nav__btn" ng-class="{'sd-left-nav__btn--active': checkNavigation('planning-prefs')}" ng-click="goTo('planning-prefs')" ng-if="showPlanning()" translate>Planning</button>
<button class="sd-left-nav__btn" ng-class="{'sd-left-nav__btn--active': checkNavigation('vocabulary-values')}" ng-click="goTo('vocabulary-values')" ng-if="profileConfig.desks !== false" translate>Vocabulary values</button>
<button class="sd-left-nav__btn" ng-class="{'sd-left-nav__btn--active': checkNavigation('appearance')}" ng-click="goTo('appearance')" translate>Appearance</button>
<button class="sd-left-nav__btn" ng-class="{'sd-left-nav__btn--active': checkNavigation('macros-config')}" ng-click="goTo('macros-config')" ng-show = "preferences['macro_config']" translate>{{preferences['macro_config'].label}}</button>
</nav>
</div>
<div class="preferences__content">
Expand Down Expand Up @@ -422,6 +423,17 @@ <h4 class="sd-heading sd-text-align--left sd-text--sans sd-heading--h4 sd-margin
</div>
</li>

<li ng-show = "preferences['macro_config']" class="simple-list__item simple-list__item--stacked simple-list__item--justify-flex-start">
<h3 id="macros-config" class="sd-heading sd-text-align--left sd-text--sans sd-heading--h3" translate>{{preferences['macro_config'].label}}</h3>
<div class="sd-container sd-container--flex sd-container--gap-none sd-container--direction-column sd-radius--medium sd-panel-bg--000 sd-shadow--z2 sd-padding--3 sd-state--focus sd-margin-b--1">
<div sd-info-item>
<div ng-repeat="(key, field) in preferences.macro_config.fields">
<label class="form-label" translate>{{ key }}</label>
<input type="text" ng-model="preferences['macro_config'].fields[key]" />
</div>
</div>
</li>

<li class="simple-list__item simple-list__item--stacked simple-list__item--justify-flex-start">

</li>
Expand Down

0 comments on commit 676be23

Please sign in to comment.