Skip to content

Commit

Permalink
Feature/external contact identifiers (#487)
Browse files Browse the repository at this point in the history
* Bump tmpl from 1.0.4 to 1.0.5

Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump codemirror from 5.44.0 to 5.65.4

Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.44.0 to 5.65.4.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](codemirror/codemirror5@5.44.0...5.65.4)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump socket.io-parser from 3.3.0 to 3.3.2

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 3.3.0 to 3.3.2.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/3.3.2/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@3.3.0...3.3.2)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump path-parse from 1.0.6 to 1.0.7

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump tar from 4.4.10 to 4.4.19

Bumps [tar](https://github.com/npm/node-tar) from 4.4.10 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v4.4.10...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump lodash from 4.17.11 to 4.17.21

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.11...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump y18n from 4.0.0 to 4.0.3

Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](yargs/y18n@v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump socket.io from 2.2.0 to 2.4.1

Bumps [socket.io](https://github.com/socketio/socket.io) from 2.2.0 to 2.4.1.
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/2.4.1/CHANGELOG.md)
- [Commits](socketio/socket.io@2.2.0...2.4.1)

---
updated-dependencies:
- dependency-name: socket.io
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* add contact namespace to contact model

* add external identifiers edit and view interface

* temporarily point to development mdTranslator service

* don't need this test header any more :P

* change contact externalIdentifier namespace input to a picklist

* validations for contact external identifiers

* try it without the dash

* update mdjson-schemas

* change externalIdentifiers to singular per mdJson-schema standard

* use namespace codelist for contact.externalIdentifier

* fix external identifiers on contact#show

* update mdCodes
for ROR and ORCID identifiers

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Devon Anderson <devon_anderson@fws.gov>
  • Loading branch information
3 people authored Oct 3, 2022
1 parent 74cf1e0 commit f947706
Show file tree
Hide file tree
Showing 10 changed files with 292 additions and 196 deletions.
5 changes: 3 additions & 2 deletions app/models/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ const JsonDefault = EmberObject.extend({
'phone': [],
'address': [],
'electronicMailAddress': [],
'externalIdentifier': [],
'onlineResource': [],
'hoursOfService': []
'hoursOfService': [],
//'contactInstructions': null,
//'contactType': null;
});
Expand Down Expand Up @@ -269,7 +270,7 @@ const Contact = Model.extend(Validations, Copyable, {
function () {
let contacts = this.get('contactsService.organizations');

let org = contacts.findBy('json.contactId', get(this,
let org = contacts.findBy('json.contactId.identifier', get(this,
'defaultOrganization'));

return org ? get(org, 'name') : null;
Expand Down
3 changes: 2 additions & 1 deletion app/models/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import DS from 'ember-data';
import EmberObject, { observer } from "@ember/object";

const defaultValues = {
mdTranslatorAPI: 'https://mdtranslator.herokuapp.com/api/v3/translator',
// mdTranslatorAPI: 'https://mdtranslator.herokuapp.com/api/v3/translator',
mdTranslatorAPI: 'https://md-translator.onrender.com/api/v3/translator',
fiscalStartMonth: '10'
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Component from '@ember/component';
import EmObject from '@ember/object';
import { A } from '@ember/array';
import {
validator,
buildValidations
} from 'ember-cp-validations';

const Validations = buildValidations({
'identifier': [
validator('presence', {
presence: true,
ignoreBlank: true
})
],
'namespace': [
validator('presence', {
presence: true
})
]
});

export default Component.extend({

/**
* mdEditor class for input and edit of mdJSON 'phone' object.
* The class manages the maintenance of an array of phone objects.
*
* @class md-phone-array
* @module mdeditor
* @submodule components-object
* @constructor
*/

attributeBindings: ['data-spy'],

/**
* See [md-array-table](md-array-table.html#property_templateClass).
*
* @property templateClass
* @type Ember.Object
*/
templateClass: EmObject.extend(Validations, {
init() {
this._super(...arguments);
this.set('service', A());
}
})

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{#object/md-array-table
columns="Identifier,Namespace"
title="External Identifier"
value=value
validation=validation
data-spy=null
templateClass=templateClass as |contactId|
}}
<td>
{{input/md-input valuePath="identifier" model=contactId.item
placeholder="External Contact Identifier"}}
</td>
<td>
{{input/md-codelist path="namespace" model=contactId.item
create=true tooltip=true icon=false mdCodeName="namespace"
showValidations=true
placeholder="Select a Namespace"
profilePath="contact.externalIdentifier.namespace"
data-spy=false }}
</td>
{{/object/md-array-table}}
2 changes: 1 addition & 1 deletion app/pods/contact/new/id/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
</div>
</div>
</form>
</div>
</div>
3 changes: 2 additions & 1 deletion app/pods/contact/show/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
filterId=model.json.contactId
}}

{{object/md-contact-identifier-array value=model.json.externalIdentifier data-spy="ExternalIdentifiers"}}

{{object/md-phone-array value=model.json.phone data-spy="Phone"}}

Expand Down Expand Up @@ -114,4 +115,4 @@
<button type="button" class="btn btn-danger" {{action (route-action "confirmTransition")}}>Continue</button>
<button type="button" class="btn btn-primary" {{action (route-action "cancelTransition")}}>Stay Here</button>
</div>
{{/control/md-modal}} --}}
{{/control/md-modal}} --}}
29 changes: 28 additions & 1 deletion app/pods/contact/show/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,33 @@
</div>
</div>

<div class="row">
<div class="col-md-6">
{{#layout/md-card shadow=false muted=true title="External Identifiers" bodyIsRow=model.json.externalIdentifier.length}}
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Identifier</th>
<th>Namespace</th>
</tr>
</thead>
<tbody>
{{#each model.json.externalIdentifier as |ei|}}
<tr>
<td>{{ei.identifier}}</td>
<td>{{ei.namespace}}</td>
</tr>
{{else}}
<tr><td><em class="text-muted">No External Identifiers.</em></td></tr>
{{/each}}
</tbody>
</table>
</div>
{{/layout/md-card}}
</div>
</div>

</div>
<div class="md-control-sidebar col-sm-2 no-nav">
{{#control/md-crud-buttons
Expand All @@ -177,4 +204,4 @@
{{fa-icon "list"}} Show List{{/link-to}}
{{control/md-scroll-spy scrollInit=scrollTo setScrollTo=(route-action "setScrollTo")}}
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/pods/record/show/edit/main/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@
{{/with}}

{{to-elsewhere named="md-scroll-spy-record-edit"
send=(component "control/md-scroll-spy" scrollInit=scrollTo setScrollTo=(route-action "setScrollTo") refresh=model.profile)}}
send=(component "control/md-scroll-spy" scrollInit=scrollTo setScrollTo=(route-action "setScrollTo") refresh=model.profile)}}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
"leaflet-draw": "~1.0.4",
"liquid-fire": "~0.31.0",
"loader.js": "^4.7.0",
"mdcodes": "^2.8.1",
"mdjson-schemas": "^2.8.0-rc3",
"mdcodes": "^2.8.2",
"mdjson-schemas": "2.8.0-rc4",
"mdkeywords": "^2.0.1",
"mdprofiles": "^0.2.4",
"moment-timezone": "^0.5.37",
Expand Down
Loading

0 comments on commit f947706

Please sign in to comment.