Skip to content

Revert contact staff changes for now #3211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
</template>

<script lang="ts">
import { AccessType, AccountStatus, Permission, Role, SuspensionReason } from '@/util/constants'
import { AccessType, AccountStatus, Pages, Permission, Role, SuspensionReason } from '@/util/constants'
import { CreateRequestBody, OrgBusinessType } from '@/models/Organization'
import { computed, defineComponent, onBeforeUnmount, onMounted, reactive, toRefs } from '@vue/composition-api'
import { useAccount, useAccountChangeHandler } from '@/composables'
Expand Down Expand Up @@ -361,15 +361,16 @@ export default defineComponent({
isBusinessAccount: computed(() => orgStore.isBusinessAccount),
baseAddress: computed(() => currentOrgAddress.value),

isStaff: computed(() => userStore.currentUser.roles.includes(Role.Staff)) || userStore.currentUser.roles.includes(Role.ContactCentreStaff),
isStaff: computed(() => userStore.currentUser.roles.includes(Role.Staff)),
isSuspendButtonVisible: computed(() => (
(currentOrganization.value.statusCode === AccountStatus.ACTIVE ||
currentOrganization.value.statusCode === AccountStatus.SUSPENDED) &&
userStore.currentUser.roles.includes(Role.StaffSuspendAccounts)
)),
isDeactivateButtonVisible: computed(() => currentOrganization.value?.statusCode !== AccountStatus.INACTIVE),
canChangeAccessType: computed(() => userStore.currentUser.roles.includes(Role.StaffManageAccounts)) &&
!userStore.currentUser.roles.includes(Role.ContactCentreStaff),
editAccountUrl: Pages.EDIT_ACCOUNT_TYPE,
canChangeAccessType: computed(() => userStore.currentUser.roles.includes(Role.StaffManageAccounts)),
isAddressEditable: computed(() => [Permission.CHANGE_ADDRESS].some(per => permissions.value.includes(per))),
isAdminContactViewable: computed(() => [Permission.VIEW_ADMIN_CONTACT].some(per => permissions.value.includes(per))),
isAccountStatusActive: computed(() => currentOrganization.value.statusCode === AccountStatus.ACTIVE),
accountType: computed(() => {
Expand All @@ -383,8 +384,7 @@ export default defineComponent({
isAddressInfoIncomplete: computed(() => (
currentOrgAddress.value ? Object.keys(currentOrgAddress.value).length === 0 : true
)),
nameChangeNotAllowed: computed(() => (anonAccount.value || isGovmAccount.value)) &&
userStore.currentUser.roles.includes(Role.ContactCentreStaff)
nameChangeNotAllowed: computed(() => (anonAccount.value || isGovmAccount.value))
})

const suspensionSelectRules = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<template #[`item.action`]="{ item }">
<!-- Resend Invitation -->
<v-btn
v-can:EDIT_USER.hide
icon
class="mr-1"
aria-label="Resend invitation"
Expand All @@ -43,7 +42,6 @@

<!-- Remove Invitation -->
<v-btn
v-can:EDIT_USER.hide
icon
aria-label="Remove Invitation"
title="Remove Invitation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
<!-- Remove User -->
<v-btn
v-show="canRemove(item)"
v-can:EDIT_USER.hide
icon
aria-label="Remove Team Member"
title="Remove Team Member"
Expand Down Expand Up @@ -232,13 +231,12 @@
</template>

<script lang="ts">
import { AccessType, LoginSource, Permission, Role } from '@/util/constants'
import { AccessType, LoginSource, Permission } from '@/util/constants'
import { Component, Emit, Prop, Vue } from 'vue-property-decorator'
import { Member, MembershipStatus, MembershipType, Organization, RoleInfo } from '@/models/Organization'
import { mapActions, mapState } from 'pinia'
import { Business } from '@/models/business'
import CommonUtils from '@/util/common-util'
import { KCUserProfile } from 'sbc-common-components/src/models/KCUserProfile'
import ModalDialog from '@/components/auth/common/ModalDialog.vue'
import { useBusinessStore } from '@/stores/business'
import { useOrgStore } from '@/stores/org'
Expand All @@ -262,7 +260,6 @@ export interface ChangeRolePayload {
'permissions'
]),
...mapState(useUserStore, [
'currentUser',
'roleInfos'
])
},
Expand All @@ -275,7 +272,6 @@ export interface ChangeRolePayload {
})
export default class MemberDataTable extends Vue {
@Prop({ default: '' }) private userNamefilterText: string
protected readonly currentUser!: KCUserProfile
private readonly businesses!: Business[]
private activeOrgMembers!: Member[]
private readonly currentMembership!: Member
Expand Down Expand Up @@ -405,18 +401,16 @@ export default class MemberDataTable extends Vue {
}

private canChangeRole (memberBeingChanged: Member): boolean {
if (this.currentUser.roles?.includes(Role.ContactCentreStaff)) {
return false
}

if (this.currentMembership.membershipStatus !== MembershipStatus.Active) {
return false
}

switch (this.currentMembership.membershipTypeCode) {
case MembershipType.Admin:
// Owners can change roles of other users who are not owners
if (!this.isOwnMembership(memberBeingChanged)) {
if (
!this.isOwnMembership(memberBeingChanged)
) {
return true
}
// And they can downgrade their own role if there is another owner on the team
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
</template>
<template #[`item.action`]="{ item }">
<v-btn
v-can:EDIT_USER.hide
icon
class="mr-1"
aria-label="Approve user access to this account"
Expand All @@ -39,7 +38,6 @@
<v-icon>mdi-check-circle-outline</v-icon>
</v-btn>
<v-btn
v-can:EDIT_USER.hide
icon
aria-label="Deny access to this account"
title="Deny access to this account"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
Active
</v-tab>
<v-tab
v-can:INVITE_MEMBERS.hide
data-test="pending-approval-tab"
>
<v-badge
Expand All @@ -51,6 +52,7 @@
</v-badge>
</v-tab>
<v-tab
v-can:INVITE_MEMBERS.hide
data-test="invitations-tab"
>
Invitations
Expand Down
3 changes: 1 addition & 2 deletions auth-web/src/components/auth/common/ProductTOS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</div>
<v-checkbox
v-model="termsAccepted"
v-can:EDIT_USER.disabled
color="primary"
class="terms-checkbox align-checkbox-label--top ma-0 pa-0"
hide-details
Expand Down Expand Up @@ -41,7 +40,7 @@
<script lang="ts">
import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator'

@Component({})
@Component
export default class ProductTOS extends Vue {
@Prop({ default: '' }) userName: string
@Prop({ default: '' }) orgName: string
Expand Down
6 changes: 1 addition & 5 deletions auth-web/src/components/auth/common/StaffAccountsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,7 @@
</v-btn>
</template>
<v-list>
<v-list-item
v-can:VIEW_BUSINESS_REGISTRY_DASHBOARD
@click="viewInBusinessRegistryDashboard(item)"
>
<v-list-item @click="viewInBusinessRegistryDashboard(item)">
<v-list-item-subtitle>
<v-icon style="font-size: 14px">mdi-view-dashboard</v-icon>
<span class="pl-2">Business Registry Dashboard</span>
Expand All @@ -305,7 +302,6 @@

<script lang="ts">
import { AccessType, Account, AccountStatus, LoginSource, SessionStorageKeys } from '@/util/constants'

import {
DEFAULT_DATA_OPTIONS,
cachePageInfo,
Expand Down
Loading
Loading