Skip to content

Initial submission #2

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

Merged
merged 1 commit into from
Oct 11, 2017
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
43 changes: 43 additions & 0 deletions README_Notebook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# NASA - OPEN MCT NOTEBOOK UI PROTOTYPE CHALLENGE

UI Prototype Competition

https://www.topcoder.com/challenge-details/30059614/

Heroku Implementation: http://nasa-mct-notebook.herokuapp.com/

Notebooks are a new domain object that allows users to create and edit timestamped text entries that also include snapshots of timestamped domain objects.

To build locally please follow the steps and requirements for the official openmct project:

## Building and Running Open MCT Locally

Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website.
(These instructions assume you are installing as a non-root user; developers have [reported issues](https://github.com/nasa/openmct/issues/1151) running these steps with root privileges.)

1. Install development dependencies

`npm install`

2. Run a local development server

`npm start`

Open MCT is now running, and can be accessed by pointing a web browser at [http://localhost:8080/](http://localhost:8080/)

The current styles were made according with the visuals handled by the project, in fact a lot of classes (styles) were reused.

In order to persist in localstorage some changes made to the notebook is necessary to save the current state of the view, this for compatibility and familiarity with the behaviour of the rest of the mct components.

Since the snapshots are taken from the dom representation of the components it depends of the implementation of the project, where are some components which can take longer to display, or not display at all if they are not selected.

The notebook should work as a standalone plugin, you just need to put the folder 'notebook' at the examples folder and make the require to it in the index.html.

The Old API was used due to the documentation was more thorought.

#How to use it:
Click on the create menu button at the left top corner of the creen and create a notebook object.
After you saved it you can start to create new entries, either clicking inside of the drag area or dragging an especific object to a new entry or an entry already created.

Once you have created the snapshot of the object, you can make annotations over it. Also you can create whichever snapshots per entry as you consider,

238 changes: 238 additions & 0 deletions example/notebook/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
define([
'openmct',
'./src/controllers/notebookController',
'./src/MCTSnapshot',
'./src/entryDnd',
"./src/actions/viewSnapshot",
"./src/actions/annotateSnapshot",
"./src/actions/removeEmbed",
"./src/actions/createSnapshot",
"./src/actions/removeSnapshot",
"./src/actions/newEntryContextual",
"./src/capabilities/notebookCapability",
"./src/indicators/notificationIndicator",
"text!./res/templates/controls/embedControl.html",
"text!./res/templates/entry.html",
"text!./res/templates/annotation.html",
"text!./res/templates/notifications.html"
], function (
openmct,
notebookController,
MCTSnapshot,
MCTEntryDnd,
viewSnapshotAction,
AnnotateSnapshotAction,
removeEmbedAction,
createSnapshotAction,
removeSnapshotAction,
newEntryAction,
NotebookCapability,
NotificationLaunchIndicator,
embedControlTemplate,
frameTemplate,
annotateSnapshot,
notificationTemplate
) {
openmct.legacyRegistry.register("example/notebook", {
"name": "Notebook Plugin",
"description": "Create and save timestamped notes with embedded object snapshots.",
"extensions":
{
"types":[
{
"key": "notebook",
"name": "Notebook",
"cssClass": "icon-notebook",
"description": "Create and save timestamped notes with embedded object snapshots.",
"features": ["creation"],
"model": {
"entries":[
{ "createdOn": 1507512539258,
"text": "Quis qui dolupti atempe non preicias qui dolorro",
"embeds":[]
},
{ "createdOn": 1507570153599,
"text": "Rehek rerspis nis dem re verae remporrunti sintis vendi comnimi ntiusapic teceseque."
},
{ "createdOn": 1507595098278,
"text": "Rehek rerspis nis dem re verae remporrunti sintis vendi comnimi ntiusapic teceseque."
}
],
"composition":[]
}
}
],
"views": [
{
"key": "notebook.view",
"type": "notebook",
"cssClass": "icon-notebook",
"name": "notebook",
"templateUrl": "templates/notebook.html",
"editable": true,
"uses": [
"composition",
"action"
],
"gestures": [
"drop"
]
},
],
"controllers": [
{
"key": "notebookController",
"implementation": notebookController,
"depends": [ "$scope",
"dialogService",
"popupService",
"agentService",
"now",
"actionService",
"$timeout"
]
}
],
"representations": [
{
"key": "draggedEntry",
"template": frameTemplate
}
],
"templates": [
{
"key": "annotate-snapshot",
"template": annotateSnapshot
},
{
"key": "notificationTemplate",
"template": notificationTemplate
}
],
"directives": [
{
"key": "mctSnapshot",
"implementation": MCTSnapshot,
"depends": [
"$document",
"exportImageService",
"dialogService",
"notificationService"
]
},
{
"key": "mctEntryDnd",
"implementation": MCTEntryDnd,
"depends": [
"$document","dndService","typeService"
]
}
],
"actions": [
{
"key": "view-snapshot",
"implementation": viewSnapshotAction,
"name": "View Snapshot",
"description": "View the large image in a modal",
"category": "embed",
"depends":[
"$compile"
]
},
{
"key": "annotate-snapshot",
"implementation": AnnotateSnapshotAction,
"name": "Annotate Snapshot",
"cssClass": "icon-pencil labeled",
"description": "Annotate embed's snapshot",
"category": "embed",
"depends":[
"dialogService",
"dndService"
]
},
{
"key": "remove-snapshot",
"implementation": removeSnapshotAction,
"name": "Remove Snapshot",
"cssClass": "icon-trash labeled",
"description": "Remove Snapshot of the embed",
"category": "embed",
"depends":[
"dialogService"
]
},
{
"key": "create-snapshot",
"implementation": createSnapshotAction,
"name": "Create Snapshot",
"description": "Create a snapshot for the embed",
"category": "embed-no-snap",
"priority": "preferred"
},
{
"key": "remove-embed",
"implementation": removeEmbedAction,
"name": "Remove...",
"cssClass": "icon-trash labeled",
"description": "Remove this embed",
"category": [
"embed",
"embed-no-snap"
],
"depends":[
"dialogService"
]
},
{
"key": "new-entry-contextual",
"implementation": newEntryAction,
"name": "New Notebook Entry",
"cssClass": "icon-notebook labeled",
"description": "Add a new entry",
"category": [
"contextual"
],
"depends":[
"dialogService",
"notificationService",
"linkService"
]
}
],
"indicators": [
{
"implementation": NotificationLaunchIndicator,
"priority": "fallback"
}
],
"capabilities": [
{
"key": "notebook",
"name": "Notebook Capability",
"description": "Provides a capability for looking for a notebook domain object",
"implementation": NotebookCapability,
"depends": [
"typeService",
]
}
],
"controls": [
{
"key": "embed-control",
"template": embedControlTemplate
},
],
"stylesheets": [
{
"stylesheetUrl": "css/style-guide-espresso.css",
"theme": "espresso"
},
{
"stylesheetUrl": "css/style-guide-snow.css",
"theme": "snow"
}
]
}
});
});
Loading