Skip to content

Commit

Permalink
Revert "Support data in v2 (#194)" (#199)
Browse files Browse the repository at this point in the history
This reverts commit 0d95143.
  • Loading branch information
kaysiz committed Feb 20, 2024
1 parent 0d95143 commit 1e25211
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 2,630 deletions.
4 changes: 1 addition & 3 deletions .env.dev
@@ -1,5 +1,3 @@
API_URL_V1=https://api.dev.ror.org/v1
API_URL_V2=https://api.dev.ror.org/v2
API_URL=https://api.dev.ror.org
SENTRY_DSN=https://1c334995f85448b1afa561c8ccf13791@sentry.io/1422597
BASE_URL=https://dev.ror.org
LAUNCH_DARKLY_CLIENT_SIDE_ID=6390f62d05087a11e466bfc9
4 changes: 1 addition & 3 deletions .env.production
@@ -1,5 +1,3 @@
API_URL_V1=https://api.ror.org/v1
API_URL_V2=https://api.ror.org/v2
API_URL=https://api.ror.org
SENTRY_DSN=https://1c334995f85448b1afa561c8ccf13791@sentry.io/1422597
BASE_URL=https://ror.org
LAUNCH_DARKLY_CLIENT_SIDE_ID=636d08a3d56cf611cc88019d
4 changes: 1 addition & 3 deletions .env.staging
@@ -1,5 +1,3 @@
API_URL_V1=https://api.staging.ror.org/v1
API_URL_V2=https://api.staging.ror.org/v2
API_URL=https://api.staging.ror.org
SENTRY_DSN=https://1c334995f85448b1afa561c8ccf13791@sentry.io/1422597
BASE_URL=https://staging.ror.org
LAUNCH_DARKLY_CLIENT_SIDE_ID=636d08a3d56cf611cc88019c
7 changes: 1 addition & 6 deletions app/adapters/application.js
@@ -1,11 +1,6 @@
import DS from 'ember-data';
import ENV from 'ror-app/config/environment';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';

export default DS.JSONAPIAdapter.extend({
launchDarkly: service(),
host: computed('launchDarkly.variation', function() {
return this.launchDarkly.variation('v2_ui') ? ENV.API_URL_V2 : ENV.API_URL_V1;
}),
host: ENV.API_URL
});
9 changes: 2 additions & 7 deletions app/adapters/organization.js
@@ -1,16 +1,11 @@
import DS from 'ember-data';
import ENV from 'ror-app/config/environment';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';

export default DS.JSONAPIAdapter.extend({
launchDarkly: service(),
host: computed('launchDarkly.variation', function() {
return this.launchDarkly.variation('v2_ui') ? ENV.API_URL_V2 : ENV.API_URL_V1;
}),
host: ENV.API_URL,

urlForFindRecord(id, modelName) {
return `${this.host}/${modelName}s/ror.org/${id}`;
return `${ENV.API_URL}/${modelName}s/ror.org/${id}`;
},

init() {
Expand Down
File renamed without changes.
127 changes: 0 additions & 127 deletions app/components/v2/organization-item.js

This file was deleted.

7 changes: 2 additions & 5 deletions app/models/organization.js
Expand Up @@ -3,8 +3,7 @@ import DS from 'ember-data';
export default DS.Model.extend({
meta: DS.attr(),

name: DS.attr('string'), //TODO: Remove this when v1 has been retired
names: DS.attr(),
name: DS.attr('string'),
local: DS.attr('string'),
types: DS.attr(),
links: DS.attr(),
Expand All @@ -16,8 +15,6 @@ export default DS.Model.extend({
country: DS.attr(),
addresses: DS.attr(),
relationships: DS.attr(),
status: DS.attr('string'),
admin: DS.attr(),
locations: DS.attr()
status: DS.attr('string')
});

8 changes: 1 addition & 7 deletions app/routes/application.js
@@ -1,11 +1,5 @@
import Route from '@ember/routing/route';

export default Route.extend({
beforeModel(){
let user = {
key: 'user-key-123abc',
anonymous: true
};
return this.launchDarkly.initialize(user);
}

});
158 changes: 0 additions & 158 deletions app/templates/components/v2/organization-item.hbs

This file was deleted.

6 changes: 1 addition & 5 deletions app/templates/organizations/index.hbs
Expand Up @@ -11,11 +11,7 @@
</div>
<div class="col-md-10 col-sm-12">
{{#each model as |organization|}}
{{#if (variation "v2_ui")}}
{{v2/organization-item model=organization view="list"}}
{{else}}
{{v1/organization-item model=organization}}
{{/if}}
{{organization-item model=organization}}
{{/each}}
</div>
{{#if (gt model.meta.totalPages 1)}}
Expand Down

0 comments on commit 1e25211

Please sign in to comment.