-
Notifications
You must be signed in to change notification settings - Fork 56
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
Showing
80 changed files
with
4,775 additions
and
322 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,31 @@ | ||
import JSONAPIAdapter from '@ember-data/adapter/json-api'; | ||
import DS from 'ember-data'; | ||
import ModelRegistry from 'ember-data/types/registries/model'; | ||
import config from 'ember-get-config'; | ||
|
||
const { support: { supportEmail } } = config; | ||
|
||
export default class CrossrefAdapter extends JSONAPIAdapter { | ||
host = 'https://api.crossref.org'; | ||
|
||
get headers() { | ||
return { | ||
Accept: '*/*', | ||
}; | ||
} | ||
|
||
query(_: any, __: any, q: any) { | ||
return super.query(_, __, { ...q, mailto: supportEmail }); | ||
} | ||
|
||
buildURL<K extends keyof ModelRegistry>( | ||
modelName?: K, | ||
id?: string | null, | ||
snapshot?: DS.Snapshot<K> | null, | ||
requestType?: string, | ||
query?: {}, | ||
): string { | ||
const url = super.buildURL(modelName, id, snapshot, requestType, query); | ||
return url; | ||
} | ||
} |
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,7 @@ | ||
import CrossrefAdapter from 'ember-osf-web/adapters/crossref-adapter'; | ||
|
||
export default class CrossrefFunderAdapter extends CrossrefAdapter { | ||
pathForType() { | ||
return 'funders'; | ||
} | ||
} |
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,10 @@ | ||
import OsfAdapter from './osf-adapter'; | ||
|
||
export default class CustomFileMetadataRecordAdapter extends OsfAdapter { | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'custom-file-metadata-record': CustomFileMetadataRecordAdapter; | ||
} // eslint-disable-line semi | ||
} |
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,10 @@ | ||
import OsfAdapter from './osf-adapter'; | ||
|
||
export default class CustomItemMetadataRecordAdapter extends OsfAdapter { | ||
} | ||
|
||
declare module 'ember-data/types/registries/adapter' { | ||
export default interface AdapterRegistry { | ||
'custom-item-metadata-record': CustomItemMetadataRecordAdapter; | ||
} // eslint-disable-line semi | ||
} |
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
30 changes: 30 additions & 0 deletions
30
app/guid-file/-components/resource-help-dialog/template.hbs
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 @@ | ||
<OsfDialog | ||
@isOpen={{@isOpen}} | ||
@onClose={{action (mut @isOpen) false}} | ||
@closeOnOutsideClick={{true}} | ||
as |dialog| | ||
> | ||
<dialog.heading> | ||
{{t 'file_detail.resource-help-dialog.heading'}} | ||
</dialog.heading> | ||
<dialog.main tabindex='0'> | ||
{{#if @userCanEdit}} | ||
{{t 'file_detail.resource-help-dialog.write-permission' | ||
htmlSafe=true | ||
parentNodeType=@parentNodeType | ||
}} | ||
{{else}} | ||
{{t 'file_detail.resource-help-dialog.read-only' | ||
htmlSafe=true | ||
}} | ||
{{/if}} | ||
</dialog.main> | ||
<dialog.footer> | ||
<Button | ||
@type='secondary' | ||
{{on 'click' dialog.close}} | ||
> | ||
{{t 'general.close'}} | ||
</Button> | ||
</dialog.footer> | ||
</OsfDialog> |
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
Oops, something went wrong.