-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Fenner
committed
Jan 1, 2020
1 parent
1a1ac3e
commit 45e2bde
Showing
9 changed files
with
88 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default Route.extend({ | ||
can: service(), | ||
|
||
model() { | ||
let self = this; | ||
return this.store.findRecord('doi', this.modelFor('dois/show').get('id'), { include: 'provider,client,resource-type' }).then(function(doi) { | ||
return doi; | ||
}).catch(function(reason) { | ||
console.debug(reason); | ||
|
||
self.get('flashMessages').warning('Fabrica is currently unavailable due to a DataCite API problem. We apologize for the inconvenience and are working hard to restore the service. Please check back later or contact DataCite Support if you have a question.'); | ||
self.transitionTo('/'); | ||
}); | ||
}, | ||
|
||
afterModel() { | ||
if (this.can.cannot('transfer doi', this.modelFor('dois/show'))) { | ||
this.transitionTo('index'); | ||
} else { | ||
this.modelFor('dois/show').set('mode', 'modify'); | ||
} | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default Route.extend({ | ||
can: service(), | ||
|
||
model(params) { | ||
let self = this; | ||
return this.store.query('repository-prefix', { 'repository-id': params.repository_id, 'prefix-id': params.prefix_id }).then(function(repositoryPrefixes) { | ||
return repositoryPrefixes.get('firstObject'); | ||
}).catch(function(reason) { | ||
console.debug(reason); | ||
|
||
self.get('flashMessages').warning('Fabrica is currently unavailable due to a DataCite API problem. We apologize for the inconvenience and are working hard to restore the service. Please check back later or contact DataCite Support if you have a question.'); | ||
self.transitionTo('/'); | ||
}); | ||
}, | ||
|
||
afterModel(model) { | ||
if (this.can.cannot('delete prefix', model)) { | ||
this.transitionTo('index'); | ||
} | ||
}, | ||
|
||
actions: { | ||
queryParamsDidChange() { | ||
this.refresh(); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters