From a09da3076836bfb3fe28e020647413ae22b232ed Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 31 Jul 2020 12:11:03 -0700 Subject: [PATCH] New eslint rules auto fix (#3058) * no-implicit-coercion and no-unneeded-ternary * End every line with a semicolon * Spacing and formatting * Enabled semi-spacing * Applies npm run lint:fix to code after master merge * Fix merge issues * Switched operator-linebreak to 'before' Co-authored-by: Joshi --- .eslintrc.js | 53 +++ example/eventGenerator/bundle.js | 2 +- example/eventGenerator/src/EventTelemetry.js | 5 +- .../src/EventTelemetryProvider.js | 1 + example/export/ExportTelemetryAsCSVAction.js | 5 +- example/export/bundle.js | 2 +- example/forms/bundle.js | 2 +- example/forms/src/ExampleFormController.js | 40 ++- .../generator/GeneratorMetadataProvider.js | 2 +- example/generator/GeneratorProvider.js | 6 + example/generator/SinewaveLimitProvider.js | 3 + example/generator/StateGeneratorProvider.js | 5 +- example/generator/WorkerInterface.js | 4 +- example/generator/generatorWorker.js | 15 +- example/generator/plugin.js | 2 +- example/identity/bundle.js | 2 +- .../identity/src/ExampleIdentityService.js | 40 ++- example/imagery/plugin.js | 12 +- example/mobile/bundle.js | 2 +- example/msl/bundle.js | 11 +- example/msl/src/MSLDataDictionary.js | 2 +- example/msl/src/RemsTelemetryModelProvider.js | 2 + example/msl/src/RemsTelemetryProvider.js | 1 + example/msl/src/RemsTelemetrySeries.js | 1 + example/msl/src/RemsTelemetryServerAdapter.js | 16 +- example/notifications/bundle.js | 2 +- .../src/DialogLaunchController.js | 8 +- .../src/DialogLaunchIndicator.js | 2 + .../src/NotificationLaunchController.js | 14 +- .../src/NotificationLaunchIndicator.js | 2 + example/persistence/bundle.js | 2 +- .../src/BrowserPersistenceProvider.js | 4 +- example/policy/bundle.js | 2 +- example/policy/src/ExamplePolicy.js | 1 + example/profiling/bundle.js | 2 +- example/scratchpad/bundle.js | 2 +- .../src/ScratchPersistenceProvider.js | 6 +- example/simpleVuePlugin/HelloWorld.vue | 4 +- example/simpleVuePlugin/plugin.js | 5 +- example/styleguide/bundle.js | 118 ++++++- .../src/ExampleStyleGuideModelProvider.js | 50 ++- platform/commonUI/about/bundle.js | 2 +- .../commonUI/about/src/AboutController.js | 1 - .../about/test/AboutControllerSpec.js | 11 +- platform/commonUI/browse/bundle.js | 2 +- .../browse/src/navigation/NavigateAction.js | 1 + .../src/navigation/NavigationService.js | 7 + .../src/navigation/OrphanNavigationHandler.js | 1 + .../test/navigation/NavigateActionSpec.js | 2 + .../test/navigation/NavigationServiceSpec.js | 1 - .../navigation/OrphanNavigationHandlerSpec.js | 8 +- platform/commonUI/dialog/bundle.js | 2 +- .../commonUI/dialog/src/OverlayService.js | 2 +- .../commonUI/dialog/test/DialogServiceSpec.js | 4 +- .../dialog/test/OverlayServiceSpec.js | 2 +- .../commonUI/edit/src/actions/CancelAction.js | 8 +- .../commonUI/edit/src/actions/EditAction.js | 6 +- .../edit/src/actions/EditAndComposeAction.js | 6 +- .../edit/src/actions/PropertiesAction.js | 1 - .../edit/src/actions/PropertiesDialog.js | 1 + .../commonUI/edit/src/actions/SaveAction.js | 9 +- .../commonUI/edit/src/actions/SaveAsAction.js | 26 +- .../edit/src/capabilities/EditorCapability.js | 2 + .../TransactionCapabilityDecorator.js | 8 +- .../TransactionalPersistenceCapability.js | 2 + .../src/controllers/EditActionController.js | 12 +- .../src/controllers/EditObjectController.js | 8 +- .../src/controllers/EditPanesController.js | 5 +- .../edit/src/creation/CreateAction.js | 1 - .../edit/src/creation/CreateMenuController.js | 6 +- .../edit/src/creation/CreateWizard.js | 1 + .../edit/src/creation/CreationService.js | 8 +- .../edit/src/creation/LocatorController.js | 13 +- .../policies/EditPersistableObjectsPolicy.js | 1 + .../edit/src/representers/EditRepresenter.js | 1 + .../edit/src/services/NestedTransaction.js | 1 + .../commonUI/edit/src/services/Transaction.js | 7 +- .../edit/src/services/TransactionManager.js | 3 +- .../edit/src/services/TransactionService.js | 10 +- .../edit/test/actions/CancelActionSpec.js | 6 +- .../test/actions/EditAndComposeActionSpec.js | 5 +- .../edit/test/actions/PropertiesActionSpec.js | 5 +- .../edit/test/actions/SaveActionSpec.js | 2 + .../actions/SaveAndStopEditingActionSpec.js | 1 - .../edit/test/actions/SaveAsActionSpec.js | 15 +- .../test/capabilities/EditorCapabilitySpec.js | 8 +- .../TransactionalPersistenceCapabilitySpec.js | 8 +- .../controllers/EditActionControllerSpec.js | 1 + .../controllers/EditObjectControllerSpec.js | 7 +- .../controllers/EditPanesControllerSpec.js | 3 +- .../test/creation/CreateActionProviderSpec.js | 3 +- .../edit/test/creation/CreateActionSpec.js | 6 +- .../edit/test/creation/CreateWizardSpec.js | 7 +- .../edit/test/creation/CreationServiceSpec.js | 11 +- .../test/representers/EditRepresenterSpec.js | 2 - .../test/services/NestedTransactionSpec.js | 1 - .../test/services/TransactionManagerSpec.js | 1 + platform/commonUI/formats/bundle.js | 6 +- .../commonUI/formats/src/DurationFormat.js | 1 - .../commonUI/formats/src/FormatProvider.js | 1 + .../commonUI/formats/src/UTCTimeFormat.js | 1 + .../formats/test/FormatProviderSpec.js | 2 + platform/commonUI/general/bundle.js | 2 +- .../general/src/SplashScreenManager.js | 2 +- .../commonUI/general/src/StyleSheetLoader.js | 4 +- .../src/controllers/BannerController.js | 5 + .../src/controllers/ClickAwayController.js | 1 + .../controllers/DateTimeFieldController.js | 5 +- .../controllers/DateTimePickerController.js | 25 +- .../controllers/ObjectInspectorController.js | 23 +- .../src/controllers/SelectorController.js | 10 +- .../src/controllers/TimeRangeController.js | 18 +- .../src/controllers/TreeNodeController.js | 20 +- .../general/src/directives/MCTContainer.js | 1 + .../general/src/directives/MCTDrag.js | 2 + .../general/src/directives/MCTResize.js | 14 +- .../general/src/directives/MCTSelectable.js | 1 - .../general/src/directives/MCTSplitPane.js | 21 +- .../general/src/directives/MCTSplitter.js | 14 +- .../general/src/directives/MCTTree.js | 4 + .../commonUI/general/src/services/Overlay.js | 31 +- .../general/src/services/PopupService.js | 2 +- .../general/src/services/UrlService.js | 10 +- .../commonUI/general/src/ui/ToggleView.js | 3 +- .../commonUI/general/src/ui/TreeLabelView.js | 2 + .../commonUI/general/src/ui/TreeNodeView.js | 11 +- platform/commonUI/general/src/ui/TreeView.js | 2 +- .../general/test/SplashScreenManagerSpec.js | 1 + .../general/test/StyleSheetLoaderSpec.js | 16 +- .../controllers/ActionGroupControllerSpec.js | 31 +- .../controllers/ClickAwayControllerSpec.js | 2 - .../DateTimePickerControllerSpec.js | 1 - .../controllers/SelectorControllerSpec.js | 6 +- .../controllers/TimeRangeControllerSpec.js | 12 +- .../controllers/TreeNodeControllerSpec.js | 1 - .../controllers/ViewSwitcherControllerSpec.js | 70 +++- .../test/directives/MCTContainerSpec.js | 10 +- .../general/test/directives/MCTDragSpec.js | 30 +- .../general/test/directives/MCTPopupSpec.js | 1 + .../general/test/directives/MCTResizeSpec.js | 26 +- .../general/test/directives/MCTScrollSpec.js | 1 - .../test/directives/MCTSplitPaneSpec.js | 20 +- .../test/directives/MCTSplitterSpec.js | 2 +- .../general/test/directives/MCTTreeSpec.js | 3 + .../general/test/services/PopupServiceSpec.js | 6 +- .../general/test/services/PopupSpec.js | 6 +- .../general/test/services/UrlServiceSpec.js | 5 +- .../commonUI/general/test/ui/TreeViewSpec.js | 6 +- platform/commonUI/inspect/bundle.js | 2 +- .../commonUI/inspect/src/InfoConstants.js | 14 +- .../inspect/src/gestures/InfoGesture.js | 5 +- .../inspect/src/services/InfoService.js | 4 +- .../test/gestures/InfoButtonGestureSpec.js | 9 +- .../inspect/test/gestures/InfoGestureSpec.js | 50 ++- .../inspect/test/services/InfoServiceSpec.js | 1 + platform/commonUI/mobile/bundle.js | 2 +- platform/commonUI/mobile/src/AgentService.js | 3 +- platform/commonUI/mobile/src/MCTDevice.js | 2 + .../commonUI/mobile/test/AgentServiceSpec.js | 1 - .../mobile/test/DeviceClassifierSpec.js | 7 +- .../mobile/test/DeviceMatchersSpec.js | 1 - platform/commonUI/notification/bundle.js | 2 +- platform/commonUI/regions/bundle.js | 2 +- .../regions/src/EditableRegionPolicy.js | 1 + platform/commonUI/regions/test/RegionSpec.js | 5 +- platform/containment/bundle.js | 2 +- .../containment/src/ComposeActionPolicy.js | 6 +- .../containment/src/CompositionModelPolicy.js | 1 + platform/containment/src/CompositionPolicy.js | 2 + .../src/PersistableCompositionPolicy.js | 2 + .../test/ComposeActionPolicySpec.js | 2 + .../containment/test/CompositionPolicySpec.js | 2 - platform/core/bundle.js | 2 +- platform/core/src/actions/ActionCapability.js | 9 +- platform/core/src/actions/ActionProvider.js | 5 +- .../src/actions/LoggingActionDecorator.js | 1 + .../src/capabilities/CompositionCapability.js | 4 +- .../src/capabilities/ContextCapability.js | 14 +- .../capabilities/ContextualDomainObject.js | 6 +- .../capabilities/CoreCapabilityProvider.js | 7 +- .../src/capabilities/DelegationCapability.js | 12 +- .../capabilities/InstantiationCapability.js | 4 +- .../src/capabilities/MetadataCapability.js | 8 +- .../src/capabilities/MutationCapability.js | 1 + .../src/capabilities/PersistenceCapability.js | 5 +- .../capabilities/RelationshipCapability.js | 4 +- .../src/identifiers/IdentifierProvider.js | 1 + .../core/src/models/CachingModelDecorator.js | 1 + .../core/src/models/MissingModelDecorator.js | 1 + platform/core/src/models/ModelAggregator.js | 2 + .../core/src/models/PersistedModelProvider.js | 20 +- .../core/src/models/StaticModelProvider.js | 7 +- platform/core/src/objects/DomainObjectImpl.js | 11 +- .../core/src/objects/DomainObjectProvider.js | 1 + .../src/runs/TransactingMutationListener.js | 1 + platform/core/src/services/Instantiate.js | 1 + platform/core/src/services/Throttle.js | 2 + platform/core/src/services/Topic.js | 2 + platform/core/src/types/MergeModels.js | 15 +- platform/core/src/types/TypeImpl.js | 1 - platform/core/src/types/TypeProperty.js | 25 +- .../core/src/types/TypePropertyConversion.js | 13 +- platform/core/src/types/TypeProvider.js | 16 +- platform/core/src/views/ViewProvider.js | 4 +- .../core/test/actions/ActionAggregatorSpec.js | 1 + .../core/test/actions/ActionCapabilitySpec.js | 2 - .../core/test/actions/ActionProviderSpec.js | 37 +- .../actions/LoggingActionDecoratorSpec.js | 2 - .../capabilities/CompositionCapabilitySpec.js | 3 + .../capabilities/ContextCapabilitySpec.js | 1 - .../ContextualDomainObjectSpec.js | 4 - .../CoreCapabilityProviderSpec.js | 2 + .../capabilities/DelegationCapabilitySpec.js | 22 +- .../InstantiationCapabilitySpec.js | 1 - .../capabilities/MetadataCapabilitySpec.js | 1 + .../capabilities/MutationCapabilitySpec.js | 1 + .../capabilities/PersistenceCapabilitySpec.js | 14 +- .../RelationshipCapabilitySpec.js | 12 +- .../test/models/CachingModelDecoratorSpec.js | 2 +- .../core/test/models/ModelAggregatorSpec.js | 11 +- .../core/test/models/ModelCacheServiceSpec.js | 1 + .../test/models/PersistedModelProviderSpec.js | 65 +++- .../test/models/StaticModelProviderSpec.js | 19 +- .../test/objects/DomainObjectProviderSpec.js | 1 - .../core/test/objects/DomainObjectSpec.js | 4 +- .../runs/TransactingMutationListenerSpec.js | 2 + .../core/test/services/InstantiateSpec.js | 4 +- platform/core/test/types/TypePropertySpec.js | 5 +- platform/core/test/types/TypeProviderSpec.js | 2 - platform/core/test/views/ViewProviderSpec.js | 8 +- platform/entanglement/bundle.js | 2 +- .../src/actions/AbstractComposeAction.js | 13 +- .../entanglement/src/actions/CopyAction.js | 4 + .../entanglement/src/actions/MoveAction.js | 4 +- .../src/actions/SetPrimaryLocationAction.js | 6 +- .../src/capabilities/LocationCapability.js | 2 +- .../entanglement/src/policies/CopyPolicy.js | 3 +- .../src/policies/CrossSpacePolicy.js | 12 +- .../entanglement/src/policies/MovePolicy.js | 8 +- .../entanglement/src/services/CopyService.js | 7 +- .../entanglement/src/services/CopyTask.js | 14 +- .../entanglement/src/services/LinkService.js | 5 +- .../src/services/LocatingCreationDecorator.js | 2 +- .../src/services/LocatingObjectDecorator.js | 2 +- .../src/services/LocationService.js | 1 - .../entanglement/src/services/MoveService.js | 9 +- .../entanglement/test/ControlledPromise.js | 1 - .../entanglement/test/DomainObjectFactory.js | 5 + .../test/actions/AbstractComposeActionSpec.js | 3 - .../test/actions/CopyActionSpec.js | 10 +- .../test/actions/LinkActionSpec.js | 3 - .../test/actions/MoveActionSpec.js | 3 - .../actions/SetPrimaryLocationActionSpec.js | 1 - .../capabilities/LocationCapabilitySpec.js | 3 +- .../test/policies/CrossSpacePolicySpec.js | 1 + .../test/policies/MovePolicySpec.js | 1 - .../test/services/CopyServiceSpec.js | 14 +- .../test/services/CopyTaskSpec.js | 15 +- .../test/services/LinkServiceSpec.js | 3 +- .../services/LocatingCreationDecoratorSpec.js | 1 - .../services/LocatingObjectDecoratorSpec.js | 22 +- .../test/services/LocationServiceSpec.js | 2 +- .../test/services/MockLinkService.js | 1 + platform/execution/bundle.js | 2 +- platform/execution/src/WorkerService.js | 7 +- platform/execution/test/WorkerServiceSpec.js | 20 +- platform/exporters/ExportService.js | 5 +- platform/exporters/ExportServiceSpec.js | 22 +- platform/exporters/bundle.js | 2 +- platform/features/clock/bundle.js | 2 +- .../clock/src/actions/FollowTimerAction.js | 8 +- .../clock/src/actions/PauseTimerAction.js | 9 +- .../clock/src/actions/RestartTimerAction.js | 8 +- .../clock/src/actions/StartTimerAction.js | 9 +- .../clock/src/actions/StopTimerAction.js | 9 +- .../clock/src/controllers/ClockController.js | 12 +- .../src/controllers/RefreshingController.js | 5 +- .../clock/src/controllers/TimerController.js | 35 +- .../clock/src/services/TimerService.js | 14 +- .../test/actions/FollowTimerActionSpec.js | 10 +- .../test/actions/PauseTimerActionSpec.js | 1 + .../test/actions/RestartTimerActionSpec.js | 1 + .../test/actions/StartTimerActionSpec.js | 1 + .../clock/test/actions/StopTimerActionSpec.js | 1 + .../controllers/RefreshingControllerSpec.js | 2 - .../test/controllers/TimerControllerSpec.js | 15 +- platform/features/hyperlink/bundle.js | 2 +- .../hyperlink/src/HyperlinkController.js | 3 + platform/features/my-items/bundle.js | 2 +- platform/features/pages/bundle.js | 2 +- platform/features/static-markup/bundle.js | 2 +- platform/forms/bundle.js | 2 +- platform/forms/src/FileInputService.js | 4 +- platform/forms/src/MCTFileInput.js | 6 +- .../src/controllers/AutocompleteController.js | 4 +- .../forms/src/controllers/ColorController.js | 7 +- .../src/controllers/DateTimeController.js | 4 +- .../controllers/SnapshotPreviewController.js | 1 + platform/forms/test/MCTControlSpec.js | 10 +- platform/forms/test/MCTFileInputSpec.js | 7 +- platform/forms/test/MCTFormSpec.js | 2 +- .../controllers/AutocompleteControllerSpec.js | 10 +- .../controllers/DateTimeControllerSpec.js | 1 - .../test/controllers/FormControllerSpec.js | 1 - platform/framework/bundle.js | 2 +- platform/framework/src/FrameworkLayer.js | 1 + platform/framework/src/LogLevel.js | 1 + platform/framework/src/Main.js | 1 + .../src/bootstrap/ApplicationBootstrapper.js | 1 + platform/framework/src/load/Bundle.js | 23 +- platform/framework/src/load/BundleLoader.js | 14 +- platform/framework/src/load/Extension.js | 13 +- .../src/register/CustomRegistrars.js | 1 + .../src/register/ExtensionRegistrar.js | 17 +- .../framework/src/register/ExtensionSorter.js | 4 +- .../framework/src/resolve/BundleResolver.js | 1 + .../src/resolve/ExtensionResolver.js | 20 +- .../src/resolve/ImplementationLoader.js | 1 + .../bootstrap/ApplicationBootstrapperSpec.js | 3 +- .../framework/test/load/BundleLoaderSpec.js | 1 - platform/framework/test/load/BundleSpec.js | 6 +- .../test/register/CustomRegistrarsSpec.js | 16 +- .../test/register/PartialConstructorSpec.js | 1 + .../test/register/ServiceCompositorSpec.js | 14 +- .../test/resolve/BundleResolverSpec.js | 7 +- .../test/resolve/ExtensionResolverSpec.js | 13 +- platform/identity/bundle.js | 2 +- .../identity/src/IdentityCreationDecorator.js | 2 +- platform/identity/src/IdentityIndicator.js | 2 + .../identity/test/IdentityAggregatorSpec.js | 15 +- .../test/IdentityCreationDecoratorSpec.js | 6 +- .../identity/test/IdentityProviderSpec.js | 1 - .../src/actions/ExportAsJSONAction.js | 12 +- .../src/actions/ImportAsJSONAction.js | 22 +- .../test/actions/ExportAsJSONActionSpec.js | 57 ++- .../test/actions/ImportAsJSONActionSpec.js | 14 +- platform/persistence/aggregator/bundle.js | 2 +- .../aggregator/src/PersistenceAggregator.js | 9 +- .../test/PersistenceAggregatorSpec.js | 2 + platform/persistence/couch/bundle.js | 2 +- .../persistence/couch/src/CouchIndicator.js | 1 - .../couch/src/CouchPersistenceProvider.js | 6 +- .../couch/test/CouchIndicatorSpec.js | 1 - .../test/CouchPersistenceProviderSpec.js | 42 ++- platform/persistence/elastic/bundle.js | 2 +- .../elastic/src/ElasticIndicator.js | 3 + .../elastic/src/ElasticPersistenceProvider.js | 10 +- .../elastic/src/ElasticSearchProvider.js | 1 - .../elastic/test/ElasticIndicatorSpec.js | 1 - .../test/ElasticPersistenceProviderSpec.js | 58 ++- platform/persistence/local/bundle.js | 2 +- .../local/src/LocalStorageIndicator.js | 3 + .../src/LocalStoragePersistenceProvider.js | 7 +- .../local/test/LocalStorageIndicatorSpec.js | 2 - .../LocalStoragePersistenceProviderSpec.js | 1 - platform/persistence/queue/bundle.js | 2 +- .../queue/src/PersistenceFailureDialog.js | 13 +- .../queue/src/PersistenceFailureHandler.js | 1 + .../persistence/queue/src/PersistenceQueue.js | 1 - .../queue/src/PersistenceQueueHandler.js | 7 +- .../queue/src/PersistenceQueueImpl.js | 12 +- .../QueuingPersistenceCapabilityDecorator.js | 7 +- .../test/PersistenceFailureConstantsSpec.js | 1 - .../test/PersistenceFailureControllerSpec.js | 1 - .../test/PersistenceFailureDialogSpec.js | 26 +- .../test/PersistenceFailureHandlerSpec.js | 7 +- .../queue/test/PersistenceQueueHandlerSpec.js | 3 +- .../queue/test/PersistenceQueueImplSpec.js | 3 +- .../queue/test/PersistenceQueueSpec.js | 1 - ...euingPersistenceCapabilityDecoratorSpec.js | 1 - .../test/QueuingPersistenceCapabilitySpec.js | 1 - platform/policy/bundle.js | 2 +- platform/policy/src/PolicyProvider.js | 3 +- platform/policy/test/PolicyProviderSpec.js | 34 +- platform/representation/bundle.js | 2 +- platform/representation/src/MCTInclude.js | 6 +- .../representation/src/MCTRepresentation.js | 17 +- platform/representation/src/TemplateLinker.js | 1 + .../src/gestures/DragGesture.js | 2 - .../src/gestures/DropGesture.js | 2 +- .../src/gestures/GestureProvider.js | 6 +- .../representation/test/MCTIncludeSpec.js | 10 +- .../test/MCTRepresentationSpec.js | 22 +- .../representation/test/TemplateLinkerSpec.js | 6 +- .../test/TemplatePrefetcherSpec.js | 1 - .../test/gestures/DragGestureSpec.js | 2 - .../test/gestures/DropGestureSpec.js | 6 +- .../test/services/DndServiceSpec.js | 1 - platform/search/bundle.js | 2 +- .../src/controllers/SearchController.js | 7 +- .../src/controllers/SearchMenuController.js | 3 +- .../src/services/GenericSearchProvider.js | 8 +- .../src/services/GenericSearchWorker.js | 10 +- .../search/src/services/SearchAggregator.js | 5 + .../test/controllers/SearchControllerSpec.js | 23 +- .../controllers/SearchMenuControllerSpec.js | 12 +- .../services/GenericSearchProviderSpec.js | 18 +- .../test/services/GenericSearchWorkerSpec.js | 1 - .../test/services/SearchAggregatorSpec.js | 22 +- platform/status/bundle.js | 2 +- platform/status/src/StatusRepresenter.js | 1 - platform/status/src/StatusService.js | 1 + platform/telemetry/bundle.js | 2 +- platform/telemetry/src/TelemetryAggregator.js | 1 - platform/telemetry/src/TelemetryCapability.js | 32 +- platform/telemetry/src/TelemetryController.js | 15 +- platform/telemetry/src/TelemetryDelegator.js | 5 +- platform/telemetry/src/TelemetryFormatter.js | 6 +- platform/telemetry/src/TelemetryHandle.js | 15 +- platform/telemetry/src/TelemetryHandler.js | 1 - platform/telemetry/src/TelemetryQueue.js | 3 +- .../telemetry/src/TelemetrySubscription.js | 35 +- platform/telemetry/src/TelemetryTable.js | 1 + .../telemetry/test/TelemetryAggregatorSpec.js | 1 + .../telemetry/test/TelemetryCapabilitySpec.js | 47 ++- .../telemetry/test/TelemetryControllerSpec.js | 5 +- .../telemetry/test/TelemetryHandleSpec.js | 6 +- platform/telemetry/test/TelemetryQueueSpec.js | 13 +- .../test/TelemetrySubscriptionSpec.js | 9 +- platform/telemetry/test/TelemetryTableSpec.js | 11 +- src/BundleRegistry.js | 6 +- src/MCT.js | 35 +- src/adapter/actions/ActionDialogDecorator.js | 1 + src/adapter/actions/LegacyActionAdapter.js | 2 + .../actions/LegacyContextMenuAction.js | 10 +- src/adapter/bundle.js | 2 +- .../capabilities/APICapabilityDecorator.js | 2 + .../AlternateCompositionCapability.js | 1 + .../capabilities/patchViewCapability.js | 1 + .../synchronizeMutationCapability.js | 1 + .../indicators/legacy-indicators-plugin.js | 11 +- .../legacy-indicators-pluginSpec.js | 2 +- src/adapter/policies/AdaptedViewPolicy.js | 2 + .../runs/AlternateCompositionInitializer.js | 3 +- src/adapter/runs/LegacyTelemetryProvider.js | 2 + src/adapter/runs/TypeDeprecationChecker.js | 8 +- src/adapter/services/Instantiate.js | 1 + .../services/LegacyObjectAPIInterceptor.js | 12 +- .../MissingModelCompatibilityDecorator.js | 2 + src/adapter/views/LegacyViewProvider.js | 9 +- .../views/TypeInspectorViewProvider.js | 7 +- src/adapter/views/installLegacyViews.js | 1 + src/api/Branding.js | 1 + src/api/Editor.js | 9 +- src/api/composition/CompositionAPISpec.js | 39 ++- src/api/composition/CompositionCollection.js | 16 +- .../composition/DefaultCompositionProvider.js | 18 +- src/api/contextMenu/ContextMenu.vue | 2 +- src/api/contextMenu/ContextMenuAPI.js | 4 +- src/api/indicators/SimpleIndicator.js | 4 + src/api/notifications/NotificationAPI.js | 21 +- src/api/objects/ObjectAPI.js | 25 +- src/api/objects/ObjectAPISpec.js | 7 +- src/api/objects/RootRegistry.js | 1 + src/api/objects/object-utils.js | 13 +- src/api/objects/test/RootRegistrySpec.js | 20 +- src/api/objects/test/object-utilsSpec.js | 1 - src/api/overlays/Overlay.js | 2 +- src/api/overlays/OverlayAPI.js | 1 - src/api/overlays/ProgressDialog.js | 2 +- .../overlays/components/DialogComponent.vue | 4 +- .../overlays/components/OverlayComponent.vue | 3 +- .../components/ProgressDialogComponent.vue | 4 +- src/api/telemetry/DefaultMetadataProvider.js | 8 +- src/api/telemetry/TelemetryAPI.js | 33 +- src/api/telemetry/TelemetryAPISpec.js | 10 +- src/api/telemetry/TelemetryMetadataManager.js | 25 +- src/api/telemetry/TelemetryValueFormatter.js | 15 +- src/api/time/TimeAPI.js | 27 +- src/api/time/TimeAPISpec.js | 36 +- src/api/types/Type.js | 2 +- src/api/types/TypeRegistry.js | 14 +- src/exporters/CSVExporter.js | 4 +- .../LADTable/LADTableCompositionPolicy.js | 7 +- .../LADTable/LADTableSetViewProvider.js | 2 +- src/plugins/LADTable/LADTableViewProvider.js | 2 +- src/plugins/LADTable/components/LADRow.vue | 21 +- src/plugins/LADTable/components/LADTable.vue | 4 +- .../LADTable/components/LadTableSet.vue | 16 +- src/plugins/LADTable/pluginSpec.js | 64 +++- .../URLIndicatorPlugin/URLIndicator.js | 2 + .../URLTimeSettingsSynchronizer.js | 39 ++- .../URLTimeSettingsSynchronizer/plugin.js | 2 +- .../URLTimeSettingsSynchronizer/pluginSpec.js | 40 ++- .../autoflow/AutoflowTabularPluginSpec.js | 40 ++- src/plugins/autoflow/AutoflowTabularView.js | 4 +- src/plugins/autoflow/VueView.js | 1 + src/plugins/autoflow/dom-observer.js | 6 +- src/plugins/buildInfo/pluginSpec.js | 5 +- .../components/globalClearIndicator.vue | 2 +- .../clearData/test/clearDataActionSpec.js | 2 +- src/plugins/condition/Condition.js | 18 +- src/plugins/condition/ConditionManager.js | 31 +- src/plugins/condition/ConditionManagerSpec.js | 3 +- .../ConditionSetCompositionPolicy.js | 2 +- .../ConditionSetCompositionPolicySpec.js | 7 +- .../ConditionSetTelemetryProvider.js | 2 +- .../condition/ConditionSetViewPolicy.js | 3 +- .../condition/ConditionSetViewProvider.js | 3 +- src/plugins/condition/ConditionSpec.js | 7 +- src/plugins/condition/StyleRuleManager.js | 10 +- .../condition/components/Condition.vue | 37 +- .../components/ConditionCollection.vue | 22 +- .../components/ConditionDescription.vue | 2 +- .../condition/components/ConditionError.vue | 4 +- .../condition/components/ConditionSet.vue | 2 +- .../condition/components/Criterion.vue | 21 +- src/plugins/condition/components/TestData.vue | 9 +- .../inspector/ConditionSetDialogTreeItem.vue | 10 +- .../inspector/ConditionSetSelectorDialog.vue | 8 +- .../inspector/ConditionalStylesView.vue | 40 ++- .../inspector/MultiSelectStylesView.vue | 26 +- .../components/inspector/StyleEditor.vue | 19 +- .../components/inspector/StylesView.vue | 49 ++- .../criterion/AllTelemetryCriterion.js | 14 +- .../condition/criterion/TelemetryCriterion.js | 24 +- .../criterion/TelemetryCriterionSpec.js | 11 +- src/plugins/condition/plugin.js | 2 +- src/plugins/condition/pluginSpec.js | 264 +++++++------- src/plugins/condition/utils/evaluator.js | 3 +- src/plugins/condition/utils/evaluatorSpec.js | 8 +- src/plugins/condition/utils/operations.js | 19 +- src/plugins/condition/utils/operationsSpec.js | 44 +-- src/plugins/condition/utils/styleUtils.js | 34 +- src/plugins/condition/utils/time.js | 10 +- src/plugins/condition/utils/timeSpec.js | 1 + .../ConditionWidgetViewProvider.js | 2 +- .../components/ConditionWidget.vue | 4 +- .../AlphanumericFormatViewProvider.js | 19 +- .../displayLayout/DisplayLayoutToolbar.js | 48 ++- .../displayLayout/DisplayLayoutType.js | 2 +- src/plugins/displayLayout/LayoutDrag.js | 3 +- .../components/AlphanumericFormatView.vue | 4 +- .../displayLayout/components/BoxView.vue | 4 +- .../components/DisplayLayout.vue | 45 ++- .../displayLayout/components/EditMarquee.vue | 12 +- .../displayLayout/components/ImageView.vue | 6 +- .../displayLayout/components/LayoutFrame.vue | 8 +- .../displayLayout/components/LineView.vue | 74 +++- .../components/SubobjectView.vue | 8 +- .../components/TelemetryView.vue | 11 +- .../displayLayout/components/TextView.vue | 4 +- .../mixins/objectStyles-mixin.js | 2 +- src/plugins/displayLayout/plugin.js | 15 +- .../filters/FiltersInspectorViewProvider.js | 7 +- .../filters/components/FilterField.vue | 6 +- .../filters/components/FilterObject.vue | 10 +- .../filters/components/FiltersView.vue | 17 +- .../filters/components/GlobalFilters.vue | 4 +- .../flexibleLayout/components/container.vue | 15 +- .../flexibleLayout/components/dropHint.vue | 6 +- .../components/flexibleLayout.vue | 21 +- .../flexibleLayout/components/frame.vue | 6 +- .../components/resizeHandle.vue | 4 +- .../flexibleLayoutViewProvider.js | 5 +- src/plugins/flexibleLayout/toolbarProvider.js | 4 +- src/plugins/folderView/FolderGridView.js | 3 +- src/plugins/folderView/FolderListView.js | 3 +- .../folderView/components/GridItem.vue | 2 +- .../folderView/components/GridView.vue | 2 +- .../folderView/components/ListItem.vue | 2 +- .../folderView/components/ListView.vue | 3 +- .../components/composition-loader.js | 6 +- src/plugins/imagery/ImageryViewProvider.js | 2 +- .../imagery/components/ImageryViewLayout.vue | 25 +- src/plugins/latestDataClock/LADClock.js | 1 + src/plugins/licenses/Licenses.vue | 4 +- .../localTimeSystem/LocalTimeFormat.js | 1 + .../notebook/components/menu-items.vue | 2 +- .../notebook/components/notebook-embed.vue | 14 +- .../notebook/components/notebook-entry.vue | 8 +- .../components/notebook-menu-switcher.vue | 4 +- .../notebook-snapshot-container.vue | 8 +- .../notebook-snapshot-indicator.vue | 7 +- src/plugins/notebook/components/notebook.vue | 16 +- .../notebook/components/page-collection.vue | 19 +- .../notebook/components/page-component.vue | 9 +- .../notebook/components/popup-menu.vue | 6 +- .../notebook/components/search-results.vue | 6 +- .../components/section-collection.vue | 19 +- .../notebook/components/section-component.vue | 9 +- src/plugins/notebook/components/sidebar.vue | 34 +- src/plugins/notebook/plugin.js | 3 +- .../notebook/utils/notebook-entries.js | 21 +- .../components/NotificationIndicator.vue | 4 +- .../components/NotificationMessage.vue | 10 +- .../components/NotificationsList.vue | 6 +- .../notificationIndicator/pluginSpec.js | 1 + src/plugins/objectMigration/Migrations.js | 28 +- src/plugins/objectMigration/plugin.js | 6 +- src/plugins/plot/plugin.js | 1 + src/plugins/plot/src/PlotViewPolicy.js | 5 +- .../plot/src/chart/MCTChartAlarmPointSet.js | 2 - .../plot/src/chart/MCTChartController.js | 13 +- .../plot/src/chart/MCTChartLineStepAfter.js | 2 + .../plot/src/chart/MCTChartSeriesElement.js | 3 + .../plot/src/configuration/Collection.js | 3 + src/plugins/plot/src/configuration/Model.js | 2 + .../configuration/PlotConfigurationModel.js | 5 +- .../plot/src/configuration/PlotSeries.js | 27 +- .../src/configuration/SeriesCollection.js | 8 +- .../plot/src/configuration/XAxisModel.js | 2 + .../plot/src/configuration/YAxisModel.js | 12 + src/plugins/plot/src/draw/Draw2D.js | 7 +- src/plugins/plot/src/draw/DrawLoader.js | 8 +- src/plugins/plot/src/draw/DrawWebGL.js | 20 +- .../plot/src/inspector/InspectorRegion.js | 1 - .../src/inspector/PlotModelFormController.js | 12 +- .../src/inspector/PlotOptionsController.js | 1 + .../src/inspector/PlotSeriesFormController.js | 2 +- .../src/inspector/PlotYAxisFormController.js | 10 + src/plugins/plot/src/inspector/Region.js | 1 - src/plugins/plot/src/lib/color.js | 12 +- src/plugins/plot/src/lib/eventHelpers.js | 7 + src/plugins/plot/src/lib/extend.js | 1 + src/plugins/plot/src/plot/LinearScale.js | 10 + .../plot/src/plot/MCTPlotController.js | 35 +- .../plot/src/plot/MCTTicksController.js | 25 +- .../plot/src/services/ExportImageService.js | 2 + .../plot/src/telemetry/PlotController.js | 11 +- .../src/telemetry/StackedPlotController.js | 1 + src/plugins/remove/RemoveAction.js | 12 +- src/plugins/remove/plugin.js | 2 +- .../staticRootPlugin/StaticModelProvider.js | 4 + src/plugins/staticRootPlugin/plugin.js | 2 + .../summaryWidget/SummaryWidgetViewPolicy.js | 1 + src/plugins/summaryWidget/plugin.js | 6 +- src/plugins/summaryWidget/src/Condition.js | 4 +- .../summaryWidget/src/ConditionEvaluator.js | 12 +- .../summaryWidget/src/ConditionManager.js | 12 +- src/plugins/summaryWidget/src/Rule.js | 20 +- .../summaryWidget/src/SummaryWidget.js | 17 +- src/plugins/summaryWidget/src/TestDataItem.js | 2 + .../summaryWidget/src/TestDataManager.js | 1 + src/plugins/summaryWidget/src/WidgetDnD.js | 2 + src/plugins/summaryWidget/src/eventHelpers.js | 7 + .../summaryWidget/src/input/ColorPalette.js | 16 +- .../summaryWidget/src/input/KeySelect.js | 3 +- .../src/input/OperationSelect.js | 2 + .../summaryWidget/src/input/Palette.js | 5 +- src/plugins/summaryWidget/src/input/Select.js | 4 +- .../src/telemetry/EvaluatorPool.js | 2 + .../src/telemetry/EvaluatorPoolSpec.js | 1 + .../src/telemetry/SummaryWidgetCondition.js | 3 + .../src/telemetry/SummaryWidgetEvaluator.js | 4 + .../SummaryWidgetMetadataProvider.js | 2 +- .../src/telemetry/SummaryWidgetRule.js | 2 + .../SummaryWidgetTelemetryProvider.js | 3 + .../SummaryWidgetTelemetryProviderSpec.js | 19 +- .../src/views/SummaryWidgetView.js | 12 +- .../test/ConditionEvaluatorSpec.js | 12 +- .../test/ConditionManagerSpec.js | 8 +- src/plugins/summaryWidget/test/RuleSpec.js | 10 +- .../summaryWidget/test/SummaryWidgetSpec.js | 1 + .../summaryWidget/test/TestDataManagerSpec.js | 25 +- .../test/input/IconPaletteSpec.js | 2 +- src/plugins/tabs/components/tabs.vue | 11 +- src/plugins/tabs/tabs.js | 3 +- .../src/MeanTelemetryProvider.js | 1 + .../src/MeanTelemetryProviderSpec.js | 329 ++++++++++++++---- .../telemetryMean/src/MockTelemetryApi.js | 1 + .../TableConfigurationViewProvider.js | 8 +- src/plugins/telemetryTable/TelemetryTable.js | 10 +- .../TelemetryTableConfiguration.js | 4 + .../telemetryTable/TelemetryTableRow.js | 13 +- .../TelemetryTableViewProvider.js | 10 +- .../collections/BoundedTableRowCollection.js | 17 +- .../collections/FilteredTableRowCollection.js | 8 +- .../collections/SortedTableRowCollection.js | 9 +- .../components/TelemetryFilterIndicator.vue | 9 +- .../telemetryTable/components/table-cell.vue | 3 +- .../components/table-column-header.vue | 9 +- .../components/table-configuration.vue | 4 +- .../telemetryTable/components/table-row.vue | 14 +- .../telemetryTable/components/table.vue | 32 +- src/plugins/telemetryTable/pluginSpec.js | 32 +- src/plugins/themes/installTheme.js | 2 +- src/plugins/timeConductor/Conductor.vue | 18 +- src/plugins/timeConductor/ConductorAxis.vue | 5 +- .../timeConductor/ConductorHistory.vue | 9 +- src/plugins/timeConductor/ConductorMode.vue | 17 +- .../timeConductor/ConductorTimeSystem.vue | 6 +- src/plugins/timeConductor/DatePicker.vue | 25 +- src/plugins/timeConductor/plugin.js | 15 +- .../timeConductor/utcMultiTimeFormat.js | 4 +- src/plugins/utcTimeSystem/LocalClock.js | 1 + src/plugins/webPage/WebPageViewProvider.js | 2 +- src/plugins/webPage/components/WebPage.vue | 4 +- src/selection/Selection.js | 11 +- src/ui/components/ObjectFrame.vue | 8 +- src/ui/components/ObjectLabel.vue | 5 +- src/ui/components/ObjectView.vue | 25 +- src/ui/components/ProgressBar.vue | 4 +- src/ui/components/ToggleSwitch.vue | 2 +- src/ui/components/contextMenuDropDown.vue | 4 +- src/ui/components/search.vue | 9 +- src/ui/components/viewControl.vue | 4 +- src/ui/inspector/Elements.vue | 14 +- src/ui/inspector/Inspector.vue | 18 +- src/ui/inspector/InspectorViews.vue | 5 +- src/ui/inspector/Location.vue | 12 +- src/ui/inspector/ObjectName.vue | 7 +- src/ui/inspector/Properties.vue | 12 +- src/ui/inspector/StylesInspectorView.vue | 5 +- src/ui/layout/AboutDialog.vue | 4 +- src/ui/layout/AppLogo.vue | 4 +- src/ui/layout/BrowseBar.vue | 20 +- src/ui/layout/CreateButton.vue | 10 +- src/ui/layout/Layout.vue | 18 +- src/ui/layout/MCTSearch.vue | 2 +- src/ui/layout/ViewSwitcher.vue | 4 +- src/ui/layout/mct-tree.vue | 10 +- src/ui/layout/multipane.vue | 2 +- src/ui/layout/pane.vue | 15 +- src/ui/layout/status-bar/Indicators.vue | 2 +- .../layout/status-bar/NotificationBanner.vue | 13 +- src/ui/layout/tree-item.vue | 9 +- src/ui/legacy/mct-template.vue | 2 +- src/ui/mixins/context-menu-gesture.js | 2 +- src/ui/mixins/object-link.js | 2 + src/ui/mixins/toggle-mixin.js | 6 +- src/ui/preview/Preview.vue | 4 +- src/ui/preview/PreviewAction.js | 8 +- src/ui/preview/preview-header.vue | 3 +- src/ui/registries/ViewRegistry.js | 2 +- src/ui/router/ApplicationRouter.js | 21 +- src/ui/router/Browse.js | 11 +- src/ui/toolbar/Toolbar.vue | 9 +- src/ui/toolbar/components/toolbar-button.vue | 3 +- .../toolbar/components/toolbar-checkbox.vue | 3 +- .../components/toolbar-color-picker.vue | 2 +- src/ui/toolbar/components/toolbar-input.vue | 3 +- src/ui/toolbar/components/toolbar-menu.vue | 8 +- .../components/toolbar-select-menu.vue | 10 +- .../toolbar/components/toolbar-separator.vue | 2 +- .../components/toolbar-toggle-button.vue | 1 + src/utils/openmctLocation.js | 4 +- src/utils/openmctLocationSpec.js | 2 +- src/utils/testing.js | 77 ++-- 739 files changed, 4660 insertions(+), 2339 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index fbd822507c..5d62513449 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -121,6 +121,59 @@ module.exports = { // https://eslint.org/docs/rules/rest-spread-spacing "rest-spread-spacing": ["error"], + // https://eslint.org/docs/rules/no-implicit-coercion + "no-implicit-coercion": "error", + //https://eslint.org/docs/rules/no-unneeded-ternary + "no-unneeded-ternary": "error", + // https://eslint.org/docs/rules/semi + "semi": ["error", "always"], + // https://eslint.org/docs/rules/no-multi-spaces + "no-multi-spaces": "error", + // https://eslint.org/docs/rules/key-spacing + "key-spacing": ["error", { + "afterColon": true + }], + // https://eslint.org/docs/rules/keyword-spacing + "keyword-spacing": ["error", { + "before": true, + "after": true + }], + // https://eslint.org/docs/rules/comma-spacing + // Also requires one line code fix + "comma-spacing": ["error", { + "after": true + }], + //https://eslint.org/docs/rules/no-whitespace-before-property + "no-whitespace-before-property": "error", + // https://eslint.org/docs/rules/object-curly-newline + "object-curly-newline": ["error", {"consistent": true, "multiline": true}], + // https://eslint.org/docs/rules/object-property-newline + "object-property-newline": "error", + // https://eslint.org/docs/rules/brace-style + "brace-style": "error", + // https://eslint.org/docs/rules/no-multiple-empty-lines + "no-multiple-empty-lines": ["error", {"max": 1}], + // https://eslint.org/docs/rules/operator-linebreak + "operator-linebreak": ["error", "before", {"overrides": {"=": "after"}}], + // https://eslint.org/docs/rules/padding-line-between-statements + "padding-line-between-statements":["error", { + "blankLine": "always", + "prev": "multiline-block-like", + "next": "*" + }, { + "blankLine": "always", + "prev": "*", + "next": "return" + }], + // https://eslint.org/docs/rules/space-infix-ops + "space-infix-ops": "error", + // https://eslint.org/docs/rules/space-unary-ops + "space-unary-ops": ["error", {"words": true, "nonwords": false}], + // https://eslint.org/docs/rules/arrow-spacing + "arrow-spacing": "error", + // https://eslint.org/docs/rules/semi-spacing + "semi-spacing": ["error", {"before": false, "after": true}], + "vue/html-indent": [ "error", 4, diff --git a/example/eventGenerator/bundle.js b/example/eventGenerator/bundle.js index f620b0559d..e11b1f7718 100644 --- a/example/eventGenerator/bundle.js +++ b/example/eventGenerator/bundle.js @@ -29,7 +29,7 @@ define([ "use strict"; return { - name:"example/eventGenerator", + name: "example/eventGenerator", definition: { "name": "Event Message Generator", "description": "For development use. Creates sample event message data that mimics a live data stream.", diff --git a/example/eventGenerator/src/EventTelemetry.js b/example/eventGenerator/src/EventTelemetry.js index 7c011cd2ef..f668c6c0e0 100644 --- a/example/eventGenerator/src/EventTelemetry.js +++ b/example/eventGenerator/src/EventTelemetry.js @@ -44,13 +44,14 @@ define( }; generatorData.getDomainValue = function (i, domain) { - return i * interval + - (domain !== 'delta' ? firstObservedTime : 0); + return i * interval + + (domain !== 'delta' ? firstObservedTime : 0); }; generatorData.getRangeValue = function (i, range) { var domainDelta = this.getDomainValue(i) - firstObservedTime, ind = i % messages.length; + return messages[ind] + " - [" + domainDelta.toString() + "]"; }; diff --git a/example/eventGenerator/src/EventTelemetryProvider.js b/example/eventGenerator/src/EventTelemetryProvider.js index 90a00a5881..424d35b1e1 100644 --- a/example/eventGenerator/src/EventTelemetryProvider.js +++ b/example/eventGenerator/src/EventTelemetryProvider.js @@ -57,6 +57,7 @@ define( results.forEach(function (result) { packaged[result.key] = result.telemetry; }); + // Format as expected (sources -> keys -> telemetry) return { eventGenerator: packaged }; } diff --git a/example/export/ExportTelemetryAsCSVAction.js b/example/export/ExportTelemetryAsCSVAction.js index abdfdecad7..b47f2a9337 100644 --- a/example/export/ExportTelemetryAsCSVAction.js +++ b/example/export/ExportTelemetryAsCSVAction.js @@ -76,13 +76,14 @@ define([], function () { copyRangesToRow(row, i); rows.push(row); } + exportService.exportCSV(rows, { headers: headers }); }); }; ExportTelemetryAsCSVAction.appliesTo = function (context) { - return context.domainObject && - context.domainObject.hasCapability("telemetry"); + return context.domainObject + && context.domainObject.hasCapability("telemetry"); }; return ExportTelemetryAsCSVAction; diff --git a/example/export/bundle.js b/example/export/bundle.js index 84acd71665..7f9e46b9ef 100644 --- a/example/export/bundle.js +++ b/example/export/bundle.js @@ -27,7 +27,7 @@ define([ "use strict"; return { - name:"example/export", + name: "example/export", definition: { "name": "Example of using CSV Export", "extensions": { diff --git a/example/forms/bundle.js b/example/forms/bundle.js index d705837135..c54568b55b 100644 --- a/example/forms/bundle.js +++ b/example/forms/bundle.js @@ -29,7 +29,7 @@ define([ "use strict"; return { - name:"example/forms", + name: "example/forms", definition: { "name": "Declarative Forms example", "sources": "src", diff --git a/example/forms/src/ExampleFormController.js b/example/forms/src/ExampleFormController.js index 1e0249bbad..726c8ae857 100644 --- a/example/forms/src/ExampleFormController.js +++ b/example/forms/src/ExampleFormController.js @@ -152,10 +152,22 @@ define( name: "Choose something", control: "select", options: [ - { name: "Hats", value: "hats" }, - { name: "Bats", value: "bats" }, - { name: "Cats", value: "cats" }, - { name: "Mats", value: "mats" } + { + name: "Hats", + value: "hats" + }, + { + name: "Bats", + value: "bats" + }, + { + name: "Cats", + value: "cats" + }, + { + name: "Mats", + value: "mats" + } ], key: "aChoice" }, @@ -164,10 +176,22 @@ define( control: "select", required: true, options: [ - { name: "Hats", value: "hats" }, - { name: "Bats", value: "bats" }, - { name: "Cats", value: "cats" }, - { name: "Mats", value: "mats" } + { + name: "Hats", + value: "hats" + }, + { + name: "Bats", + value: "bats" + }, + { + name: "Cats", + value: "cats" + }, + { + name: "Mats", + value: "mats" + } ], key: "aRequiredChoice" } diff --git a/example/generator/GeneratorMetadataProvider.js b/example/generator/GeneratorMetadataProvider.js index e3969600c3..fd85e7a5dc 100644 --- a/example/generator/GeneratorMetadataProvider.js +++ b/example/generator/GeneratorMetadataProvider.js @@ -108,7 +108,7 @@ define([ } ] } - } + }; function GeneratorMetadataProvider() { diff --git a/example/generator/GeneratorProvider.js b/example/generator/GeneratorProvider.js index 1de9d5bf60..eee51cd822 100644 --- a/example/generator/GeneratorProvider.js +++ b/example/generator/GeneratorProvider.js @@ -65,15 +65,19 @@ define([ if (domainObject.telemetry && domainObject.telemetry.hasOwnProperty(prop)) { workerRequest[prop] = domainObject.telemetry[prop]; } + if (request && request.hasOwnProperty(prop)) { workerRequest[prop] = request[prop]; } + if (!workerRequest.hasOwnProperty(prop)) { workerRequest[prop] = REQUEST_DEFAULTS[prop]; } + workerRequest[prop] = Number(workerRequest[prop]); }); workerRequest.name = domainObject.name; + return workerRequest; }; @@ -81,11 +85,13 @@ define([ var workerRequest = this.makeWorkerRequest(domainObject, request); workerRequest.start = request.start; workerRequest.end = request.end; + return this.workerInterface.request(workerRequest); }; GeneratorProvider.prototype.subscribe = function (domainObject, callback) { var workerRequest = this.makeWorkerRequest(domainObject, {}); + return this.workerInterface.subscribe(workerRequest, callback); }; diff --git a/example/generator/SinewaveLimitProvider.js b/example/generator/SinewaveLimitProvider.js index a7fbd2cb03..733cd816d4 100644 --- a/example/generator/SinewaveLimitProvider.js +++ b/example/generator/SinewaveLimitProvider.js @@ -78,12 +78,15 @@ define([ if (datum[range] > RED[range]) { return LIMITS.rh; } + if (datum[range] < -RED[range]) { return LIMITS.rl; } + if (datum[range] > YELLOW[range]) { return LIMITS.yh; } + if (datum[range] < -YELLOW[range]) { return LIMITS.yl; } diff --git a/example/generator/StateGeneratorProvider.js b/example/generator/StateGeneratorProvider.js index 09e6b7c79f..061119ea75 100644 --- a/example/generator/StateGeneratorProvider.js +++ b/example/generator/StateGeneratorProvider.js @@ -48,7 +48,7 @@ define([ var interval = setInterval(function () { var now = Date.now(); var datum = pointForTimestamp(now, duration, domainObject.name); - datum.value += ""; + datum.value = String(datum.value); callback(datum); }, duration); @@ -57,7 +57,6 @@ define([ }; }; - StateGeneratorProvider.prototype.supportsRequest = function (domainObject, options) { return domainObject.type === 'example.state-generator'; }; @@ -69,11 +68,13 @@ define([ if (options.strategy === 'latest' || options.size === 1) { start = end; } + var data = []; while (start <= end && data.length < 5000) { data.push(pointForTimestamp(start, duration, domainObject.name)); start += duration; } + return Promise.resolve(data); }; diff --git a/example/generator/WorkerInterface.js b/example/generator/WorkerInterface.js index a8af1dc7aa..b3d179cd7f 100644 --- a/example/generator/WorkerInterface.js +++ b/example/generator/WorkerInterface.js @@ -78,6 +78,7 @@ define([ } else { deferred.resolve(message.data); } + delete this.callbacks[messageId]; } @@ -101,8 +102,5 @@ define([ }.bind(this); }; - - - return WorkerInterface; }); diff --git a/example/generator/generatorWorker.js b/example/generator/generatorWorker.js index eda3cbc232..75936714e5 100644 --- a/example/generator/generatorWorker.js +++ b/example/generator/generatorWorker.js @@ -64,13 +64,14 @@ data: { name: data.name, utc: nextStep, - yesterday: nextStep - 60*60*24*1000, + yesterday: nextStep - 60 * 60 * 24 * 1000, sin: sin(nextStep, data.period, data.amplitude, data.offset, data.phase, data.randomness), cos: cos(nextStep, data.period, data.amplitude, data.offset, data.phase, data.randomness) } }); nextStep += step; } + return nextStep; } @@ -87,6 +88,7 @@ if (request.end === undefined) { request.end = Date.now(); } + if (request.start === undefined) { request.start = request.end - FIFTEEN_MINUTES; } @@ -110,11 +112,12 @@ data.push({ name: request.name, utc: nextStep, - yesterday: nextStep - 60*60*24*1000, + yesterday: nextStep - 60 * 60 * 24 * 1000, sin: sin(nextStep, period, amplitude, offset, phase, randomness), cos: cos(nextStep, period, amplitude, offset, phase, randomness) }); } + self.postMessage({ id: message.id, data: data @@ -122,13 +125,13 @@ } function cos(timestamp, period, amplitude, offset, phase, randomness) { - return amplitude * - Math.cos(phase + (timestamp / period / 1000 * Math.PI * 2)) + (amplitude * Math.random() * randomness) + offset; + return amplitude + * Math.cos(phase + (timestamp / period / 1000 * Math.PI * 2)) + (amplitude * Math.random() * randomness) + offset; } function sin(timestamp, period, amplitude, offset, phase, randomness) { - return amplitude * - Math.sin(phase + (timestamp / period / 1000 * Math.PI * 2)) + (amplitude * Math.random() * randomness) + offset; + return amplitude + * Math.sin(phase + (timestamp / period / 1000 * Math.PI * 2)) + (amplitude * Math.random() * randomness) + offset; } function sendError(error, message) { diff --git a/example/generator/plugin.js b/example/generator/plugin.js index a2b8f9c773..3813f0684c 100644 --- a/example/generator/plugin.js +++ b/example/generator/plugin.js @@ -56,7 +56,7 @@ define([ initialize: function (object) { object.telemetry = { duration: 5 - } + }; } }); diff --git a/example/identity/bundle.js b/example/identity/bundle.js index 44ed78d33f..fe24ab16e6 100644 --- a/example/identity/bundle.js +++ b/example/identity/bundle.js @@ -29,7 +29,7 @@ define([ "use strict"; return { - name:"example/identity", + name: "example/identity", definition: { "extensions": { "components": [ diff --git a/example/identity/src/ExampleIdentityService.js b/example/identity/src/ExampleIdentityService.js index 0d008e591b..4ce5a13d03 100644 --- a/example/identity/src/ExampleIdentityService.js +++ b/example/identity/src/ExampleIdentityService.js @@ -25,26 +25,30 @@ define( function () { "use strict"; - var DEFAULT_IDENTITY = { key: "user", name: "Example User" }, + var DEFAULT_IDENTITY = { + key: "user", + name: "Example User" + }, DIALOG_STRUCTURE = { name: "Identify Yourself", - sections: [{ rows: [ - { - name: "User ID", - control: "textfield", - key: "key", - required: true - }, - { - name: "Human name", - control: "textfield", - key: "name", - required: true - } - ]}] + sections: [{ + rows: [ + { + name: "User ID", + control: "textfield", + key: "key", + required: true + }, + { + name: "Human name", + control: "textfield", + key: "name", + required: true + } + ] + }] }; - /** * Example implementation of an identity service. This prompts the * user to enter a name and user ID; in a more realistic @@ -77,14 +81,14 @@ define( */ ExampleIdentityProvider.prototype.returnUser = function (user) { return this.user = user; - } + }; /** * @private */ ExampleIdentityProvider.prototype.returnUndefined = function () { return undefined; - } + }; return ExampleIdentityProvider; } diff --git a/example/imagery/plugin.js b/example/imagery/plugin.js index 63a351c985..35103b9e1d 100644 --- a/example/imagery/plugin.js +++ b/example/imagery/plugin.js @@ -85,28 +85,28 @@ define([ data.push(pointForTimestamp(start, domainObject.name)); start += 5000; } + return Promise.resolve(data); } }; var ladProvider = { supportsRequest: function (domainObject, options) { - return domainObject.type === 'example.imagery' && - options.strategy === 'latest'; + return domainObject.type === 'example.imagery' + && options.strategy === 'latest'; }, request: function (domainObject, options) { return Promise.resolve([pointForTimestamp(Date.now(), domainObject.name)]); } }; - return function install(openmct) { openmct.types.addType('example.imagery', { key: 'example.imagery', name: 'Example Imagery', cssClass: 'icon-image', - description: 'For development use. Creates example imagery ' + - 'data that mimics a live imagery stream.', + description: 'For development use. Creates example imagery ' + + 'data that mimics a live imagery stream.', creatable: true, initialize: function (object) { object.telemetry = { @@ -140,7 +140,7 @@ define([ } } ] - } + }; } }); diff --git a/example/mobile/bundle.js b/example/mobile/bundle.js index 8b5dd04988..abb378a68d 100644 --- a/example/mobile/bundle.js +++ b/example/mobile/bundle.js @@ -25,7 +25,7 @@ define([], function () { "use strict"; return { - name:"example/mobile", + name: "example/mobile", definition: { "name": "Mobile", "description": "Allows elements with pertinence to mobile usage and development", diff --git a/example/msl/bundle.js b/example/msl/bundle.js index 23a8f46d0b..d7902d09fa 100644 --- a/example/msl/bundle.js +++ b/example/msl/bundle.js @@ -31,14 +31,15 @@ define([ RemsTelemetryProvider ) { "use strict"; + return { - name:"example/msl", + name: "example/msl", definition: { - "name" : "Mars Science Laboratory Data Adapter", - "extensions" : { + "name": "Mars Science Laboratory Data Adapter", + "extensions": { "types": [ { - "name":"Mars Science Laboratory", + "name": "Mars Science Laboratory", "key": "msl.curiosity", "cssClass": "icon-object" }, @@ -89,7 +90,7 @@ define([ ], "services": [ { - "key":"rems.adapter", + "key": "rems.adapter", "implementation": RemsTelemetryServerAdapter, "depends": ["$http", "$log", "REMS_WS_URL"] } diff --git a/example/msl/src/MSLDataDictionary.js b/example/msl/src/MSLDataDictionary.js index f114dae36e..4cdb9b1450 100644 --- a/example/msl/src/MSLDataDictionary.js +++ b/example/msl/src/MSLDataDictionary.js @@ -38,7 +38,7 @@ define( "identifier": "msl", "instruments": [ { - "name":"rems", + "name": "rems", "identifier": "rems", "measurements": [ { diff --git a/example/msl/src/RemsTelemetryModelProvider.js b/example/msl/src/RemsTelemetryModelProvider.js index fdaaf8b52d..a64e555bad 100644 --- a/example/msl/src/RemsTelemetryModelProvider.js +++ b/example/msl/src/RemsTelemetryModelProvider.js @@ -81,6 +81,7 @@ define( (dictionary.instruments || []).forEach(function (instrument) { addInstrument(instrument, "msl:curiosity"); }); + return models; } @@ -90,6 +91,7 @@ define( } }; } + return RemsTelemetryModelProvider; } ); diff --git a/example/msl/src/RemsTelemetryProvider.js b/example/msl/src/RemsTelemetryProvider.js index bc13bf8803..9076ceaa70 100644 --- a/example/msl/src/RemsTelemetryProvider.js +++ b/example/msl/src/RemsTelemetryProvider.js @@ -74,6 +74,7 @@ define ( RemsTelemetryProvider.prototype.subscribe = function (callback, requests) { return function () {}; }; + RemsTelemetryProvider.prototype.unsubscribe = function (callback, requests) { return function () {}; }; diff --git a/example/msl/src/RemsTelemetrySeries.js b/example/msl/src/RemsTelemetrySeries.js index 5dcd47e3c9..d0dbf30c62 100644 --- a/example/msl/src/RemsTelemetrySeries.js +++ b/example/msl/src/RemsTelemetrySeries.js @@ -57,6 +57,7 @@ define( RemsTelemetrySeries.prototype.getPointCount = function () { return this.data.length; }; + /** * The domain value at the given index. The Rems telemetry data is * time ordered, so the domain value is the time stamp of each data diff --git a/example/msl/src/RemsTelemetryServerAdapter.js b/example/msl/src/RemsTelemetryServerAdapter.js index dce3669da7..9ff5fb08ef 100644 --- a/example/msl/src/RemsTelemetryServerAdapter.js +++ b/example/msl/src/RemsTelemetryServerAdapter.js @@ -95,28 +95,32 @@ define( }); } }); + return data; } function fallbackToLocal() { - self.$log.warn("Loading REMS data failed, probably due to" + - " cross origin policy. Falling back to local data"); + self.$log.warn("Loading REMS data failed, probably due to" + + " cross origin policy. Falling back to local data"); + return self.$http.get(self.localDataURI); } //Filter results to match request parameters function filterResults(results) { return results.filter(function (result) { - return result.date >= (request.start || Number.MIN_VALUE) && - result.date <= (request.end || Number.MAX_VALUE); + return result.date >= (request.start || Number.MIN_VALUE) + && result.date <= (request.end || Number.MAX_VALUE); }); } function packageAndResolve(results) { - return {id: id, values: results}; + return { + id: id, + values: results + }; } - return (this.promise = this.promise || this.$http.get(this.REMS_WS_URL)) .catch(fallbackToLocal) .then(processResponse) diff --git a/example/notifications/bundle.js b/example/notifications/bundle.js index ed9ef1b620..ca8df25686 100644 --- a/example/notifications/bundle.js +++ b/example/notifications/bundle.js @@ -39,7 +39,7 @@ define([ "use strict"; return { - name:"example/notifications", + name: "example/notifications", definition: { "extensions": { "templates": [ diff --git a/example/notifications/src/DialogLaunchController.js b/example/notifications/src/DialogLaunchController.js index 674f9a12ce..b705ed01ec 100644 --- a/example/notifications/src/DialogLaunchController.js +++ b/example/notifications/src/DialogLaunchController.js @@ -91,7 +91,6 @@ define( } }; - /* Demonstrates launching an error dialog */ @@ -132,9 +131,9 @@ define( var dialog, model = { title: "Info Dialog Example", - actionText: "This is an example of a blocking info" + - " dialog. This dialog can be used to draw the user's" + - " attention to an event.", + actionText: "This is an example of a blocking info" + + " dialog. This dialog can be used to draw the user's" + + " attention to an event.", severity: "info", primaryOption: { label: "OK", @@ -153,6 +152,7 @@ define( }; } + return DialogLaunchController; } ); diff --git a/example/notifications/src/DialogLaunchIndicator.js b/example/notifications/src/DialogLaunchIndicator.js index 8677b664fc..1549a48f19 100644 --- a/example/notifications/src/DialogLaunchIndicator.js +++ b/example/notifications/src/DialogLaunchIndicator.js @@ -42,9 +42,11 @@ define( DialogLaunchIndicator.prototype.getGlyphClass = function () { return 'ok'; }; + DialogLaunchIndicator.prototype.getText = function () { return "Launch test dialog"; }; + DialogLaunchIndicator.prototype.getDescription = function () { return "Launch test dialog"; }; diff --git a/example/notifications/src/NotificationLaunchController.js b/example/notifications/src/NotificationLaunchController.js index ae07f3fa62..b8d9b77f14 100644 --- a/example/notifications/src/NotificationLaunchController.js +++ b/example/notifications/src/NotificationLaunchController.js @@ -48,7 +48,8 @@ define( "Eros turpis, pulvinar turpis eros eu", "Lundium nascetur a, lectus montes ac, parturient in natoque, duis risus risus pulvinar pid rhoncus, habitasse auctor natoque!" ]; - return actionTexts[Math.floor(Math.random()*3)]; + + return actionTexts[Math.floor(Math.random() * 3)]; } /** @@ -61,6 +62,7 @@ define( severity: "error" }); }; + /** * Launch a new notification with a severity of 'Alert'. */ @@ -73,7 +75,6 @@ define( }); }; - /** * Launch a new notification with a progress bar that is updated * periodically, tracking an ongoing process. @@ -93,10 +94,10 @@ define( * @param notification */ function incrementProgress() { - progress = Math.min(100, Math.floor(progress + Math.random() * 30)) - let progressText = ["Estimated time" + - " remaining:" + - " about ", 60 - Math.floor((progress / 100) * 60), " seconds"].join(" "); + progress = Math.min(100, Math.floor(progress + Math.random() * 30)); + let progressText = ["Estimated time" + + " remaining:" + + " about ", 60 - Math.floor((progress / 100) * 60), " seconds"].join(" "); notification.progress(progress, progressText); if (progress < 100) { @@ -120,6 +121,7 @@ define( }; } + return NotificationLaunchController; } ); diff --git a/example/notifications/src/NotificationLaunchIndicator.js b/example/notifications/src/NotificationLaunchIndicator.js index 092353b491..5a530cdf26 100644 --- a/example/notifications/src/NotificationLaunchIndicator.js +++ b/example/notifications/src/NotificationLaunchIndicator.js @@ -42,9 +42,11 @@ define( NotificationLaunchIndicator.prototype.getGlyphClass = function () { return 'ok'; }; + NotificationLaunchIndicator.prototype.getText = function () { return "Launch notification"; }; + NotificationLaunchIndicator.prototype.getDescription = function () { return "Launch notification"; }; diff --git a/example/persistence/bundle.js b/example/persistence/bundle.js index 41bcd58f7c..726fde3f7e 100644 --- a/example/persistence/bundle.js +++ b/example/persistence/bundle.js @@ -29,7 +29,7 @@ define([ "use strict"; return { - name:"example/persistence", + name: "example/persistence", definition: { "extensions": { "components": [ diff --git a/example/persistence/src/BrowserPersistenceProvider.js b/example/persistence/src/BrowserPersistenceProvider.js index d850036067..6466228d4f 100644 --- a/example/persistence/src/BrowserPersistenceProvider.js +++ b/example/persistence/src/BrowserPersistenceProvider.js @@ -30,8 +30,6 @@ define( function () { 'use strict'; - - function BrowserPersistenceProvider($q, SPACE) { var spaces = SPACE ? [SPACE] : [], caches = {}, @@ -51,6 +49,7 @@ define( }, listObjects: function (space) { var cache = caches[space]; + return promises.as( cache ? Object.keys(cache) : null ); @@ -68,6 +67,7 @@ define( }, readObject: function (space, key) { var cache = caches[space]; + return promises.as( cache ? cache[key] : null ); diff --git a/example/policy/bundle.js b/example/policy/bundle.js index 79e4609f65..003a8cd945 100644 --- a/example/policy/bundle.js +++ b/example/policy/bundle.js @@ -29,7 +29,7 @@ define([ "use strict"; return { - name:"example/policy", + name: "example/policy", definition: { "name": "Example Policy", "description": "Provides an example of using policies to prohibit actions.", diff --git a/example/policy/src/ExamplePolicy.js b/example/policy/src/ExamplePolicy.js index aed9177d01..1987fa772d 100644 --- a/example/policy/src/ExamplePolicy.js +++ b/example/policy/src/ExamplePolicy.js @@ -37,6 +37,7 @@ define( model = (domainObject && domainObject.getModel()) || {}, name = model.name || "", metadata = action.getMetadata() || {}; + return metadata.key !== 'remove' || name.indexOf('foo') < 0; } }; diff --git a/example/profiling/bundle.js b/example/profiling/bundle.js index 46c265e65e..d1eafdfba9 100644 --- a/example/profiling/bundle.js +++ b/example/profiling/bundle.js @@ -31,7 +31,7 @@ define([ "use strict"; return { - name:"example/profiling", + name: "example/profiling", definition: { "extensions": { "indicators": [ diff --git a/example/scratchpad/bundle.js b/example/scratchpad/bundle.js index 7aa4727087..327d9720ce 100644 --- a/example/scratchpad/bundle.js +++ b/example/scratchpad/bundle.js @@ -29,7 +29,7 @@ define([ "use strict"; return { - name:"example/scratchpad", + name: "example/scratchpad", definition: { "extensions": { "roots": [ diff --git a/example/scratchpad/src/ScratchPersistenceProvider.js b/example/scratchpad/src/ScratchPersistenceProvider.js index 17826f4169..4384962d48 100644 --- a/example/scratchpad/src/ScratchPersistenceProvider.js +++ b/example/scratchpad/src/ScratchPersistenceProvider.js @@ -54,13 +54,14 @@ define( if (space === 'scratch') { this.table[key] = JSON.stringify(value); } + return this.$q.when(space === 'scratch'); }; ScratchPersistenceProvider.prototype.readObject = function (space, key) { return this.$q.when( - (space === 'scratch' && this.table[key]) ? - JSON.parse(this.table[key]) : undefined + (space === 'scratch' && this.table[key]) + ? JSON.parse(this.table[key]) : undefined ); }; @@ -68,6 +69,7 @@ define( if (space === 'scratch') { delete this.table[key]; } + return this.$q.when(space === 'scratch'); }; diff --git a/example/simpleVuePlugin/HelloWorld.vue b/example/simpleVuePlugin/HelloWorld.vue index 8737ec727a..305d31183d 100644 --- a/example/simpleVuePlugin/HelloWorld.vue +++ b/example/simpleVuePlugin/HelloWorld.vue @@ -7,9 +7,9 @@ export default { data() { return { msg: 'Hello world!' - } + }; } -} +};