Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

Commit

Permalink
preview help
Browse files Browse the repository at this point in the history
  • Loading branch information
suvigyavijay committed Jul 19, 2017
1 parent 6c87244 commit 4e80837
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/app/components/customWidget/customWidget.service.js
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* @name CustomWidgetService
* @name CustomWidgetServices
* @desc
*/
function CustomWidgetService($uibModal) {
Expand Down Expand Up @@ -56,14 +56,17 @@
angular.extend(modalOptions, defaultModalOptions, customModalOptions);

modal.controller = ['$scope','$uibModalInstance', 'widgetOptions', function ($scope, $uibModalInstance, widgetOptions) {
$scope.selected = '';
$scope.selected = {
name: '',
'text-oneline':''
};
$scope.widgetOptions = {};
angular.extend($scope.widgetOptions, widgetOptions);
$scope.modalOptions = modalOptions;
$scope.modalOptions.ok = function (result) {
widgetOptions.name = $scope.selected;
widgetOptions.title = $scope.selected;
widgetOptions.dataModelOptions.name = $scope.selected;
widgetOptions.name = $scope.selected.name;
widgetOptions.title = $scope.selected.name;
widgetOptions.dataModelOptions.name = $scope.selected.name;
$uibModalInstance.close(result);
};
$scope.modalOptions.close = function () {
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/customWidget/customWidgetModal.html
@@ -1,7 +1,7 @@

<div class="modal-header">
<!-- <button type="button" class="close" data-dismiss="modal">&times;</button>-->
<h4 class="modal-title">Add Custom Widget {{selected}}</h4>
<h4 class="modal-title">Add Custom Widget</h4>
</div>
<div class="modal-body">
<!-- Add ng-model, ng-show, ng-disabled, ng-class, ng-change and delay accordingly -->
Expand All @@ -16,8 +16,9 @@ <h4 class="modal-title">Add Custom Widget {{selected}}</h4>
<span class="input-group-addon">Select Metric</span>
<!-- ng-repeat to be added to generate metric list and typeahead to be included -->
<!-- <select class="form-control" name="metricName" ng-options="metricMetadata.name for metricMetadata in metricsMetadata track by metricMetadata.name" ng-model="selected" required></select>-->
<input type="text" name="metricName" class="form-control" uib-typeahead="metricMetadata.name for metricMetadata in metricsMetadata | filter:$viewValue | limitTo:8" autocomplete="off" ng-model="selected" required>
<input type="text" name="metricName" class="form-control" uib-typeahead="metricMetadata as metricMetadata.name for metricMetadata in metricsMetadata | filter:{name:$viewValue} | limitTo:8" autocomplete="off" ng-model="selected" required>
</div>
<div class="input-group input-group-lg target"><h4>{{ selected['text-oneline'] }}</h4></div>
<div class="input-group input-group-lg target">
<span class="input-group-addon">Type</span>
<select id="metricList" ng-model="widgetOptions.dataModelType" class="form-control" required>
Expand Down
2 changes: 1 addition & 1 deletion src/app/main/main.controller.js
Expand Up @@ -221,7 +221,7 @@
};

CustomWidgetService.showCustomWidgetModal(customWidgetModal, {}).then(function() {
// console.log('customwidgetoptions', vm.customWidgetOptions);
console.log('customwidgetoptions', vm.customWidgetOptions);
widgetDefinitions.push(vm.customWidgetOptions);
// console.log('widgetdefs', widgetDefinitions);
widgetsToLoad.push(vm.customWidgetOptions);
Expand Down

0 comments on commit 4e80837

Please sign in to comment.