diff --git a/src/app/workspace/resource/properties/properties.component.html b/src/app/workspace/resource/properties/properties.component.html index b296a54708..8b2f696331 100644 --- a/src/app/workspace/resource/properties/properties.component.html +++ b/src/app/workspace/resource/properties/properties.component.html @@ -89,15 +89,20 @@

-
+

- - Comment* - - - - Label* +
+ + Label * - - Color* - - + + Comment * + + + + Color * + + - + - -
+ +
diff --git a/src/app/workspace/resource/representation/add-region-form/add-region-form.component.scss b/src/app/workspace/resource/representation/add-region-form/add-region-form.component.scss index e69de29bb2..93c8c4a397 100644 --- a/src/app/workspace/resource/representation/add-region-form/add-region-form.component.scss +++ b/src/app/workspace/resource/representation/add-region-form/add-region-form.component.scss @@ -0,0 +1,11 @@ +.hidden { + display: none; +} + +.form-content { + margin: 0; + + .form-panel { + margin-top: 16px; + } +} diff --git a/src/app/workspace/resource/representation/file-representation.ts b/src/app/workspace/resource/representation/file-representation.ts index d1b7c9f804..89c2461abf 100644 --- a/src/app/workspace/resource/representation/file-representation.ts +++ b/src/app/workspace/resource/representation/file-representation.ts @@ -32,4 +32,6 @@ export class RepresentationConstants { static movingImage = Constants.MovingImageFileValue; static stillImage = Constants.StillImageFileValue; static text = Constants.TextFileValue; + static region = Constants.Region; + static color = Constants.ColorValue; }; diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.html b/src/app/workspace/resource/representation/still-image/still-image.component.html index 2f16049f54..a57584e966 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.html +++ b/src/app/workspace/resource/representation/still-image/still-image.component.html @@ -1,5 +1,5 @@ -
+
{{imageCaption}} @@ -20,7 +20,7 @@ - diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.scss b/src/app/workspace/resource/representation/still-image/still-image.component.scss index 5c77563058..a8cd074068 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.scss +++ b/src/app/workspace/resource/representation/still-image/still-image.component.scss @@ -26,6 +26,10 @@ $bright: #ccc; background-color: $dark; height: 100%; + &.drawing { + cursor: crosshair; + } + &.fullscreen { max-width: 100vw; } diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.ts b/src/app/workspace/resource/representation/still-image/still-image.component.ts index 41b37de7b9..813a0f584e 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.ts +++ b/src/app/workspace/resource/representation/still-image/still-image.component.ts @@ -111,7 +111,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { @Output() regionAdded = new EventEmitter(); - private _regionDrawMode: Boolean = false; // stores whether viewer is currently drawing a region + regionDrawMode: Boolean = false; // stores whether viewer is currently drawing a region private _regionDragInfo; // stores the information of the first click for drawing a region private _viewer: OpenSeadragon.Viewer; private _regions: PolygonsForRegion = {}; @@ -201,7 +201,8 @@ export class StillImageComponent implements OnChanges, OnDestroy { * prevents navigation by mouse (so that the region can be accurately drawn). */ drawButtonClicked(): void { - this._regionDrawMode = true; + + this.regionDrawMode = true; this._viewer.setMouseNavEnabled(false); } @@ -211,9 +212,9 @@ export class StillImageComponent implements OnChanges, OnDestroy { * @param endPoint the end point of the drawing * @param imageSize the image size for calculations */ - private _openRegionDialog(startPoint, endPoint, imageSize, overlay): void{ + private _openRegionDialog(startPoint: Point2D, endPoint: Point2D, imageSize: Point2D, overlay: Element): void{ const dialogConfig: MatDialogConfig = { - width: '840px', + width: '337px', maxHeight: '80vh', position: { top: '112px' @@ -243,7 +244,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { * @param comment the value for the comment entered in the form * @param label the value for the label entered in the form */ - private _uploadRegion(startPoint, endPoint, imageSize, color, comment, label){ + private _uploadRegion(startPoint: Point2D, endPoint: Point2D, imageSize: Point2D, color: string, comment: string, label: string){ const x1 = Math.max(Math.min(startPoint.x, imageSize.x), 0)/imageSize.x; const x2 = Math.max(Math.min(endPoint.x, imageSize.x), 0)/imageSize.x; const y1 = Math.max(Math.min(startPoint.y, imageSize.y), 0)/imageSize.y; @@ -290,7 +291,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { new OpenSeadragon.MouseTracker({ element: this._viewer.canvas, pressHandler: (event) => { - if (!this._regionDrawMode){ + if (!this.regionDrawMode){ return; } const overlayElement = document.createElement('div'); @@ -320,13 +321,13 @@ export class StillImageComponent implements OnChanges, OnDestroy { this._regionDragInfo.endPos = viewPortPos; }, releaseHandler: () => { - if (this._regionDrawMode) { + if (this.regionDrawMode) { const imageSize = this._viewer.world.getItemAt(0).getContentSize(); const startPoint = this._viewer.viewport.viewportToImageCoordinates(this._regionDragInfo.startPos); const endPoint = this._viewer.viewport.viewportToImageCoordinates(this._regionDragInfo.endPos); this._openRegionDialog(startPoint, endPoint, imageSize, this._regionDragInfo.overlayElement); this._regionDragInfo = null; - this._regionDrawMode = false; + this.regionDrawMode = false; this._viewer.setMouseNavEnabled(true); } } diff --git a/src/app/workspace/resource/resource.component.html b/src/app/workspace/resource/resource.component.html index 50d6832bf0..41d5ad5bb7 100644 --- a/src/app/workspace/resource/resource.component.html +++ b/src/app/workspace/resource/resource.component.html @@ -58,7 +58,7 @@
-
diff --git a/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts b/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts index c2e3fa7ca6..1e211154b7 100644 --- a/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts +++ b/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts @@ -16,7 +16,7 @@ const resolvedPromise = Promise.resolve(null); export class TextValueAsStringComponent extends BaseValueDirective implements OnInit, OnChanges, OnDestroy { @Input() displayValue?: ReadTextValueAsString; - @Input() textArea?: false; + @Input() textArea?: boolean = false; valueFormControl: FormControl; commentFormControl: FormControl; diff --git a/src/assets/style/_elements.scss b/src/assets/style/_elements.scss index 843886a23c..98665f663b 100644 --- a/src/assets/style/_elements.scss +++ b/src/assets/style/_elements.scss @@ -496,6 +496,7 @@ a, // form // $form-width: 472px; +// golden cut (gc) calculation $gc-large: decimal-floor($form-width / 1.618, 0) - 2; $gc-small: $form-width - $gc-large - 4; @@ -526,6 +527,18 @@ $gc-small: $form-width - $gc-large - 4; min-width: $form-width; } + &.small-form { + width: $gc-large; + + .x-small-field, + .small-field, + .medium-field, + .large-field { + width: 100%; + margin-bottom: 0; + } + } + .input-icon { color: $black-60-opacity; } diff --git a/src/assets/style/main.scss b/src/assets/style/main.scss index 82ffb866f2..c3194a1956 100644 --- a/src/assets/style/main.scss +++ b/src/assets/style/main.scss @@ -107,3 +107,8 @@ app-color-value { white-space: pre-line; } +.mat-form-field.without-border { + .mat-form-field-underline { + display: none; +} +}