Skip to content

Commit 2a493cd

Browse files
committed
feat: Bring back team overview
But place it in the members modal next to the name of the collective, instead of bloating the landing page. Signed-off-by: Peymaneh <peymaneh@posteo.net>
1 parent 4b27a28 commit 2a493cd

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/components/Nav/CollectiveMembersModal.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
size="normal"
1010
@closing="onClose">
1111
<div class="modal-collective-members">
12+
<a
13+
v-if="showTeamLink"
14+
class="team-link"
15+
:href="teamUrl"
16+
:title="t('collectives', 'Team overview')"
17+
target="_blank">
18+
<OpenInNewIcon :size="20" />
19+
</a>
1220
<MemberPicker
1321
:show-current="true"
1422
:circle-id="collective.circleId"
@@ -21,19 +29,23 @@
2129

2230
<script>
2331
import { t } from '@nextcloud/l10n'
32+
import { generateUrl } from '@nextcloud/router'
2433
import { mapActions, mapState } from 'pinia'
2534
import NcDialog from '@nextcloud/vue/components/NcDialog'
35+
import OpenInNewIcon from 'vue-material-design-icons/OpenInNew.vue'
2636
import MemberPicker from '../Member/MemberPicker.vue'
2737
import { autocompleteSourcesToCircleMemberTypes, circlesMemberTypes } from '../../constants.js'
2838
import { useCirclesStore } from '../../stores/circles.js'
2939
import { useCollectivesStore } from '../../stores/collectives.js'
40+
import { useRootStore } from '../../stores/root.js'
3041
3142
export default {
3243
name: 'CollectiveMembersModal',
3344
3445
components: {
3546
MemberPicker,
3647
NcDialog,
48+
OpenInNewIcon,
3749
},
3850
3951
props: {
@@ -46,10 +58,23 @@ export default {
4658
computed: {
4759
...mapState(useCirclesStore, ['circleMembersSorted']),
4860
...mapState(useCollectivesStore, ['isCollectiveAdmin']),
61+
...mapState(useRootStore, ['isPublic']),
4962
5063
currentUserIsAdmin() {
5164
return this.isCollectiveAdmin(this.collective)
5265
},
66+
67+
teamUrl() {
68+
return generateUrl('/apps/contacts/circle/{teamId}', { teamId: this.collective.circleId })
69+
},
70+
71+
hasContactsApp() {
72+
return 'contacts' in window.OC.appswebroots
73+
},
74+
75+
showTeamLink() {
76+
return this.hasContactsApp && !this.isPublic
77+
},
5378
},
5479
5580
beforeMount() {
@@ -82,9 +107,35 @@ export default {
82107
</script>
83108

84109
<style lang="scss" scoped>
110+
:deep(.modal-container__content) {
111+
position: relative;
112+
}
113+
85114
.modal-collective-members {
86115
height: 550px;
87116
max-height: 80vh;
88117
padding-bottom: 12px;
89118
}
119+
120+
.team-link {
121+
position: absolute;
122+
top: 0;
123+
right: 12px;
124+
display: flex;
125+
align-items: center;
126+
height: var(--default-clickable-area);
127+
color: var(--color-text-maxcontrast);
128+
text-decoration: none;
129+
130+
&:hover,
131+
&:focus-visible {
132+
color: var(--color-primary-element);
133+
transition: color var(--animation-quick) ease;
134+
}
135+
136+
&:focus-visible {
137+
outline: 2px solid var(--color-main-text);
138+
border-radius: var(--border-radius-small);
139+
}
140+
}
90141
</style>

0 commit comments

Comments
 (0)