Skip to content

Commit 1f73aa7

Browse files
committed
DHFPROD-1422 UX updates to mapping source
- Add “URI:” label to source URI - Add tooltip to URI label describing source URI - Update tooltip for URI and only show it when truncated - Update save button label to read “SAVE MAPPING” - Expose help icon for Source heading, link to source info
1 parent 1c930c6 commit 1f73aa7

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

quick-start/src/main/ui/app/mappings/map.component.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ <h1>
2121
</div>
2222

2323
<div id="save-map">
24-
<mdl-button *ngIf="mapChanged()" mdl-button-type="raised" mdl-colored="primary" mdl-ripple ng-class="btn-save-map" (click)="saveMap()">Save Map</mdl-button>
25-
<mdl-button *ngIf="!mapChanged()" mdl-button-type="raised" mdl-colored="primary" mdl-ripple ng-class="btn-save-map" disabled>Save Map</mdl-button>
24+
<mdl-button *ngIf="mapChanged()" mdl-button-type="raised" mdl-colored="primary" mdl-ripple ng-class="btn-save-map" (click)="saveMap()">Save Mapping</mdl-button>
25+
<mdl-button *ngIf="!mapChanged()" mdl-button-type="raised" mdl-colored="primary" mdl-ripple ng-class="btn-save-map" disabled>Save Mapping</mdl-button>
2626
<mdl-button *ngIf="mapChanged()" mdl-button-type="raised" mdl-colored mdl-ripple ng-class="btn-cancel-map" (click)="resetMap()">Reset</mdl-button>
2727
<mdl-button *ngIf="!mapChanged()" mdl-button-type="raised" mdl-colored mdl-ripple ng-class="btn-cancel-map" disabled>Reset</mdl-button>
2828
</div>
@@ -33,16 +33,17 @@ <h1>
3333
<div id="src-heading" #srcheading>
3434
<div class="item-title">
3535
<div class="item-type">Source</div>
36-
<!-- TODO help icon for when docs are avail -->
37-
<!-- <span class="help-icon">
38-
<i class="fa fa-question-circle fa-lg"></i>
39-
</span> -->
36+
<span class="help-icon">
37+
<a href="https://marklogic.github.io/marklogic-data-hub/harmonize/mapping/#changing-the-mapping-source-document" target="_blank"><i class="fa fa-question-circle fa-lg"></i></a>
38+
</span>
4039
</div>
4140
<p *ngIf="!editingURI" class="item-identifying-info">
42-
<span (click)="editingURI=true" ng-class="sample-doc-uri" class="sample-doc-uri" title="{{ sampleDocURI }}">{{ getLastChars(sampleDocURI, 40, '...') }}</span>
41+
<span class="uri-label" tooltip="The URI of the source document from which QuickStart generates the list of source property names." container="body">URI:</span>
42+
<span (click)="editingURI=true" ng-class="sample-doc-uri" class="sample-doc-uri" tooltip="{{ getURITooltip(sampleDocURI, 45) }}" container="body">{{ getLastChars(sampleDocURI, 45, '...') }}</span>
4343
<span class="fa fa-pencil edit-item" (click)="editingURI=true"></span>
4444
</p>
4545
<p *ngIf="editingURI" class="edit-uri">
46+
<span class="uri-label" tooltip="The URI of the source document from which QuickStart generates the list of source property names." container="body">URI:</span>
4647
<input type="text" class="edit-uri-val" [(ngModel)]="editURIVal" (keypress)="keyPressURI($event)" />
4748
<span class="edit-save" (click)="updateSampleDoc();"><i class="fa fa-check"></i></span>
4849
<span class="edit-cancel" (click)="cancelEditURI()"><i class="fa fa-remove"></i></span>

quick-start/src/main/ui/app/mappings/map.component.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
font-weight: normal;
1313
margin: 10px 0;
1414
padding: 0;
15-
width: 685px;
15+
width: 651px;
1616
position: relative;
1717
float: left;
1818
}
@@ -258,6 +258,12 @@ p.edit-uri {
258258
margin: 0 0 6px 2px;
259259
}
260260

261+
span.uri-label {
262+
font-weight: bold;
263+
margin: 0 4px 0 0;
264+
font-size: 15px;
265+
}
266+
261267
.edit-desc {
262268
font-size: 16px;
263269
padding-left: 0;
@@ -267,7 +273,7 @@ p.edit-uri {
267273
}
268274

269275
.edit-uri-val, .edit-desc-val {
270-
width: 411px;
276+
width: 376px;
271277
padding: 3px 1px;
272278
height: 28px;
273279
}
@@ -296,5 +302,5 @@ p.edit-uri {
296302

297303
/* Widen tooltip container for long phrases */
298304
/deep/ .tooltip .tooltip-inner {
299-
max-width: 250px;
305+
max-width: 350px;
300306
}

quick-start/src/main/ui/app/mappings/map.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,20 @@ export class MapComponent implements OnInit {
416416
return result;
417417
}
418418

419+
/**
420+
* Return string if sufficiently long, otherwise empty string
421+
* @param str String to return
422+
* @param num Character threshold
423+
* @returns {any} string
424+
*/
425+
getURITooltip(str, num) {
426+
let result = '';
427+
if (typeof str === 'string' && str.length > num) {
428+
result = str;
429+
}
430+
return result;
431+
}
432+
419433
/**
420434
* Does entity property have an element range index set?
421435
* @param name Name of property

0 commit comments

Comments
 (0)