Skip to content

Commit

Permalink
[Feature | BUG] - Handle lang attribute for all Othernames (#211)
Browse files Browse the repository at this point in the history
* Update dependabot.yml

* Update UI to support V2 API (#204) (#205)

* Support data in v2 (#194)

* Add launch darkly addon

* Add slient side key to envs

* Configure launch darkly

* setup UI versioning

* setup variation for api urll v1 and v2

* Handle types, v2 returns lowecase value

* Add versioning to components

* Update model for name to names

* WIP: update template with new data

* Set name correctly

* Implement v2 view templates for v2, fix model to work with v2

* Update launch darkly with correct client side id for env

* removing key for anonymous user mode

* Update config to use remote flags

* Update the adapters to use remote flags

* Update the route to use remote flags

* Update the templates to use remote flags

* Revert "Support data in v2 (#194)" (#199)

This reverts commit 0d95143.

* Support for schema v2 (#198)

* Add launch darkly addon

* Add slient side key to envs

* Configure launch darkly

* setup UI versioning

* setup variation for api urll v1 and v2

* Handle types, v2 returns lowecase value

* Add versioning to components

* Update model for name to names

* WIP: update template with new data

* Set name correctly

* Implement v2 view templates for v2, fix model to work with v2

* Update launch darkly with correct client side id for env

* removing key for anonymous user mode

* Update config to use remote flags

* Update the adapters to use remote flags

* Update the route to use remote flags

* Update the templates to use remote flags

* Fix bug with website fixes #218

* Fix other names display issue

* comma separate org types

* Update text for submitting a change request

* fix duplicate lang on othernames

* Revert "Support for schema v2 (#198)" (#200)

This reverts commit eef6b0a.

* Support for schema v2 (#201)

* Add launch darkly addon

* Add slient side key to envs

* Configure launch darkly

* setup UI versioning

* setup variation for api urll v1 and v2

* Handle types, v2 returns lowecase value

* Add versioning to components

* Update model for name to names

* WIP: update template with new data

* Set name correctly

* Implement v2 view templates for v2, fix model to work with v2

* Update launch darkly with correct client side id for env

* removing key for anonymous user mode

* Update config to use remote flags

* Update the adapters to use remote flags

* Update the route to use remote flags

* Update the templates to use remote flags

* Fix bug with website fixes #218

* Fix other names display issue

* comma separate org types

* Update text for submitting a change request

* fix duplicate lang on othernames

* Show or hide othernames based on content

* remove () from relationships

* Add lang to all otherNames

* Handle api urls for different envs for the json schema url

* Fix build eror

* Fix build error

---------

Co-authored-by: Liz Krznarich <liz.krznarich@datacite.org>
  • Loading branch information
kaysiz and lizkrznarich committed Apr 12, 2024
1 parent 5cdce5e commit 0c4459e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Expand Up @@ -5,5 +5,5 @@ updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "dev"
interval: "weekly"
target-branch: "dependabot-updates"
15 changes: 9 additions & 6 deletions app/components/v2/organization-item.js
Expand Up @@ -20,6 +20,7 @@ export default Component.extend({
lastModifiedDate: null,
otherNames: null,
organizationTypes: null,
configService: service('config-service'),


// Convert label array into a dictionary with relationship type as key
Expand All @@ -45,12 +46,14 @@ export default Component.extend({
return result;
}, {});

if (groupedNames.label) {
groupedNames.label.forEach((label) => {
if (label.lang && !label.value.includes(`(${label.lang})`)) {
label.value = `${label.value} (${label.lang})`;
}
});
for (let key in groupedNames) {
if (groupedNames[key]) {
groupedNames[key].forEach((item) => {
if (item.lang && !item.value.includes(`(${item.lang})`)) {
item.value = `${item.value} (${item.lang})`;
}
})
}
}

const values = Object.values(groupedNames).flat().map(item => item.value).join(', ');
Expand Down
7 changes: 7 additions & 0 deletions app/services/config-service.js
@@ -0,0 +1,7 @@
import Service from '@ember/service';
import config from '../config/environment';

export default Service.extend({
API_URL_V1: config.API_URL_V1,
API_URL_V2: config.API_URL_V2
});
2 changes: 1 addition & 1 deletion app/templates/components/v2/organization-item.hbs
Expand Up @@ -139,7 +139,7 @@
{{#link-to "organizations.show" model.id class="btn btn-sm btn-round"}}View details{{/link-to}}
{{/if}}
{{#if (not isSearch)}}
<p class="mt-3 mb-0"><i>Some record data is not displayed in this view. <a target="_blank" rel="noopener" href="https://api.ror.org/v2/organizations/{{model.id}}">See JSON view for full record data</a></i></p>
<p class="mt-3 mb-0"><i>Some record data is not displayed in this view. <a target="_blank" rel="noopener" href="{{configService.API_URL_V2}}/organizations/{{model.id}}">See JSON view for full record data</a></i></p>
<p class="mt-3 mb-0">
<i>
{{#if lastModifiedDate}}
Expand Down

0 comments on commit 0c4459e

Please sign in to comment.