Skip to content

Commit 0d97940

Browse files
committed
fixing user profile page
1 parent fea2eab commit 0d97940

File tree

11 files changed

+348
-516
lines changed

11 files changed

+348
-516
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"vue-moment": "^4.1.0",
6464
"vue-router": "^4.4.3",
6565
"vue-scrollto": "^2.20.0",
66-
"vue3-clipboard": "^1.0.0",
6766
"vuetify": "^3.6.14",
6867
"vuex": "^4.1.0",
6968
"webpack": "^5.93.0"

src/components/Navigation/Header.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@
6969
:size="$vuetify.display.xl ? 'x-large' : $vuetify.display.mdAndDown ? 'small' : undefined"
7070
class="mr-1 mt-sm-1 bg-green"
7171
to="/accounts/profile"
72+
elevation="2"
7273
>
7374
<v-avatar>
7475
<v-icon
7576
color="white"
7677
>
77-
fa-user-circle
78+
fas fa-user-circle
7879
</v-icon>
7980
</v-avatar>
8081
<span class="text-white ellipse-150">{{ user().credentials.username }}</span>

src/components/Records/Record/GeneralInfo/DOITitle.vue

+10-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
<template #activator="{ props }">
5353
<v-icon
5454
v-ripple
55-
v-clipboard="copyURL"
56-
5755
class="text-primary ml-2 cursor-pointer"
56+
5857
size="small"
5958
v-bind="props"
59+
@click="copyURL"
6060
>
6161
fa fa-copy
6262
</v-icon>
@@ -137,9 +137,15 @@ export default {
137137
generateDoiLink(doi) {
138138
return `https://doi.org/${doi}`
139139
},
140-
copyURL() {
140+
async copyURL() {
141141
this.copyButtonStatus = true;
142-
return this.generateDoiLink(this.currentRecord['fairsharingRecord'].doi)
142+
let text = this.generateDoiLink(this.currentRecord['fairsharingRecord'].doi)
143+
try {
144+
await navigator.clipboard.writeText(text);
145+
}
146+
catch ($e) {
147+
this.copyButtonStatus = false;
148+
}
143149
}
144150
}
145151
}

src/components/Records/Record/Publications.vue

-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
<v-btn
5959
v-if="checkLinkValue(publication.pubmedId)"
6060
variant="text"
61-
variant="outlined"
6261
size="small"
6362
class="mr-1"
6463
>
@@ -74,7 +73,6 @@
7473
<v-btn
7574
v-if="checkLinkValue(publication.doi)"
7675
variant="text"
77-
variant="outlined"
7876
size="small"
7977
class="ma-1"
8078
>
@@ -88,7 +86,6 @@
8886
<v-btn
8987
v-if="checkLinkValue(publication.url)"
9088
variant="text"
91-
variant="outlined"
9289
size="small"
9390
:class="{'mt-2':$vuetify.display.width<540}"
9491
>

src/components/Users/Profiles/Private/EditsTable.vue

+13-16
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/>
1919
</v-avatar>
2020
<div class="mt-1 ml-3 alignLeft">
21-
{{ item.fairsharingRecord.name | cleanString }}
21+
{{ $filters.cleanString(item.fairsharingRecord.name) }}
2222
</div>
2323
</div>
2424
</template>
@@ -48,31 +48,31 @@
4848
</template>
4949

5050
<template #[`item.actions`]="{ item }">
51-
<v-menu offset-x>
52-
<template #activator="{ on, attrs }">
51+
<v-menu>
52+
<template #activator="{ props }">
5353
<v-icon
54-
v-bind="attrs"
55-
v-on="on"
54+
55+
v-bind="props"
5656
>
5757
fas fa-ellipsis-v
5858
</v-icon>
5959
</template>
6060
<v-list>
6161
<v-list-item @click="previewRecord(item.fairsharingRecord.id)">
62-
<v-list-item-avatar><v-icon>fas fa-eye</v-icon></v-list-item-avatar>
63-
<v-list-item-content><v-list-item-title> Preview record </v-list-item-title></v-list-item-content>
62+
<v-avatar><v-icon>fas fa-eye</v-icon></v-avatar>
63+
<v-list-item-title> Preview record </v-list-item-title>
6464
</v-list-item>
6565
<v-list-item @click="goToRecord(item.fairsharingRecord.id)">
66-
<v-list-item-avatar><v-icon>fas fa-newspaper</v-icon></v-list-item-avatar>
67-
<v-list-item-content><v-list-item-title> Go to record </v-list-item-title></v-list-item-content>
66+
<v-avatar><v-icon>fas fa-newspaper</v-icon></v-avatar>
67+
<v-list-item-title> Go to record </v-list-item-title>
6868
</v-list-item>
6969
</v-list>
7070
</v-menu>
7171
</template>
7272

