scripts/apps/desks/views/desk-config-modal.html
<div sd-modal data-model="modalActive" class="modal--tabs modal--large sd-wizard" data-test-id="'desk-config-modal'">
<div class="modal__header modal__header--flex">
<h3 class="modal__heading" ng-show="!desk.edit._id" translate>Add New Desk</h3>
<h3 class="modal__heading" ng-show="desk.edit._id" translate translate-params-name="desk.edit.name">Edit "{{name}}" Desk</h3>
<a href="" class="icn-btn close-modal" ng-click="cancel()"><i class="icon-close-small"></i></a>
</div>
<div class="modal__body" sd-wizard data-name="desks" data-current-step="step.current" data-finish="cancel()" data-can-tab-change="canTabChange()">
<div sd-wizard-step data-title="{{ 'General' | translate }}" data-code="general">
<form sd-deskedit-basic name="generalStep" class="content desk-content">
<fieldset>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--required">
<label class="sd-line-input__label" translate>Desk name</label>
<input
class="sd-line-input__input"
type="text"
ng-model="desk.edit.name"
ng-keyup="handleEdit($event);"
required
data-test-id="field--name"
>
<sd-character-count class="sd-line-input__char-count" data-item="desk.edit.name" data-limit="limits.desk"></sd-character-count>
</div>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input">
<label class="sd-line-input__label" translate>Desk description</label>
<textarea
class="sd-line-input__input"
ng-model="desk.edit.description"
data-test-id="field--description"
></textarea>
</div>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--required">
<label class="sd-line-input__label" translate>Source for User Created Articles</label>
<input
class="sd-line-input__input"
type="text"
ng-model="desk.edit.source"
ng-keyup="handleEdit($event);"
required
data-test-id="field--source"
/>
</div>
</div>
</div>
<div class="form__row form__row--flex" ng-hide="!$root.config.features.slackNotifications">
<div class="form__row-item">
<div class="sd-line-input">
<label class="sd-line-input__label" translate>Slack Channel Name</label>
<input class="sd-line-input__input" type="text" ng-model="desk.edit.slack_channel_name" ng-keyup="handleEdit($event);">
<span class="sd-line-input__hint" translate>The name of a Slack channel associated with this desk, the # is not required</span>
</div>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input">
<label class="sd-line-input__label" translate>Desk Email</label>
<input class="sd-line-input__input" type="email" ng-model="desk.edit.email" ng-keyup="handleEdit($event);">
<span class="sd-line-input__hint" translate>Desk email address.</span>
</div>
</div>
</div>
<div sd-content-expiry
data-item="desk.edit"
data-preview="false"
data-expiryfield="content_expiry"
data-header="Content Expiry"
data-expiry-minutes="systemExpiry"
data-expiry-context="System">
</div>
<div class="form__row form__row--flex" ng-if="isPublishedContentExpired()">
<div class="form__row-item">
<span title="{{:: 'If selected, content published from this desk will be not be expired' | translate}}">
<span sd-switch ng-model="desk.edit.preserve_published_content"></span>
<label translate>Preserve Published Content</label>
</span>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--is-select sd-line-input--required">
<label class="sd-line-input__label" translate>Desk Type</label>
<select
class="sd-line-input__select"
id="deskType"
ng-model="desk.edit.desk_type"
required
data-test-id="field--desk-type"
>
<option value=""></option>
<option id="{{type.qcode}}" ng-repeat="type in deskTypes" value="{{type.qcode}}" ng-selected="desk.edit.desk_type === type.qcode"
>{{ type.name | translate}}</option>
</select>
<div ng-show="showNoPublishOnAuthoringDesk(desk.edit.desk_type)" class="column">
<i class="icon-info-sign icon--blue"></i><span class="helper-text helper-text--after-icon" translate>Authoring desks are for content creation, and items within it are protected from accidental publication. Publishing is only permitted from production desks.</span>
</div>
</div>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--is-select">
<label class="sd-line-input__label" translate>Desk language</label>
<select
class="sd-line-input__select"
id="deskLanguage"
ng-model="desk.edit.desk_language"
data-test-id="field--desk-language"
>
<option value=""></option>
<option ng-repeat="language in languages" value="{{language.language}}" ng-selected="desk.edit.desk_language === language.language">
{{ language.label | translate}}
</option>
</select>
</div>
</div>
</div>
<div class="form__row">
<div class="form__row-item">
<label class="form-label form-label--marg-b10" translate>Default monitoring view</label>
<div class="sd-alert sd-alert--hollow sd-alert--small sd-alert--marg-b12">
<i class="icon-info-sign icon--blue icon--2x sd-alert__icon"></i>
<span>{{ :: 'You can choose the default content view of your desk. Use only if you want to override individual users\' monitoring view preferences. Select "none" if you want to let users decide.' | translate }}</span>
</div>
<div>
<sd-check
ng-repeat="(viewId, view) in monitoringViews"
type="radio"
label-position="inside"
ng-model="desk.edit.monitoring_default_view"
ng-click="desk.edit.monitoring_default_view = viewId"
ng-value="{{viewId}}"
data-icon="{{view.icon}}"
>
{{ view.label }}
</sd-check>
</div>
</div>
</div>
<div class="form__row">
<div class="sd-line-input sd-line-input--required">
<label class="sd-line-input__label" translate>Default Content Template</label>
<div class="sd-alert sd-alert--hollow sd-alert--small">
<i class="icon-info-sign icon--blue icon--2x sd-alert__icon"></i>
<span translate>
Select a default template for new articles. If you don't see any, first make sure that there is at least one content profile. Each time a profile is created, Superdesk creates a template with the same name.
</span>
</div>
<div class="sd-line-input sd-line-input--is-select">
<select
ng-options="template._id as template.template_name for template in templates"
ng-model="desk.edit.default_content_template"
class="sd-line-input__select"
required
data-test-id="field--default-content-template"
>
<option value=""></option>
</select>
</div>
</div>
</div>
<div class="form__row" ng-show="profiles.length">
<div class="sd-line-input sd-line-input--required">
<label class="sd-line-input__label" translate>Default Content Profile</label>
<div class="sd-alert sd-alert--hollow sd-alert--small">
<i class="icon-info-sign icon--blue icon--2x sd-alert__icon"></i>
<span translate>
Select a default content profile which is used for articles fetched from ingest. If you don't see any, create one
<a href="#/settings/content-profiles">here</a>
</span>
</div>
<div class="sd-line-input sd-line-input--is-select">
<select ng-model="desk.edit.default_content_profile"
ng-options="profile._id as profile.label for profile in profiles | orderBy: 'label'"
class="sd-line-input__select"
required
data-test-id="field--default-content-profile">
<option value=""></option>
</select>
</div>
</div>
</div>
<div class= "form__row" >
<span sd-switch ng-model="desk.edit.send_to_desk_not_allowed"></span>
<label class="inline-label" >{{'Disallow sending items to this desk' | translate }}</label>
</div>
<fieldset class="form__row">
<legend translate>Preferred values for vocabularies</legend>
<div sd-prefered-cv-items-config ng-model="desk.edit.preferred_cv_items" />
</fieldset>
</fieldset>
<span ng-show="message">{{ message}}</span>
<span class="alert-danger" ng-show="_errorLimits" translate>Character limit exceeded, desk can not be created/updated.</span>
</form>
<div class="modal__footer" ng-if="step.current === 'general'">
<button
class="btn btn--primary"
ng-click="save(desk.edit)"
ng-disabled="!generalStep.$valid || _errorLimits || saving || !saveEnabled"
data-test-id="save-and-continue"
>
{{ 'Save & Continue' | translate }}
</button>
<button
id="done-general"
class="btn btn--primary"
ng-click="save(desk.edit, true)"
ng-disabled="!generalStep.$valid || _errorLimits || saving || !saveEnabled"
translate
data-test-id="done"
>
Done
</button>
</div>
</div>
<div sd-wizard-step data-title="{{ :: 'Stages' | translate }}" data-code="stages">
<div sd-deskedit-stages class="content stages form-flat">
<div class="grid grid--padding-fix">
<div class="grid__item grid__item--col-5">
<div class="heading" translate>Work stages</div>
<div class="column">
<ul class="pills-list stages-list" ng-class="{'edit-mode': editStage, 'pills-list--draggable': !editStage}">
<li class="stage editable addnew" ng-show="editStage && !editStage._id">
<div class="sd-line-input">
<input class="sd-line-input__input" type="text" id="insert-stage" ng-model="editStage.name" required ng-keyup="handleEdit($event);" autofocus placeholder="{{ 'New stage' | translate }}">
<sd-character-count class="sd-line-input__char-count" data-item="editStage.name" data-limit="limits.stage"></sd-character-count>
</div>
</li>
<li
ng-repeat="stage in stages track by $index"
ng-click="select(stage)"
ng-class="{active: selected === stage, editable: isActive(stage)}"
>
<div ng-if="!isActive(stage)">
<span data-test-id="stage-name">{{ labelForStage(stage) }}</span>
<label class="global-label" ng-if="!stage.is_visible">
<span translate>Global Read</span><span translate>: OFF</span>
</label>
<label class="global-label" ng-if="stage.local_readonly">
<span translate>Local Readonly</span><span translate>: ON</span>
</label>
</div>
<div ng-if="isActive(stage)">
<div class="sd-line-input">
<input class="sd-line-input__input" type="text" id="edit-stage" ng-model="editStage.name" ng-keyup="handleEdit($event);" required>
<sd-character-count class="sd-line-input__char-count" data-item="editStage.name" data-limit="limits.stage"></sd-character-count>
</div>
</div>
<div class="actions" ng-if="!editStage">
<button ng-click="edit(stage)">
<i class="icon-pencil" ></i>
</button>
<button ng-if="!stage.working_stage && !stage.default_incoming" ng-click="remove(stage)">
<i class="icon-trash"></i>
</button>
</div>
</li>
</ul>
<div class="button-toolbar" ng-if="editStage && editStage._id">
<button class="btn"
ng-click="cancel()"
ng-disabled="saving" translate>Cancel</button>
<button id="save-edited-stage"
class="btn btn--primary"
ng-click="save()"
ng-disabled="!enableSave() || saving" translate>Save</button>
</div>
<div class="button-toolbar" ng-if="editStage && !editStage._id">
<button class="btn"
ng-click="cancel()" translate>Cancel</button>
<button id="save-new-stage"
class="btn btn--primary"
ng-click="save()"
ng-disabled="!enableSave()" translate>Save</button>
</div>
<div ng-show="message" class="sd-alert sd-alert--hollow sd-alert--alert">{{ message}}</div>
<div ng-show="_errorUniqueness" class="sd-alert sd-alert--hollow sd-alert--alert"><span translate>Stage with name</span> "{{ editStage.name}}"" <span translate>already exists</span>.</div>
<div ng-show="_errorLimits" class="sd-alert sd-alert--hollow sd-alert--alert"translate>Character limit exceeded, stage can not be created/updated.</div>
<div ng-show="_error" class="sd-alert sd-alert--hollow sd-alert--alert" translate>There was a problem, stage not created/updated.</div>
<button ng-if="!editStage && !editStage._id" style="margin-top: 1.6rem;" id="new-stage" class="btn btn--large btn--expanded" data-target="#insert-stage" ng-click="edit({}); selected = null" ng-disabled="editStage" sd-tooltip="{{'Create new Stage' | translate}}">
<i class="icon-plus-large"></i>
</button>
</div>
</div>
<div class="grid__item grid__item--col-7">
<div class="heading" translate>Stage Details</div>
<div ng-if="!selected && !editStage" class="column">
<i class="icon-info-sign icon--blue"></i><span class="helper-text helper-text--after-icon">Click on a Work stage on the left to view details.</span>
</div>
<div ng-if="selected && !editStage" class="column">
<div class="list-row list-row--dotted" ng-if="selected.working_stage || selected.default_incoming">
<span ng-if="selected.working_stage">{{:: 'Working Stage' | translate}}</span>
<span ng-if="selected.working_stage && selected.default_incoming">, </span>
<span ng-if="selected.default_incoming">{{:: 'Incoming Stage' | translate}}</span>
</div>
<div class="list-row list-row--dotted list-row--flex" ng-if="selected.is_visible">
<span class="text-label list-row__item list-row__item--grow" translate>Global Read: </span>
<span ng-if="selected.is_visible" class="list-row__item" translate>ON</span>
<span ng-if="!selected.is_visible" class="list-row__item" translate>OFF</span>
</div>
<div class="list-row list-row--dotted list-row--flex" ng-if="selected.local_readonly">
<span class="text-label list-row__item list-row__item--grow" translate>Local Read Only: </span>
<span ng-if="selected.local_readonly" class="list-row__item" translate>ON</span>
<span ng-if="!selected.local_readonly" class="list-row__item" translate>OFF</span>
</div>
<div class="list-row list-row--dotted" ng-if="selected.description">
<span class="text-label list-row__item list-row__item--block" translate>Stage description: </span>
<span class="list-row__item list-row__item--block">{{ selected.description}}</span>
</div>
<div class="list-row list-row--dotted list-row--flex">
<span class="text-label list-row__item list-row__item--grow" translate>Content expiry: </span>
<span class="list-row__item" sd-content-expiry
data-item="selected"
data-preview="true"
data-expiryfield="content_expiry"
data-expiry-minutes="desk.edit.content_expiry > 0 ? desk.edit.content_expiry : systemExpiry"
data-expiry-context="{{desk.edit.content_expiry > 0 ? 'Desk' : 'System'}}"
></span>
</div>
<div class="list-row list-row--dotted list-row--flex" ng-if="selected.incoming_macro">
<span class="text-label list-row__item list-row__item--grow" translate>Incoming Rule: </span>
<span class="list-row__item">{{ selected.incoming_macro}}</span>
</div>
<div class="list-row list-row--dotted list-row--flex" ng-if="selected.onstage_macro">
<span class="text-label list-row__item list-row__item--grow" translate>Moved onto stage Rule: </span>
<span class="list-row__item">{{ selected.onstage_macro}}</span>
</div>
<div class="list-row list-row--dotted list-row--flex" ng-if="selected.outgoing_macro">
<span class="text-label list-row__item list-row__item--grow" translate>Outgoing Rule: </span>
<span class="list-row__item">{{ selected.outgoing_macro}}</span>
</div>
</div>
<div class="column column--mb24" ng-if="editStage">
<div class="list-row list-row--small" title="{{ editStage.default_incoming ? 'Global Read OFF is not allowed for Incoming stage' : null | translate }}">
<span class="" ng-class="{'prevent-off' : editStage.default_incoming && editStage.is_visible}" sd-switch ng-model="editStage.is_visible"></span>
<label>{{ :: 'Global Read' | translate }}</label>
</div>
<div class="list-row list-row--small">
<span class="" sd-switch ng-model="editStage.local_readonly"></span>
<label>{{ :: 'Local Read Only' | translate }}</label>
</div>
<div class="list-row list-row--small">
<span class="" sd-switch ng-model="editStage.working_stage"></span>
<label>{{:: 'Working Stage' | translate }}</label>
</div>
<div class="list-row list-row--small">
<span class="" ng-click="shouldVisible()" sd-switch ng-model="editStage.default_incoming"></span>
<label>{{:: 'Incoming Stage' | translate }}</label>
</div>
</div>
<div class="form__row form__row--flex" ng-if="editStage">
<div class="form__row-item">
<div class="sd-line-input">
<label class="sd-line-input__label">{{ :: 'Stage description' | translate }}</label>
<textarea class="sd-line-input__input" ng-model="editStage.description"></textarea>
</div>
</div>
</div>
<div sd-content-expiry data-item="editStage" ng-if="editStage"
data-preview="false"
data-expiryfield="content_expiry"
data-header="Content Expiry"
data-expiry-minutes="desk.edit.content_expiry > 0 ? desk.edit.content_expiry : systemExpiry"
data-expiry-context="{{ desk.edit.content_expiry > 0 ? 'Desk' : 'System' }}">
</div>
<div ng-if="editStage">
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--is-select">
<label class="sd-line-input__label">{{ :: 'Incoming Rule' | translate }}</label>
<select ng-model="editStage.incoming_macro" class="sd-line-input__select">
<option value=""></option>
<option ng-repeat="macro in macros" ng-selected="editStage.incoming_macro === macro.name" value="{{macro.name}}">{{macro.label}}</option>
</select>
</div>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--is-select">
<label class="sd-line-input__label">{{ :: 'Moved onto stage Rule' | translate }}</label>
<select ng-model="editStage.onstage_macro" class="sd-line-input__select">
<option value=""></option>
<option ng-repeat="macro in macros" ng-selected="editStage.onstage_macro === macro.name" value="{{macro.name}}">{{macro.label}}</option>
</select>
</div>
</div>
</div>
<div class="form__row form__row--flex">
<div class="form__row-item">
<div class="sd-line-input sd-line-input--is-select">
<label class="sd-line-input__label">{{ :: 'Outgoing Rule' | translate }}</label>
<select ng-model="editStage.outgoing_macro" class="sd-line-input__select">
<option value=""></option>
<option ng-repeat="macro in macros" ng-selected="editStage.outgoing_macro === macro.name" value="{{macro.name}}">{{macro.label}}</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal__footer" ng-if="step.current === 'stages'">
<button id="next-stages" class="btn btn--primary" ng-disabled="message != null || (editStage && editStage._id) || (editStage && !editStage._id)" ng-click="next()" translate>Continue</button>
<button id="done-stages" class="btn btn--primary" ng-disabled="message != null || (editStage && editStage._id) || (editStage && !editStage._id)" ng-click="next(true)" translate>Done</button>
</div>
</div>
<div sd-wizard-step data-title="{{ 'People' | translate }}" data-code="people">
<div sd-deskedit-people class="content people-stage" >
<div class="header" sd-user-select-list data-exclude="deskMembers" data-onchoose="add(user)"></div>
<div>
<p ng-show="message">{{ message}}</p>
<div class="members-list">
<ul class="pills-list">
<li ng-repeat="user in deskMembers| orderBy: 'display_name' track by user._id" ng-class="{'inactive' : !user.is_enabled || !user.is_active}">
<span class="flex-row sibling-spacer-10">
<sd-user-avatar data-user="user"></sd-user-avatar>
<h5>{{:: user.display_name}}</h5> <span class="user-email">{{:: user.email}}</span>
</span>
<div class="actions">
<button ng-click="remove(user)"><i class="icon-close-small"></i></button>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="modal__footer" ng-if="step.current === 'people'">
<button id="next-people"
class="btn btn--primary"
ng-click="save()"
ng-disabled="message != null || saving || !saveEnabled"
data-test-id="save-and-continue">{{ 'Save & Continue' | translate }}</button>
<button
id="done-people"
class="btn btn--primary"
ng-click="save(true)"
ng-disabled="message != null || saving || !saveEnabled"
translate
data-test-id="done"
>
Done
</button>
</div>
</div>
<div sd-wizard-step data-title="{{ 'Macros' | translate }}" data-code="macros">
<div class="content macros" sd-deskedit-macros>
<ul class="pills-list">
<li ng-repeat="macro in macros" class="clearfix">
<h6 class="pull-left">{{:: macro.name}}</h6>
<div class="label-group label-group--right">
<span class="label label--hollow">{{:: macro.access_type}}</span><span class="label label--hollow">{{:: macro.action_type}}</span>
</div>
</li>
</ul>
</div>
<div class="modal__footer" ng-if="step.current === 'macros'">
<button id="save" class="btn btn--primary" ng-click="save()" translate>Done</button>
</div>
</div>
</div>
</div>