• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FAIRsharing / fairsharing.github.io / 24769584990

22 Apr 2026 08:57AM UTC coverage: 95.892% (-4.1%) from 100.0%
24769584990

push

github

web-flow
Merge pull request #2746 from FAIRsharing/dev

Dev

3653 of 3813 branches covered (95.8%)

Branch coverage included in aggregate %.

17344 of 18229 new or added lines in 282 files covered. (95.15%)

766 existing lines in 50 files now uncovered.

38617 of 40268 relevant lines covered (95.9%)

5.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.44
/src/components/Users/UserProfileMenu.vue
1
<template>
2
  <v-menu
1✔
3
    origin="top center 0"
1✔
4
    persistent
1✔
5
    scrim
1✔
6
    stick-to-target
1✔
7
    transition="scale-transition"
1✔
8
  >
9
    <template #activator="{ props }">
1✔
10
      <div class="mr-4" v-bind="props">
1✔
11
        <v-icon
1✔
12
          v-if="!overlay"
1✔
13
          id="menu-activator"
1✔
14
          class="hamburgerIcon"
1✔
15
          color="white"
1✔
16
          icon="fas fa-bars"
1✔
17
          size="40"
1✔
18
          @click="overlay = true"
1✔
19
        />
1✔
20
        <v-icon
1✔
21
          v-else
22
          id="menu-activator"
1✔
23
          class="hamburgerIcon"
1✔
24
          color="white"
1✔
25
          icon="fas fa-xmark"
1✔
26
          size="40"
1✔
27
          @click="overlay = false"
1✔
28
        />
1✔
29
      </div>
1✔
30
    </template>
31

32
    <v-list>
1✔
33
      <v-list-item
1✔
34
        v-for="(item, index) in menuItems"
1✔
35
        :key="item.name + '_' + index"
1✔
36
        :disabled="item.isDisabled"
1✔
37
        @click="item.action()"
1✔
38
      >
39
        <v-list-item-title>
1✔
40
          {{ item.name }}
1✔
41
        </v-list-item-title>
1✔
42
      </v-list-item>
1✔
43
    </v-list>
1✔
44
  </v-menu>
1✔
45
</template>
46

47
<script>
48
import { mapActions, mapState } from "vuex";
1✔
49

50
export default {
1✔
51
  name: "UserProfileMenu",
1✔
52
  // eslint-disable-next-line vue/require-prop-types
1✔
53
  props: {
1✔
54
    viewingId: {
1✔
55
      type: Number,
1✔
56
      default: null,
1✔
57
    },
1✔
58
  },
1✔
59
  emits: ["showConfirmDelete"],
1✔
60
  data: () => {
1✔
61
    return {
15✔
62
      dialog: false,
15✔
63
      overlay: false,
15✔
64
    };
15✔
65
  },
1✔
66
  computed: {
1✔
67
    ...mapState("users", ["user"]),
1✔
68
    menuItems: function () {
1✔
69
      const _module = this;
7✔
70
      let vecReturn = [];
7✔
71
      let auxV = [
7✔
72
        {
7✔
73
          name: "Edit profile",
7✔
74
          isDisabled: _module.disableEdit(),
7✔
75
          action: function () {
7✔
76
            if (_module.viewingId === Number(_module.user().id)) {
3✔
77
              _module.$router.push({
1✔
78
                path: "/profiles/edit",
1✔
79
              });
1✔
80
            } else if (
3✔
81
              _module.viewingId !== Number(_module.user().id) &&
2✔
82
              _module.viewingId &&
2✔
83
              (_module.user().role === "developer" ||
1✔
84
                _module.user().role === "super_curator")
1✔
85
            ) {
2✔
86
              _module.$router.push({
1✔
87
                path: "/profiles/editPublicProfile/" + _module.viewingId,
1✔
88
              });
1✔
89
            } else {
1✔
90
              _module.$router.push({
1✔
91
                path: "/profiles/edit",
1✔
92
              });
1✔
93
            }
1✔
94
          },
7✔
95
        },
7✔
96
        {
7✔
97
          name: "Users List",
7✔
98
          isDisabled: _module.disableUserList(),
7✔
99
          action: function () {
7✔
100
            _module.$router.push({
1✔
101
              path: "/profiles/usersList",
1✔
102
            });
1✔
103
          },
7✔
104
        },
7✔
105
        {
7✔
106
          name: "Delete Account",
7✔
107
          isDisabled: _module.disableEdit(),
7✔
108
          action: function () {
7✔
NEW
109
            _module.$emit("showConfirmDelete", true);
×
110
          },
7✔
111
        },
7✔
112
        {
7✔
113
          name: "Reset Password",
7✔
114
          isDisabled: false,
7✔
115
          action: async function () {
7✔
116
            _module.$router.push({
1✔
117
              path: _module.resetPasswordPath(),
1✔
118
            });
1✔
119
          },
7✔
120
        },
7✔
121
        {
7✔
122
          name: "Logout",
7✔
123
          isDisabled: !_module.user().isLoggedIn,
7✔
124
          action: async function () {
7✔
125
            await _module.logoutUser();
1✔
126
          },
7✔
127
        },
7✔
128
      ];
7✔
129
      if (
7✔
130
        _module.user().role === "super_curator" ||
7✔
131
        _module.user().role === "developer"
1✔
132
      ) {
7✔
133
        vecReturn.push({
6✔
134
          name: "Curator Panel",
6✔
135
          isDisabled: false,
6✔
136
          action: function () {
6✔
137
            _module.$router.push({
1✔
138
              path: "/curator",
1✔
139
            });
1✔
140
          },
6✔
141
        });
6✔
142
      }
6✔
143
      for (let i = 0; i < auxV.length; i++) {
7✔
144
        vecReturn.push(auxV[i]);
35✔
145
      }
35✔
146
      return vecReturn;
7✔
147
    },
1✔
148
  },
1✔
149
  methods: {
1✔
150
    ...mapActions("users", ["logout"]),
1✔
151
    logoutUser: async function () {
1✔
152
      await this.logout();
1✔
153
      await this.$router.push({ name: "Login" });
1✔
154
    },
1✔
155
    disableEdit: function () {
1✔
156
      let _module = this;
17✔
157
      if (_module.viewingId) {
17✔
158
        return !(
7✔
159
          Number(_module.viewingId) === Number(_module.user().id) ||
7✔
160
          _module.user().role === "super_curator" ||
7!
NEW
161
          _module.user().role === "developer"
×
162
        );
7✔
163
      }
7✔
164
      return false;
10✔
165
    },
1✔
166
    disableUserList: function () {
1✔
167
      const _module = this;
7✔
168
      return !_module.user().is_super_curator;
7✔
169
    },
1✔
170
    resetPasswordPath: function () {
1✔
171
      if (this.user().isLoggedIn) {
3✔
172
        return "/users/password/edit";
1✔
173
      } else {
3✔
174
        return "/accounts/forgotPassword";
2✔
175
      }
2✔
176
    },
1✔
177
  },
1✔
178
};
1✔
179
</script>
180

181
<style scoped>
182
.hamburgerIcon {
183
  z-index: 2001;
184
}
185
</style>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc