Skip to content

Commit

Permalink
Merge pull request ngageoint#851 in WV/opensphere from ~JENKINS/opens…
Browse files Browse the repository at this point in the history
…phere:upscanMerge to master

* commit '851fbf4086b98b0139abebf0b3ad358f70d11766':
  ci: remove release debug check [skip ci]
  docs(wmts): Trivial cleanup on WMTS apidoc.
  fix(annotations): Fix UI issues with indentation and proper disabling
  fix(annotations): Limit scope of "show background" option
  feat(annotations): Add label-like abilities to annotations
  • Loading branch information
wisestmumbler committed Aug 1, 2019
2 parents 26cfe95 + 851fbf4 commit 183e7d6
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 32 deletions.
1 change: 1 addition & 0 deletions externs/os.externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ osx.annotation;
* @typedef {{
* editable: boolean,
* show: boolean,
* showBackground: boolean,
* showName: boolean,
* showDescription: boolean,
* showTail: string,
Expand Down
9 changes: 9 additions & 0 deletions scss/os/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ $u-parent-resizer-count: 0;
border-color: transparent;
}

// For a border that appears when the element is hovered
.u-border-show-on-hover {
border-color: transparent;
}

.u-border-show-on-hover:hover {
border-color: $border-color;
}

// Used for buttons that are styled as form-controls borders
.u-border-color-input {
border-color: $input-border-color !important;
Expand Down
30 changes: 17 additions & 13 deletions src/os/annotation/abstractannotationctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,28 @@ os.annotation.UI_TEMPLATE =
'<svg class="c-annotation__svg">' +
'<path ng-style="{ \'fill\': ctrl.options.showDescription ? ctrl.options.bodyBG : ctrl.options.headerBG, ' +
'\'stroke\': ctrl.options.showDescription ? ctrl.options.bodyBG : ctrl.options.headerBG, ' +
'\'stroke-width\': ctrl.options.showTail == \'line\' ? \'3px\' : \'0px\'}" />' +
'\'stroke-width\': ctrl.options.showTail == \'line\' ? \'3px\' : \'0px\' }" />' +
'</svg>' +
'<div class="u-card-popup position-absolute text-right animate-fade u-hover-show"' +
'<div class="u-card-popup position-absolute text-right animate-fade u-hover-show" ' +
' ng-show="ctrl.options.editable">' +
'<button class="btn btn-sm btn-outline-primary border-0 bg-transparent"' +
'title="Hide text box"' +
'<button class="btn btn-sm btn-outline-primary border-0 bg-transparent" ' +
'title="Hide text box" ' +
'ng-click="ctrl.hideAnnotation()">' +
'<i class="c-glyph fa fa-fw fa-eye-slash"></i>' +
'</button>' +
'<button class="btn btn-sm btn-outline-primary border-0 bg-transparent"' +
'title="Edit text box"' +
'<button class="btn btn-sm btn-outline-primary border-0 bg-transparent" ' +
'title="Edit text box" ' +
'ng-click="ctrl.launchEditWindow()">' +
'<i class="c-glyph fa fa-fw fa-pencil"></i>' +
'</button>' +
'</div>' +
'<div class="js-annotation c-window card h-100">' +
'<div class="card-header flex-shrink-0 text-truncate px-1 py-0 js-annotation__header" title="{{ctrl.name}}"' +
'<div class="js-annotation c-window card h-100" ' +
'ng-class="{ \'bg-transparent u-border-show-on-hover u-text-stroke\': !ctrl.options.showBackground }">' +
'<div class="flex-shrink-0 text-truncate px-1 py-0 js-annotation__header" title="{{ctrl.name}}" ' +
'ng-show="ctrl.options.showName" ' +
'ng-class="!ctrl.options.showDescription && \'h-100 border-0\'" ' +
'ng-style="{background: ctrl.options.headerBG }" ' +
'ng-class="{ \'h-100 border-0\': !ctrl.options.showDescription, ' +
'\'card-header\': ctrl.options.showBackground }" ' +
'ng-style="{ background: ctrl.options.showBackground ? ctrl.options.headerBG : transparent }" ' +
'ng-dblclick="ctrl.editName()">' +
'<div ng-show="!ctrl.editingName">{{ctrl.name}}</div>' +
'<div class="form-row p-1" ng-if="ctrl.editingName">' +
Expand All @@ -62,7 +64,7 @@ os.annotation.UI_TEMPLATE =
'</div>' +
'<div class="card-body p-1 u-overflow-y-auto d-flex flex-fill flex-column" ' +
'ng-show="ctrl.options.showDescription" ' +
'ng-style="{background: ctrl.options.bodyBG }" ' +
'ng-style="{ background: ctrl.options.showBackground ? ctrl.options.bodyBG : transparent }" ' +
'ng-dblclick="ctrl.editDescription()">' +
'<tuieditor text="ctrl.description" edit="ctrl.editingDescription" is-required="false" maxlength="4000">' +
'</tuieditor>' +
Expand All @@ -75,7 +77,8 @@ os.annotation.UI_TEMPLATE =
'</button>' +
'</div>' +
'</div>' +
'</div>';
'</div>' +
'</div>';


/**
Expand Down Expand Up @@ -270,7 +273,8 @@ os.annotation.AbstractAnnotationCtrl.prototype.initDragResize = function() {
'handles': 'se',
'start': this.onDragStart_.bind(this),
'resize': this.updateTail.bind(this),
'stop': this.onDragStop_.bind(this)
'stop': this.onDragStop_.bind(this),
'autoHide': true
});
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/os/annotation/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ goog.provide('os.annotation.TailType');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.Point');
goog.require('os.annotation.TailStyle');
goog.require('os.feature');
goog.require('os.ui');
goog.require('os.ui.color.colorPickerDirective');

Expand All @@ -26,6 +27,7 @@ os.annotation.TailType = {
os.annotation.DEFAULT_OPTIONS = {
editable: true,
show: true,
showBackground: true,
showName: true,
showDescription: true,
showTail: os.annotation.TailStyle.DEFAULT,
Expand Down
3 changes: 3 additions & 0 deletions src/plugin/file/kml/ui/kmlnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ plugin.file.kml.ui.KMLNode.prototype.loadAnnotation = function() {
var annotationOptions = /** @type {osx.annotation.Options|undefined} */ (
this.feature_.get(os.annotation.OPTIONS_FIELD));
if (annotationOptions && annotationOptions.show) {
if (annotationOptions['showBackground'] === undefined) {
annotationOptions['showBackground'] = os.annotation.DEFAULT_OPTIONS['showBackground'];
}
this.annotation_ = new os.annotation.FeatureAnnotation(this.feature_);

// set initial visibility based on the tree/animation state
Expand Down
8 changes: 4 additions & 4 deletions src/plugin/wmts/wmtsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ plugin.wmts.Server.prototype.load = function(opt_ping) {


/**
* Builds query data from the WMS params.
* Builds query data from the WMTS params.
*
* @return {goog.Uri.QueryData}
* @private
Expand All @@ -264,7 +264,7 @@ plugin.wmts.Server.prototype.getQueryData_ = function() {


/**
* Loads WMS GetCapabilities from the configured server.
* Loads WMTS GetCapabilities from the configured server.
*
* @protected
*/
Expand All @@ -280,9 +280,9 @@ plugin.wmts.Server.prototype.loadCapabilities = function() {


/**
* Test a WMS URL to check if its GetCapabilities is valid.
* Test a WMTS URL to check if its GetCapabilities is valid.
*
* @param {string} url The WMS URL
* @param {string} url The WMTS URL
* @param {function(goog.events.Event)=} opt_success The success handler
* @param {function(goog.events.Event)=} opt_error The error handler
* @protected
Expand Down
5 changes: 0 additions & 5 deletions tasks/ci-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -e

# temp debug so that release dry-runs do not takae so long
if $RELEASE; then
exit 0
fi

yarn run build
yarn run test
#
Expand Down
35 changes: 25 additions & 10 deletions views/annotation/annotationoptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
</label>
</div>
</div>
<div class="col">
<div class="custom-control custom-checkbox d-inline-block"
title="Show background colors behind the annotation text">
<input type="checkbox" class="custom-control-input" name="showBackground"
ng-attr-id="showBackground{{ctrl.uid}}"
ng-change="ctrl.updateAnnotation()"
ng-model="ctrl.annotationOptions.showBackground"
ng-disabled="!ctrl.annotationOptions.show" />
<label class="custom-control-label" ng-attr-for="showBackground{{ctrl.uid}}">
Show Background
</label>
</div>
</div>
</div>
<div class="form-row align-items-center">
<div class="col">
Expand All @@ -39,9 +52,9 @@
color="ctrl.tempHeaderBG"
show-reset="true"
title="Sets the background color for header"
disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showName"></colorpicker>
disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showName || !ctrl.annotationOptions.showBackground"></colorpicker>
<label class="col-form-label" for="headerColor{{ctrl.uid}}">
Header Background
Header Color
</label>
</div>
</div>
Expand All @@ -67,8 +80,10 @@
color="ctrl.tempBodyBG"
show-reset="true"
title="Sets the background color for body"
disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showDescription"></colorpicker>
<label class="col-form-label" for="bodyColor{{ctrl.uid}}">Description Background</label>
disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showDescription || !ctrl.annotationOptions.showBackground"></colorpicker>
<label class="col-form-label" for="bodyColor{{ctrl.uid}}">
Description Color
</label>
</div>
</div>
</div>
Expand All @@ -77,20 +92,20 @@
<label class="col-form-label mr-2">Tail Style</label>
<div class="custom-control custom-checkbox d-inline-block">
<input ng-checked="true" type="radio" id="showAnnotationDefaultTail{{ctrl.uid}}" class="form-check-input" name="showAnnotationTail{{ctrl.uid}}"
ng-change="ctrl.updateAnnotation()" value="default" ng-model="ctrl.annotationOptions.showTail" ng-disabled="!ctrl.annotationOptions.show"
ng-change="ctrl.updateAnnotation()" value="default" ng-model="ctrl.annotationOptions.showTail" ng-disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showBackground"
/>
<label class="form-check-label" for="showAnnotationDefaultTail{{ctrl.uid}}" ng-disabled="disabled">Default</label>
<label class="form-check-label" for="showAnnotationDefaultTail{{ctrl.uid}}">Default</label>
</div>
<div class="custom-control custom-checkbox d-inline-block">
<input type="radio" id="showAnnotationLineTail{{ctrl.uid}}" class="form-check-input" name="showAnnotationTail{{ctrl.uid}}" value="line"
ng-change="ctrl.updateAnnotation()" ng-model="ctrl.annotationOptions.showTail" ng-disabled="!ctrl.annotationOptions.show"
ng-change="ctrl.updateAnnotation()" ng-model="ctrl.annotationOptions.showTail" ng-disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showBackground"
/>
<label class="form-check-label" for="showAnnotationLineTail{{ctrl.uid}}" ng-disabled="disabled">Line</label>
<label class="form-check-label" for="showAnnotationLineTail{{ctrl.uid}}">Line</label>
</div>
<div class="custom-control custom-checkbox d-inline-block">
<input type="radio" id="showAnnotationNoTail{{ctrl.uid}}" class="form-check-input" name="showAnnotationTail{{ctrl.uid}}" ng-change="ctrl.updateAnnotation()"
value="none" ng-model="ctrl.annotationOptions.showTail" ng-disabled="!ctrl.annotationOptions.show" />
<label class="form-check-label" for="showAnnotationNoTail{{ctrl.uid}}" ng-disabled="disabled">None</label>
value="none" ng-model="ctrl.annotationOptions.showTail" ng-disabled="!ctrl.annotationOptions.show || !ctrl.annotationOptions.showBackground" />
<label class="form-check-label" for="showAnnotationNoTail{{ctrl.uid}}">None</label>
</div>
</div>
</div>
Expand Down

0 comments on commit 183e7d6

Please sign in to comment.