Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new field category in User prefrences related to Macros config [SDNTB-876] #4664

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading