openmct/platform/features/layout/bundle.js
Andrew Henry 08bed6c23a
Fluid layouts 2 electric boogaloo (#2047)
* [Frontend] Viewport metatag updated

Fixes #2008
- Added shrink-to-fit=no;

* [Frontend] Fix to Time Conductor for Safari

Fixes #2008
- CSS mod for gradient blockers in TC

* [Frontend] Remove data visualization element in TC

Fixes #2008
- Note: this element holds the TOI indicator!

* [Frontend] Hide TC ticks when on mobile

Fixes #2008
- Added class `mobile-hide` to <conductor-axis>

* [Frontend] Significant mobile fixes for panes and viewport

Fixes #2008
Fixes #1770
Fixes #1928
- Left and right panes now positioning properly in mobile;
- Fixed body overflow problem for #2008 "viewport" issue;

* fixes multiple issues related to 2008
context menu firing too often - fixed by setting a isDragging flag
Add and Remove respective classes on mobile orientation change by using mathMedia
Close tree pane when navigating in mobile portrait only

* [Frontend] Various

Fixes #2008
- Always show Timeline zoom controls;
- Prevent inline editing of object names in the main view when in
mobile;

* Add touch functionality to mct-drag
it allows users to use the splitter in mobile
and include appropriate tests

* remove couchdb and reinstall localStorage

* [Frontend] Mods to imagery CSS

Fixes #2008
- Reduced size of image thumbnails;
- Changed min-heights of image and thumbnail
holders for .mobile.phone

* [Frontend] Add Advanced CSS property to Display Layouts

- WIP!
- Add property to bundle;
- Add CSS for column, row and fit-all classes;

* [Frontend] Grid holder and class prefixing

- WIP!
- Edit grid-holder set to position: absolute
- Added "fl-" prefix to fluid layout class names;

* [Frontend] More CSS tweaks

- WIP!

* [Frontend] Added .drag-vertical

- For use in Elements pool;
- Applied in elements.html;

* fix: check if stats is present before reseting zoom (#2029)

* [Timer] Fix regression in timer visual indication and add tests

* [TimeConductor] Fixes Issue #925 (#2020)

* [TimeConductor] Fixes Issue #925`
- Pressing enter in date field will update bounds properly in Safari

* [Copyright] Update copyright year across platform code references

Fixes #2034.

* fixes issue #1999 - Use Object name as default export filename (#2001)

* fixes issue #1999
add dynamic name(object name) to exportAsCSV filename

* make requested changes

* [Frontend] Add Advanced CSS property to Display Layouts

- WIP!
- Add property to bundle;
- Add CSS for column, row and fit-all classes;

* [Frontend] Grid holder and class prefixing

- WIP!
- Edit grid-holder set to position: absolute
- Added "fl-" prefix to fluid layout class names;

* [Frontend] More CSS tweaks

- WIP!

* [Frontend] Added .drag-vertical

- For use in Elements pool;
- Applied in elements.html;

* [Frontend] More CSS tweaks

- WIP!
- Added .fl-phone-best-fit

* working drag and switch, need to mutate

* fix conflict

* add ability to rearrange composition using drag gestures

* add maxHeight and maxWidth to layout frames

* [Frontend] Added fl-mobile-best-fit

* [Frontend] Allow editor to set mins dimensions for fluid layout

- Cleanups in CSS;
- Mod to LayoutController.js to use minWidth and minHeight;

* [Frontend] Styles for reordering in Elements pool

- Changed class "dragging" to "reordering";
- Visual styling WIP;
- TODO: style "reorder-actor" when implemented;

* add reorder-actor class to draggable item in elements pool when selected and remove class when dropped

* stacked plots reload on composition change

* [Frontend] Tweaks to Elements pool reordering styles

- "reorder-actor" added/removed from parent tree item;
- Refined styling for drag in process in list;

* [Frontend] Added new 12px list view glyph

- Font files and CSS updates;

* [Frontend] Added new 12px grippy glyph

- Font files and CSS updates for Elements pool sorting styling;

* fix failing test

* make reviewer requested changes

* remove create dialog from mobile
2018-05-25 18:58:49 -07:00

351 lines
16 KiB
JavaScript

/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
"./src/LayoutController",
"./src/FixedController",
"./src/LayoutCompositionPolicy",
'./src/MCTTriggerModal',
"text!./res/templates/layout.html",
"text!./res/templates/fixed.html",
"text!./res/templates/frame.html",
"text!./res/templates/elements/telemetry.html",
"text!./res/templates/elements/box.html",
"text!./res/templates/elements/line.html",
"text!./res/templates/elements/text.html",
"text!./res/templates/elements/image.html",
'legacyRegistry'
], function (
LayoutController,
FixedController,
LayoutCompositionPolicy,
MCTTriggerModal,
layoutTemplate,
fixedTemplate,
frameTemplate,
telemetryTemplate,
boxTemplate,
lineTemplate,
textTemplate,
imageTemplate,
legacyRegistry
) {
legacyRegistry.register("platform/features/layout", {
"name": "Layout components.",
"description": "Plug in adding Layout capabilities.",
"extensions": {
"views": [
{
"key": "layout",
"name": "Display Layout",
"cssClass": "icon-layout",
"type": "layout",
"template": layoutTemplate,
"editable": true,
"uses": [],
"toolbar": {
"sections": [
{
"items": [
{
"method": "showFrame",
"cssClass": "icon-frame-show",
"control": "button",
"title": "Show frame",
"description": "Show frame"
},
{
"method": "hideFrame",
"cssClass": "icon-frame-hide",
"control": "button",
"title": "Hide frame",
"description": "Hide frame"
}
]
}
]
}
},
{
"key": "fixed",
"name": "Fixed Position",
"cssClass": "icon-box-with-dashed-lines",
"type": "telemetry.panel",
"template": fixedTemplate,
"uses": [
"composition"
],
"toolbar": {
"sections": [
{
"items": [
{
"method": "add",
"cssClass": "icon-plus",
"control": "menu-button",
"text": "Add",
"title": "Add",
"description": "Add new items",
"options": [
{
"name": "Box",
"cssClass": "icon-box",
"key": "fixed.box"
},
{
"name": "Line",
"cssClass": "icon-line-horz",
"key": "fixed.line"
},
{
"name": "Text",
"cssClass": "icon-T",
"key": "fixed.text"
},
{
"name": "Image",
"cssClass": "icon-image",
"key": "fixed.image"
}
]
}
]
},
{
"items": [
{
"method": "order",
"cssClass": "icon-layers",
"control": "menu-button",
"title": "Layering",
"description": "Move the selected object above or below other objects",
"options": [
{
"name": "Move to Top",
"cssClass": "icon-arrow-double-up",
"key": "top"
},
{
"name": "Move Up",
"cssClass": "icon-arrow-up",
"key": "up"
},
{
"name": "Move Down",
"cssClass": "icon-arrow-down",
"key": "down"
},
{
"name": "Move to Bottom",
"cssClass": "icon-arrow-double-down",
"key": "bottom"
}
]
},
{
"property": "fill",
"cssClass": "icon-paint-bucket",
"title": "Fill color",
"description": "Set fill color",
"control": "color"
},
{
"property": "stroke",
"cssClass": "icon-line-horz",
"title": "Border color",
"description": "Set border color",
"control": "color"
},
{
"property": "color",
"cssClass": "icon-T",
"title": "Text color",
"description": "Set text color",
"mandatory": true,
"control": "color"
},
{
"property": "url",
"cssClass": "icon-image",
"control": "dialog-button",
"title": "Image Properties",
"description": "Edit image properties",
"dialog": {
"control": "textfield",
"name": "Image URL",
"cssClass": "l-input-lg",
"required": true
}
},
{
"property": "text",
"cssClass": "icon-gear",
"control": "dialog-button",
"title": "Text Properties",
"description": "Edit text properties",
"dialog": {
"control": "textfield",
"name": "Text",
"required": true
}
},
{
"method": "showTitle",
"cssClass": "icon-two-parts-both",
"control": "button",
"title": "Show title",
"description": "Show telemetry element title"
},
{
"method": "hideTitle",
"cssClass": "icon-two-parts-one-only",
"control": "button",
"title": "Hide title",
"description": "Hide telemetry element title"
}
]
},
{
"items": [
{
"method": "remove",
"control": "button",
"cssClass": "icon-trash",
"title": "Delete",
"description": "Delete the selected item"
}
]
}
]
}
}
],
"representations": [
{
"key": "frame",
"template": frameTemplate
}
],
"directives": [
{
"key": "mctTriggerModal",
"implementation": MCTTriggerModal,
"depends": [
"$document"
]
}
],
"controllers": [
{
"key": "LayoutController",
"implementation": LayoutController,
"depends": [
"$scope",
"$element",
"openmct"
]
},
{
"key": "FixedController",
"implementation": FixedController,
"depends": [
"$scope",
"$q",
"dialogService",
"openmct",
"$element"
]
}
],
"templates": [
{
"key": "fixed.telemetry",
"template": telemetryTemplate
},
{
"key": "fixed.box",
"template": boxTemplate
},
{
"key": "fixed.line",
"template": lineTemplate
},
{
"key": "fixed.text",
"template": textTemplate
},
{
"key": "fixed.image",
"template": imageTemplate
}
],
"policies": [
{
"category": "composition",
"implementation": LayoutCompositionPolicy
}
],
"types": [
{
"key": "layout",
"name": "Display Layout",
"cssClass": "icon-layout",
"description": "Assemble other objects and components together into a reusable screen layout. Working in a simple canvas workspace, simply drag in the objects you want, position and size them. Save your design and view or edit it at any time.",
"priority": 900,
"features": "creation",
"model": {
"composition": []
},
"properties": [
{
"name": "Layout Grid",
"control": "composite",
"pattern": "^(\\d*[1-9]\\d*)?$",
"items": [
{
"name": "Horizontal grid (px)",
"control": "textfield",
"cssClass": "l-input-sm l-numeric"
},
{
"name": "Vertical grid (px)",
"control": "textfield",
"cssClass": "l-input-sm l-numeric"
}
],
"key": "layoutGrid",
"conversion": "number[]"
},
{
"name": "Advanced",
"control": "textfield",
"key": "layoutAdvancedCss",
"cssClass": "l-input-lg"
}
]
}
]
}
});
});