openmct/platform/commonUI/edit
Deep Tailor 402062110d TCR fixes 2 (#2286)
* prevent default on dragover in dropHint, to allow drop event to fire

* add notebook snapshot to preview

* fix for preview image overlay

* pin fast-sass-loader version to 1.4.6

* fix saveAs in plot image export

* fix elements search in inspector

* fix current Search error

* fix anonymous render error in layout

* navigate and edit on create

* remove domainObjects from composition when deleting frames and containers, and also fix a bug whereby a user can add domainObject via drag and drop(composition) but because of the lack of containers, it will not be added to the flexible layout

* fix index undefined error when reordering containers

* throw an error when user cancels instead of returning false

* fixes for toolbar not updating on selection change

* fix errors when objects without context are returned by the search aggregator

* prompt user before cancelling edit

* check transactions before prompting user

* add save and continue editing option to save menu

* prompt user if in edit mode and is navigating away
2019-03-11 11:47:53 -07:00
..
res/templates Elements pool and drag drop (#2196) 2018-10-23 10:52:37 -07:00
src TCR fixes 2 (#2286) 2019-03-11 11:47:53 -07:00
test Removed unused legacy code 2018-12-13 17:11:39 -08:00
bundle.js Removed unused legacy code 2018-12-13 17:11:39 -08:00
README.md [Navigation] remove mct-before-unload 2016-12-20 16:43:23 -08:00

Contains sources and resources associated with Edit mode.

Extensions

Toolbars

Views may specify the contents of a toolbar through a toolbar property in their bundle definition. This should appear as the structure one would provide to the mct-toolbar directive, except additional properties are recognized to support the mediation between toolbar contents, user interaction, and the current selection (as read from the selection property of the view's scope.) These additional properties are:

  • property: Name of the property within a selected object. If, for any given object in the selection, that field is a function, then that function is assumed to be an accessor-mutator function (that is, it will be called with no arguments to get, and with an argument to set.)
  • method: Name of a method to invoke upon a selected object when a control is activated, e.g. on a button click.
  • exclusive: Optional; true if this control should be considered applicable only when all elements in the selection has the associated property. Otherwise, only at least one member of the current selection must have this property for the control to be shown.

Controls in the toolbar are shown based on applicability to the current selection. Applicability for a given member of the selection is determined by the presence of absence of the named property field. As a consequence of this, if undefined is a valid value for that property, an accessor-mutator function must be used. Likewise, if toolbar properties are meant to be view-global (as opposed to per-selection) then the view must include some object to act as its proxy in the current selection (in addition to whatever objects the user will conceive of as part of the current selection), typically with inclusive set to true.

Selection

The selection property of a view's scope in Edit mode will be initialized to an empty array. This array's contents may be modified to implicitly change the contents of the toolbar based on the rules described above. Care should be taken to modify this array in-place instead of shadowing it (as the selection will typically be a few scopes up the hierarchy from the view's actual scope.)