7373
<template #no-data>
7474
<v-btn
75-
class="ma-1 white--text"
75+
class="ma-1 text-white"
7676
color="orange"
7777
:disabled="loading"
7878
@click="loadEditEvents"
@@ -95,12 +95,11 @@
9595
<!-- PREVIEW RECORD -->
9696
<v-dialog v-model="showOverlay">
9797
<v-btn
98-
fab
99-
small
100-
class="grey--text absolute"
98+
size="small"
99+
class="text-grey absolute"
101100
@click="hideOverlay()"
102101
>
103-
<v-icon>fa-times</v-icon>
102+
<v-icon>fas fa-times</v-icon>
104103
</v-btn>
105104

106105
<v-card>
@@ -115,15 +114,13 @@ import moment from "moment";
115114
import {mapActions, mapState} from "vuex"
116115
117116
import Icon from "@/components/Icon";
118-
import { cleanString } from "@/utils/stringUtils"
119117
//import StatusPills from "./StatusPills";
120118
import Record from "@/views/Records/Record";
121119
122120
export default {
123121
name: "EditsTable",
124122
//components: {Icon, Record, StatusPills},
125123
components: {Icon, Record},
126-
mixins: [cleanString],
127124
data: () => {
128125
return {
129126
showOverlay: false,

src/components/Users/Profiles/Private/RecordsTable.vue

+81-85
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
/>
1919
</v-avatar>
2020
<div class="mt-1 ml-3 alignLeft">
21-
{{ item.name | cleanString }}
21+
{{ $filters.cleanString(item.name) }}
2222
</div>
2323
</div>
2424
</template>
2525
<template #[`item.type`]="{ item }">
26-
{{ item.type | cleanString }}
26+
{{ $filters.cleanString(item.type) }}
2727
</template>
2828
<template #[`item.isApproved`]="{ item }">
2929
<StatusPills
@@ -40,35 +40,34 @@
4040
/>
4141
</template>
4242
<template #[`item.actions`]="{ item }">
43-
<v-menu offset-x>
44-
<template #activator="{ on, attrs }">
43+
<v-menu>
44+
<template #activator="{ props }">
4545
<v-icon
46-
v-bind="attrs"
47-
v-on="on"
46+
v-bind="props"
4847
>
4948
fas fa-ellipsis-v
5049
</v-icon>
5150
</template>
5251
<v-list>
5352
<v-list-item @click="previewRecord(item.id)">
54-
<v-list-item-avatar><v-icon>fas fa-eye</v-icon></v-list-item-avatar>
55-
<v-list-item-content><v-list-item-title> Preview record </v-list-item-title></v-list-item-content>
53+
<v-avatar><v-icon>fas fa-eye</v-icon></v-avatar>
54+
<v-list-item-title> Preview record </v-list-item-title>
5655
</v-list-item>
5756
<v-list-item @click="goToRecord(item.id)">
58-
<v-list-item-avatar><v-icon>fas fa-newspaper</v-icon></v-list-item-avatar>
59-
<v-list-item-content><v-list-item-title> Go to record </v-list-item-title></v-list-item-content>
57+
<v-avatar><v-icon>fas fa-newspaper</v-icon></v-avatar>
58+
<v-list-item-title> Go to record </v-list-item-title>
6059
</v-list-item>
6160
<v-list-item
6261
v-if="(source !== 'maintenanceRequests' && source !== 'watchedRecords') || (source === 'watchedRecords' && user().is_curator)"
6362
@click="goToEdit(item.id)"
6463
>
65-
<v-list-item-avatar><v-icon>fas fa-pen</v-icon></v-list-item-avatar>
66-
<v-list-item-content><v-list-item-title> Edit record </v-list-item-title></v-list-item-content>
64+
<v-avatar><v-icon>fas fa-pen</v-icon></v-avatar>
65+
<v-list-item-title> Edit record </v-list-item-title>
6766
</v-list-item>
6867
</v-list>
6968
</v-menu>
7069
</template>
71-
<template slot="no-data">
70+
<template #no-data>
7271
<div>
7372
{{ noData }}
7473
<router-link
@@ -84,9 +83,8 @@
8483
<!-- PREVIEW RECORD -->
8584
<v-dialog v-model="showOverlay">
8685
<v-btn
87-
fab
88-
small
89-
class="grey--text absolute"
86+
size="small"
87+
class="text-grey absolute"
9088
@click="hideOverlay()"
9189
>
9290
<v-icon>fa-times</v-icon>
@@ -100,79 +98,77 @@
10098
</template>
10199

102100
<script>
103-
import { mapState } from "vuex"
101+
import { mapState } from "vuex"
104102
105-
import Icon from "@/components/Icon";
106-
import { cleanString } from "@/utils/stringUtils"
107-
import Record from "@/views/Records/Record";
103+
import Icon from "@/components/Icon";
104+
import Record from "@/views/Records/Record";
108105
109-
import StatusPills from "./StatusPills";
106+
import StatusPills from "./StatusPills";
110107
111-
export default {
112-
name: "RecordsTable",
113-
components: {Icon, Record, StatusPills},
114-
mixins: [cleanString],
115-
props: {
116-
records: {type: Array, default: () => []},
117-
source: { type: String, default: null }
118-
},
119-
data: () => {
120-
return {
121-
showOverlay: false,
122-
targetID: null
123-
}
124-
},
125-
computed: {
126-
...mapState('users', ['user']),
127-
headers(){
128-
let headers = [
129-
{text: 'Name', value: 'name', align: 'center'},
130-
{text: 'Registry', value: 'type', align: 'center'}
131-
];
132-
if (this.source !== 'maintenanceRequests' && this.source !== 'watchedRecords'){
133-
headers.push({text: 'Approved', value: 'isApproved', align: 'center'});
134-
}
135-
else if (this.source === 'maintenanceRequests') {
136-
headers.push({text: 'Status', value: 'status', align: 'center'});
137-
}
138-
headers.push({text: 'Actions', value: 'actions', align: 'center', sortable: false});
139-
return headers;
140-
},
141-
noData(){
142-
return {
143-
maintenanceRequests: "You do not have any maintenance requests.",
144-
createdRecords: "You did not create any record yet. Start creating one ",
145-
maintainedRecords: "You do not maintain any records.",
146-
publicMaintainedRecords: "This user does not maintain any records.",
147-
watchedRecords: "You are not watching any record."
148-
}[this.source];
149-
},
150-
perPage(){
151-
if (this.source === 'watchedRecords') return 7;
152-
return 5
153-
},
154-
footer(){
155-
if (this.source === 'watchedRecords') return {'items-per-page-options': [7]};
156-
return {'items-per-page-options': [5]}
157-
}
158-
},
159-
methods: {
160-
goToEdit(id){
161-
this.$router.push({path: `/${id}/edit`})
162-
},
163-
previewRecord(id) {
164-
this.targetID = id;
165-
this.showOverlay = true;
166-
},
167-
goToRecord(id) {
168-
window.open("/" + id, '_blank');
169-
},
170-
hideOverlay(){
171-
this.showOverlay = false;
172-
this.targetID = null;
173-
}
174-
}
108+
export default {
109+
name: "RecordsTable",
110+
components: {Icon, Record, StatusPills},
111+
props: {
112+
records: {type: Array, default: () => []},
113+
source: { type: String, default: null }
114+
},
115+
data: () => {
116+
return {
117+
showOverlay: false,
118+
targetID: null
175119
}
120+
},
121+
computed: {
122+
...mapState('users', ['user']),
123+
headers(){
124+
let headers = [
125+
{title: 'Name', value: 'name', align: 'center'},
126+
{title: 'Registry', value: 'type', align: 'center'}
127+
];
128+
if (this.source !== 'maintenanceRequests' && this.source !== 'watchedRecords'){
129+
headers.push({title: 'Approved', value: 'isApproved', align: 'center'});
130+
}
131+
else if (this.source === 'maintenanceRequests') {
132+
headers.push({title: 'Status', value: 'status', align: 'center'});
133+
}
134+
headers.push({title: 'Actions', value: 'actions', align: 'center', sortable: false});
135+
return headers;
136+
},
137+
noData(){
138+
return {
139+
maintenanceRequests: "You do not have any maintenance requests.",
140+
createdRecords: "You did not create any record yet. Start creating one ",
141+
maintainedRecords: "You do not maintain any records.",
142+
publicMaintainedRecords: "This user does not maintain any records.",
143+
watchedRecords: "You are not watching any record."
144+
}[this.source];
145+
},
146+
perPage(){
147+
if (this.source === 'watchedRecords') return 7;
148+
return 5
149+
},
150+
footer(){
151+
if (this.source === 'watchedRecords') return {'items-per-page-options': [7]};
152+
return {'items-per-page-options': [5]}
153+
}
154+
},
155+
methods: {
156+
goToEdit(id){
157+
this.$router.push({path: `/${id}/edit`})
158+
},
159+
previewRecord(id) {
160+
this.targetID = id;
161+
this.showOverlay = true;
162+
},
163+
goToRecord(id) {
164+
window.open("/" + id, '_blank');
165+
},
166+
hideOverlay(){
167+
this.showOverlay = false;
168+
this.targetID = null;
169+
}
170+
}
171+
}
176172
</script>
177173

178174
<style scoped>

0 commit comments

Comments
 (0)