Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion src/components/CircleDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,38 @@
<div class="circle-details__main-content">
<!-- not a member -->
<template v-if="!circle.isMember">
<!-- Pending invitation validation -->
<div v-if="circle.isInvitedMember" class="pending-invitation">
<h2>
{{ t('contacts', 'You have to accept or refuse the invitation to join this team') }}

Check failure on line 197 in src/components/CircleDetails.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected indentation of 7 tabs but found 6 tabs
</h2>

<div class="buttons">
<NcButton
:disabled="loadingJoin"
class="primary"
@click="joinCircle">
<template #icon>
<LoginIcon :size="16" />
</template>
{{ t('contacts', 'Accept invitation') }}
</NcButton>

<NcButton
:disabled="loadingLeave"
variant="warning"
@click="confirmLeaveCircle">
<template #icon>
<LogoutIcon :size="16" />
</template>
{{ t('contacts', 'Refuse invitation') }}
</NcButton>
</div>
</div>

<!-- Pending request validation -->
<NcEmptyContent
v-if="circle.isPendingMember"
v-else-if="circle.isPendingMember"
:name="t('contacts', 'Your request to join this team is pending approval')">
<template #icon>
<NcLoadingIcon :size="20" />
Expand Down Expand Up @@ -1062,6 +1091,17 @@
.circle-details__main-content {
margin-inline-start: 99px;

.pending-invitation {
text-align: center;

.buttons {
display: flex;
flex-direction: row;
justify-content: center;
gap: 24px;
}
}

@media (max-width: 768px) {
margin-inline-start: 0;
}
Expand Down
4 changes: 4 additions & 0 deletions src/models/circle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export default class Circle {
* Is the initiator a member of this circle?
*/
get isMember(): boolean | 0 | undefined
/**
* Is the initiator an invited member of this circle, waiting an approval?
*/
get isInvitedMember(): boolean
/**
* Is the initiator a pending member of this circle?
*/
Expand Down
9 changes: 8 additions & 1 deletion src/models/circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { CircleConfigs, MemberLevels, ROUTE_CIRCLE } from './constants.ts'
import { CircleConfigs, MemberLevels, MemberStatus, ROUTE_CIRCLE } from './constants.ts'
import Member from './member.ts'

type MemberList = Record<string, Member>
Expand Down Expand Up @@ -269,6 +269,13 @@ export default class Circle {
&& this.initiator?.level > MemberLevels.NONE
}

/**
* Is the initiator an invited member of this circle, waiting an approval?
*/
get isInvitedMember() {
return this.initiator?.status === MemberStatus.INVITED
}

/**
* Is the initiator a pending member of this circle?
*/
Expand Down
Loading