Skip to content

Commit 7992d60

Browse files
committed
Merge remote-tracking branch 'origin/main' into pb646-software-field
2 parents c422992 + f98ed93 commit 7992d60

File tree

8 files changed

+34
-22
lines changed

8 files changed

+34
-22
lines changed

app/components/doi-list.hbs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
</BsAlert>
1515
</div>
1616
</div>
17-
<div>
18-
<MetadataDashboardButton />
17+
{{/unless}}
18+
19+
{{#unless (eq this.link 'repositories.show.dois')}}
20+
<div class="panel panel-transparent">
21+
<div class="panel-body">
22+
<MetadataDashboardButton @dashboardId={{@dashboardId}} />
23+
</div>
1924
</div>
2025
{{/unless}}
26+
2127
{{#if
2228
(eq this.link 'repositories.show.dois')
2329
}}
@@ -40,9 +46,7 @@
4046
{{#if (and this.repository.isActive (or (can 'create doi' this.model) (can 'upload doi' this.model)) (gt this.repository.meta.prefixCount 0))}}
4147
<CreateDoiButton @model={{this.model}} class="create-doi-button" />
4248
{{/if}}
43-
<div>
44-
<MetadataDashboardButton />
45-
</div>
49+
<MetadataDashboardButton @dashboardId={{@dashboardId}} />
4650
<div class="btn-group-vertical btn-group-sm">
4751
<ExportBasicMetadata @model={{this.model}} @client_id={{this.repository.id}} @page={{this.page}} class="btn btn-warning" />
4852
{{#if (and (can 'move doi' this.repository))}}
@@ -67,17 +71,16 @@
6771
<div class="panel facets">
6872
<div class="panel-body">
6973
<CreateDoiButton @model={{this.model}} class="create-doi-button" />
74+
<MetadataDashboardButton @dashboardId={{@dashboardId}} />
7075
</div>
7176
</div>
72-
<div>
73-
<MetadataDashboardButton />
74-
</div>
7577
{{/if}}
7678
{{/if}}
7779
{{else}}
7880
{{#if (gt this.model.length 0) }}
7981
<div class="panel facets add-25">
8082
<div class="panel-body">
83+
<MetadataDashboardButton @dashboardId={{@dashboardId}} />
8184
<div class="btn-toolbar">
8285
<div class="btn-group-vertical btn-group-sm">
8386
<ExportBasicMetadata @model={{this.model}} @client_id={{this.repository.id}} @page={{this.page}} class="btn btn-warning" />
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{{#if (and (not-eq this.fabricaDeployTarget "test") this.metadataDashboardUrl)}}
2-
<div class="btn-group btn-group-sm metadata-dashboard-button">
3-
<a href={{this.metadataDashboardUrl}} target="_blank" rel="noopener noreferrer" class="btn btn-warning" id="metadata-dashboard">
4-
<i class="fas fa-external-link-alt"></i>
5-
Metadata Dashboard
6-
</a>
7-
</div>
2+
<div class="metadata-dashboard-button">
3+
<BsButton class="btn-warning" id="metadata-dashboard-button" {{on "click" (fn this.openLink this.metadataDashboardUrl)}}>
4+
<i class="fas fa-external-link-alt"></i>Metadata Dashboard
5+
</BsButton>
6+
</div>
87
{{/if}}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import Component from '@glimmer/component';
22
import ENV from 'bracco/config/environment';
3-
import { inject as service } from '@ember/service';
3+
import { action } from '@ember/object';
44

55
export default class MetadataDashboardButton extends Component {
6-
@service currentUser;
76

87
get metadataDashboardUrl() {
9-
return ENV.METADATA_DASHBOARD_URL + "/" + this.currentUser.uid;
8+
return ENV.METADATA_DASHBOARD_URL + (this.args.dashboardId ? "/" + this.args.dashboardId.toLowerCase() : '');
109
}
10+
1111
get fabricaDeployTarget() {
1212
return ENV.fabricaDeployTarget;
1313
}
14+
15+
@action
16+
openLink(url) {
17+
document.activeElement.blur(); // Remove focus from the button after clicking to ultimately clear the styles when the user returns to the page.
18+
window.open(url, '_blank', 'noopener,noreferrer');
19+
}
1420
}

app/styles/local.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ z-index: 10000;
6262
}
6363

6464
/* Metadata dashboard button - make it look more like other buttons in the left sidebar. */
65-
.metadata-dashboard-button {
66-
margin-left: 5px;
67-
margin-bottom: 15px;
65+
66+
.metadata-dashboard-button button {
67+
margin-left: 5px;
68+
margin-bottom: 15px;
69+
font-size: 16px !important;
6870
}
6971

7072
/* INFO TAB - chart placement on info tab*/

app/templates/providers/show/dois.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@model={{this.model.dois}}
44
@link="providers.show.dois"
55
@searchable={{true}}
6+
@dashboardId={{this.model.provider.uid}}
67
/>
78
{{else}}
89
<div class="col-md-9 col-md-offset-3">

app/templates/providers/show/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="panel-body">
55
<div class="btn-toolbar">
66
<div class="shrink">
7-
<MetadataDashboardButton />
7+
<MetadataDashboardButton @dashboardId={{this.model.uid}} />
88
</div>
99
</div>
1010
</div>

app/templates/repositories/show/dois/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@link="repositories.show.dois"
66
@searchable={{true}}
77
@page={{this.model.page}}
8+
@dashboardId={{this.model.repository.symbol}}
89
/>
910
{{else}}
1011
<div class="col-md-9 col-md-offset-3">

app/templates/repositories/show/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{{#if (and this.model.isActive (can 'update repository' this.model) (or (can 'create doi' this.model) (can 'upload doi' this.model)) (gt this.model.meta.prefixCount 0))}}
1919
<CreateDoiButton @model={{this.model}} class="create-doi-button" />
2020
{{/if}}
21-
<MetadataDashboardButton />
21+
<MetadataDashboardButton @dashboardId={{this.model.id}} />
2222
</div>
2323
</div>
2424
</div>

0 commit comments

Comments
 (0)