[open-ils-commits] [GIT] Evergreen ILS branch master updated. 35cf13c59d7b1a851e46b537a4f0356a9e4bc3fc
Evergreen Git
git at git.evergreen-ils.org
Mon Dec 17 13:53:26 EST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 35cf13c59d7b1a851e46b537a4f0356a9e4bc3fc (commit)
via dacca60ce1f1ee97c93519b0423b2a73dea411e5 (commit)
from d32427162b215f5b48388596ccde7a60976c60fb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 35cf13c59d7b1a851e46b537a4f0356a9e4bc3fc
Author: Jane Sandberg <sandbej at linnbenton.edu>
Date: Wed Dec 12 08:35:54 2018 -0800
LP1807523: Adding some randomness to DOM ID generation
Ensures ID values across multiple FmEditor instances in a page will not
collide.
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
Signed-off-by: Bill Erickson <berickxx at gmail.com>
diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
index bcd995d..4aab72d 100644
--- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
+++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
@@ -11,7 +11,7 @@
<form #fmEditForm="ngForm" role="form" class="form-validated common-form striped-odd">
<div class="form-group row" *ngFor="let field of fields">
<div class="col-lg-3 offset-lg-1">
- <label for="rec-{{field.name}}">{{field.label}}</label>
+ <label for="{{idPrefix}}-{{field.name}}">{{field.label}}</label>
</div>
<div class="col-lg-7">
@@ -30,7 +30,7 @@
<input *ngIf="field.datatype == 'id' && pkeyIsEditable"
class="form-control"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -41,7 +41,7 @@
<input *ngIf="field.datatype == 'text' || field.datatype == 'interval'"
class="form-control"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -51,7 +51,7 @@
<span *ngIf="field.datatype == 'timestamp'">
<eg-date-select
- domId="rec-{{field.name}}"
+ domId="{{idPrefix}}-{{field.name}}"
(onChangeAsIso)="record[field.name]($event)"
initialIso="{{record[field.name]()}}">
</eg-date-select>
@@ -61,7 +61,7 @@
class="form-control"
type="number"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -73,7 +73,7 @@
class="form-control"
type="number" step="0.1"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -87,7 +87,7 @@
class="form-control"
type="number" step="0.1"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
[readonly]="field.readOnly"
[required]="field.isRequired()"
[ngModel]="record[field.name]() | currency"/>
@@ -96,7 +96,7 @@
class="form-control"
type="number" step="0.1"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -109,7 +109,7 @@
class="form-check-input"
type="checkbox"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
[readonly]="field.readOnly"
[ngModel]="record[field.name]()"
(ngModelChange)="record[field.name]($event)"/>
@@ -119,7 +119,7 @@
<select
class="form-control"
name="{{field.name}}"
- id="rec-{{field.name}}"
+ id="{{idPrefix}}-{{field.name}}"
[disabled]="field.readOnly"
[required]="field.isRequired()"
[ngModel]="record[field.name]()"
@@ -132,7 +132,7 @@
<eg-org-select *ngIf="field.datatype == 'org_unit'"
placeholder="{{field.label}}..."
i18n-placeholder
- domId="rec-{{field.name}}"
+ domId="{{idPrefix}}-{{field.name}}"
[limitPerms]="modePerms[mode]"
[applyDefault]="field.orgDefaultAllowed"
[initialOrgId]="record[field.name]()"
diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
index 308218a..3ad4892 100644
--- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
@@ -110,6 +110,8 @@ export class FmRecordEditorComponent
if (id) { this.recId = id; }
}
+ idPrefix: string;
+
constructor(
private modal: NgbModal, // required for passing to parent
private idl: IdlService,
@@ -124,6 +126,9 @@ export class FmRecordEditorComponent
this.listifyInputs();
this.idlDef = this.idl.classes[this.idlClass];
this.recordLabel = this.idlDef.label;
+
+ // Add some randomness to the generated DOM IDs to ensure against clobbering
+ this.idPrefix = 'fm-editor-' + Math.floor(Math.random() * 100000);
}
// Opening dialog, fetch data.
commit dacca60ce1f1ee97c93519b0423b2a73dea411e5
Author: Jane Sandberg <sandbej at linnbenton.edu>
Date: Sat Dec 8 12:30:38 2018 -0600
LP1807523: Associating labels and inputs in angular fmeditor
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
Signed-off-by: Bill Erickson <berickxx at gmail.com>
diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
index c686be4..a1558b1 100644
--- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
+++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
@@ -4,6 +4,7 @@
class="form-control"
ngbDatepicker
#datePicker="ngbDatepicker"
+ [attr.id]="domId.length ? domId : null"
placeholder="yyyy-mm-dd"
class="form-control"
name="{{fieldName}}"
diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts
index ae3a729..2f8837d 100644
--- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts
@@ -19,6 +19,8 @@ export class DateSelectComponent implements OnInit {
@Input() required: boolean;
@Input() fieldName: string;
+ @Input() domId = '';
+
current: NgbDateStruct;
@Output() onChangeAsDate: EventEmitter<Date>;
diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
index 721423c..bcd995d 100644
--- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
+++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
@@ -30,6 +30,7 @@
<input *ngIf="field.datatype == 'id' && pkeyIsEditable"
class="form-control"
name="{{field.name}}"
+ id="rec-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -40,6 +41,7 @@
<input *ngIf="field.datatype == 'text' || field.datatype == 'interval'"
class="form-control"
name="{{field.name}}"
+ id="rec-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -49,6 +51,7 @@
<span *ngIf="field.datatype == 'timestamp'">
<eg-date-select
+ domId="rec-{{field.name}}"
(onChangeAsIso)="record[field.name]($event)"
initialIso="{{record[field.name]()}}">
</eg-date-select>
@@ -58,6 +61,7 @@
class="form-control"
type="number"
name="{{field.name}}"
+ id="rec-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -69,6 +73,7 @@
class="form-control"
type="number" step="0.1"
name="{{field.name}}"
+ id="rec-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -82,6 +87,7 @@
class="form-control"
type="number" step="0.1"
name="{{field.name}}"
+ id="rec-{{field.name}}"
[readonly]="field.readOnly"
[required]="field.isRequired()"
[ngModel]="record[field.name]() | currency"/>
@@ -90,6 +96,7 @@
class="form-control"
type="number" step="0.1"
name="{{field.name}}"
+ id="rec-{{field.name}}"
placeholder="{{field.label}}..."
i18n-placeholder
[readonly]="field.readOnly"
@@ -102,6 +109,7 @@
class="form-check-input"
type="checkbox"
name="{{field.name}}"
+ id="rec-{{field.name}}"
[readonly]="field.readOnly"
[ngModel]="record[field.name]()"
(ngModelChange)="record[field.name]($event)"/>
@@ -111,6 +119,7 @@
<select
class="form-control"
name="{{field.name}}"
+ id="rec-{{field.name}}"
[disabled]="field.readOnly"
[required]="field.isRequired()"
[ngModel]="record[field.name]()"
@@ -123,6 +132,7 @@
<eg-org-select *ngIf="field.datatype == 'org_unit'"
placeholder="{{field.label}}..."
i18n-placeholder
+ domId="rec-{{field.name}}"
[limitPerms]="modePerms[mode]"
[applyDefault]="field.orgDefaultAllowed"
[initialOrgId]="record[field.name]()"
diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html
index 2a4bd3a..b032114 100644
--- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html
+++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html
@@ -6,6 +6,7 @@
<input type="text"
class="form-control"
+ [attr.id]="domId.length ? domId : null"
[placeholder]="placeholder"
[(ngModel)]="selected"
[ngbTypeahead]="filter"
diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts
index 39e0cff..598a988 100644
--- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts
@@ -43,6 +43,9 @@ export class OrgSelectComponent implements OnInit {
@Input() placeholder = '';
@Input() stickySetting: string;
+ // ID to display in the DOM for this selector
+ @Input() domId = '';
+
// Org unit field displayed in the selector
@Input() displayField = 'shortname';
-----------------------------------------------------------------------
Summary of changes:
.../share/date-select/date-select.component.html | 1 +
.../app/share/date-select/date-select.component.ts | 2 ++
.../app/share/fm-editor/fm-editor.component.html | 12 +++++++++++-
.../src/app/share/fm-editor/fm-editor.component.ts | 5 +++++
.../app/share/org-select/org-select.component.html | 1 +
.../app/share/org-select/org-select.component.ts | 3 +++
6 files changed, 23 insertions(+), 1 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list