Skip to content

Commit

Permalink
Merge pull request #2502 from techmatters/CHI-2905-remove-teamsview-flag
Browse files Browse the repository at this point in the history
CHI 2905 Remove Teams view flag
  • Loading branch information
mythilytm authored Aug 23, 2024
2 parents 70fd21c + 0d02286 commit 1a2cafa
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 29 deletions.
1 change: 0 additions & 1 deletion plugin-hrm-form/src/components/teamsView/AgentColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { AgentFullName, StyledChip } from './styles';
const MAX_NAME_LENGTH = 18;

export const setUpAgentColumn = () => {
if (!getAseloFeatureFlags().enable_teams_view_enhancements) return;
if (!getAseloFeatureFlags().enable_teams_view_enhancements2) return;

const agentSortingFn = (a: any, b: any): number => {
Expand Down
3 changes: 0 additions & 3 deletions plugin-hrm-form/src/components/teamsView/SkillsColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ import { WorkersDataTable, ColumnDefinition, Template } from '@twilio/flex-ui';
import { Tooltip } from '@material-ui/core';

import { OpaqueText } from '../../styles';
import { getAseloFeatureFlags } from '../../hrmConfig';
import { SkillsList, StyledChip } from './styles';
import { sortSkills } from './teamsViewSorting';

const MAX_SKILL_LENGTH = 12;

export const setUpSkillsColumn = () => {
if (!getAseloFeatureFlags().enable_teams_view_enhancements) return;

WorkersDataTable.Content.add(
<ColumnDefinition
key="skills"
Expand Down
1 change: 0 additions & 1 deletion plugin-hrm-form/src/components/teamsView/StatusColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { StatusActivityName } from './styles';
const MAX_STATUS_LENGTH = 12;

export const setUpStatusColumn = () => {
if (!getAseloFeatureFlags().enable_teams_view_enhancements) return;
if (!getAseloFeatureFlags().enable_teams_view_enhancements2) return;

WorkersDataTable.Content.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program. If not, see https://www.gnu.org/licenses/.
*/

import { getAseloFeatureFlags, getTemplateStrings } from '../../hrmConfig';
import { getTemplateStrings } from '../../hrmConfig';
import { getInitializedCan, PermissionActions } from '../../permissions';

const TRUNCATED_IDENTIFIER_LENGTH = 4;
Expand All @@ -23,8 +23,6 @@ const TRUNCATED_QUEUE_LENGTH = 10;

// This function customises the TaskCard meant for Call channel
export const setCallTaskCardString = channel => {
if (!getAseloFeatureFlags().enable_teams_view_enhancements) return;

const can = getInitializedCan();
const maskIdentifiers = !can(PermissionActions.VIEW_IDENTIFIERS);

Expand All @@ -42,8 +40,6 @@ export const setCallTaskCardString = channel => {

// This function customises the TaskCard meant for all Chat channels
export const setChatTaskCardString = channel => {
if (!getAseloFeatureFlags().enable_teams_view_enhancements) return;

const can = getInitializedCan();
const maskIdentifiers = !can(PermissionActions.VIEW_IDENTIFIERS);

Expand Down
9 changes: 1 addition & 8 deletions plugin-hrm-form/src/components/teamsView/teamsViewFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import type { FilterDefinitionFactory } from '@twilio/flex-ui/src/components/vie
import { Manager, FiltersListItemType, TeamsView, WorkerDirectoryTabs } from '@twilio/flex-ui';
import sortBy from 'lodash/sortBy';

import { getAseloFeatureFlags } from '../../hrmConfig';

const activityNoOfflineByDefault: FilterDefinitionFactory = (appState, _teamFiltersPanelProps) => {
const activitiesArray = Array.from(appState.flex.worker.activities.values());

Expand Down Expand Up @@ -74,12 +72,7 @@ const disabledSkillsFilterDefinition: FilterDefinitionFactory = () => {
* The skills filter is included if the feature flag is enabled.
*/
export const setUpTeamsViewFilters = () => {
TeamsView.defaultProps.filters = [
activityNoOfflineByDefault,
...(getAseloFeatureFlags().enable_teams_view_enhancements
? [skillsFilterDefinition, disabledSkillsFilterDefinition]
: []),
];
TeamsView.defaultProps.filters = [activityNoOfflineByDefault, skillsFilterDefinition, disabledSkillsFilterDefinition];
};

export const setUpWorkerDirectoryFilters = () => {
Expand Down
4 changes: 0 additions & 4 deletions plugin-hrm-form/src/components/teamsView/teamsViewSorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import { AgentsDataTable, TaskHelper, Manager } from '@twilio/flex-ui';
import { SupervisorWorkerState } from '@twilio/flex-ui/src/state/State.definition';

import { getAseloFeatureFlags } from '../../hrmConfig';

const activities = Manager.getInstance()?.store.getState()?.flex?.worker?.activities;
const WORKER_ACTIVITIES = activities
? Array.from(activities.values()).reduce((accum, activity, currIndex) => {
Expand Down Expand Up @@ -232,8 +230,6 @@ export const sortStatusColumn = (a: SupervisorWorkerState, b: SupervisorWorkerSt

// Set up the sorting for default Teams View columns (Workers, Calls, Tasks)
export const setUpTeamsViewSorting = () => {
if (!getAseloFeatureFlags().enable_teams_view_enhancements) return;

AgentsDataTable.defaultProps.sortCalls = sortWorkersByCallDuration;
AgentsDataTable.defaultProps.sortTasks = sortWorkersByChatDuration;
AgentsDataTable.defaultProps.sortWorkers = sortWorkersByActivity;
Expand Down
3 changes: 1 addition & 2 deletions plugin-hrm-form/src/maskIdentifiers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import { Strings, TaskChannelDefinition, MessagingCanvas, MessageList } from '@twilio/flex-ui';

import { getInitializedCan, PermissionActions } from '../permissions';
import { getAseloFeatureFlags } from '../hrmConfig';

// Mask identifiers in the channel strings
export const maskChannelStringsWithIdentifiers = (channelType: TaskChannelDefinition) => {
Expand Down Expand Up @@ -46,7 +45,7 @@ export const maskChannelStringsWithIdentifiers = (channelType: TaskChannelDefini
Supervisor.TaskCanvasHeader.title = 'MaskIdentifiers';

// Task Status in Agents page
if (!getAseloFeatureFlags().enable_teams_view_enhancements) TaskCard.firstLine = 'MaskIdentifiers';
TaskCard.firstLine = 'MaskIdentifiers';

Supervisor.TaskOverviewCanvas.firstLine = 'MaskIdentifiers';
};
Expand Down
1 change: 0 additions & 1 deletion plugin-hrm-form/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ export type FeatureFlags = {
enable_save_insights: boolean; // Enables Saving Aditional Data on Insights
enable_separate_timeline_view: boolean; // Enables a limited inline case timelinbe with a link to the full timeline
enable_sort_cases: boolean; // Enables Sorting at Case List
enable_teams_view_enhancements: boolean; // Enables custom Teams View UI
enable_teams_view_enhancements2: boolean; // Enables custom Teams View UI with labels
enable_transfers: boolean; // Enables Transfering Contacts
enable_twilio_transcripts: boolean; // Enables Viewing Transcripts Stored at Twilio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"enable_resources": true,
"enable_resources_elastic_search": true,
"enable_save_insights": true,
"enable_teams_view_enhancements": true,
"enable_teams_view_enhancements2": true,
"enable_voice_recordings": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"enable_dual_write": false,
"enable_emoji_picker": true,
"enable_external_transcripts": true,
"enable_twilio_transcripts": false,
"enable_filter_cases": true,
"enable_fullstory_monitoring": true,
"enable_last_case_status_update_info": true,
Expand All @@ -73,8 +72,8 @@
"enable_save_insights": true,
"enable_separate_timeline_view": true,
"enable_sort_cases": true,
"enable_teams_view_enhancements": true,
"enable_transfers": true,
"enable_twilio_transcripts": false,
"enable_upload_documents": true,
"enable_voice_recordings": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"enable_csam_clc_report": false,
"enable_lex": false,
"enable_save_insights": true,
"enable_teams_view_enhancements": true,
"enable_voice_recordings": false
},
"hrm_base_url": "https://hrm-test.tl.techmatters.org",
Expand Down

0 comments on commit 1a2cafa

Please sign in to comment.