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
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

.role-button {
border-radius: 10%;
padding: 4px;
padding: 4px 8px;
color: white;
display: inline-flex;
align-items: center;
cursor: pointer;
font-size: 14px;
font-size: 12px;
white-space: nowrap;
position: relative;
}
Expand Down
40 changes: 17 additions & 23 deletions src/components/UserProfile/TeamsAndProjects/UserTeamsTable.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { useEffect, useRef, useState } from 'react';
import { React, useState, useEffect, useRef } from 'react';
import { Button, Col, Input } from 'reactstrap';
import hasPermission from '../../../utils/permissions';
import './TeamsAndProjects.module.css';
import hasPermission from '../../../utils/permissions';
// import styles from './UserTeamsTable.css';
import { boxStyle, boxStyleDark } from '~/styles';

Check warning on line 6 in src/components/UserProfile/TeamsAndProjects/UserTeamsTable.jsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import of 'boxStyleDark'.

See more on https://sonarcloud.io/project/issues?id=OneCommunityGlobal_HighestGoodNetworkApp&issues=AZ58ccp0DJcDccZn7qwQ&open=AZ58ccp0DJcDccZn7qwQ&pullRequest=5313
import { connect } from 'react-redux';
import { boxStyle } from '~/styles';
import Switch from './Switch';

Check warning on line 8 in src/components/UserProfile/TeamsAndProjects/UserTeamsTable.jsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import of 'Switch'.

See more on https://sonarcloud.io/project/issues?id=OneCommunityGlobal_HighestGoodNetworkApp&issues=AZ58ccp1DJcDccZn7qwR&open=AZ58ccp1DJcDccZn7qwR&pullRequest=5313

import './UserTeamsTable.module.css';

import { AutoCompleteTeamCode } from './AutoCompleteTeamCode';

import ToggleSwitch from '../UserProfileEdit/ToggleSwitch';

import './../../Teams/Team.module.css';
import { TeamMember } from './TeamMember';
import axios from 'axios';
import { ENDPOINTS } from '~/utils/URL.js';
import { toast } from 'react-toastify';
import {
useUpdateFiltersWithIndividualCodesChangeMutation
} from '~/actions/weeklySummariesFilterAction';
import { ENDPOINTS } from '~/utils/URL.js';
import './../../Teams/Team.module.css';
import { TeamMember } from './TeamMember';

const UserTeamsTable = props => {
const { darkMode } = props;
Expand Down Expand Up @@ -163,21 +164,17 @@
/>
<div style={{ display: 'flex', flexDirection: 'column' }}>
{props.canEditVisibility && (
<div className="row" style={{ alignItems: 'center' }}>
<div className="row">
<Col
md="7"
xs="12"
style={{
backgroundColor: darkMode ? '#1C2541' : '#e9ecef',
border: '1px solid #ced4da',
marginBottom: '10px',
display: 'flex',
alignItems: 'center',
padding: '10px 15px',
minHeight: '45px',
}}
>
<span className="teams-span" style={{fontWeight: 'bold'}}>Visibility</span>
<span className="teams-span">Visibility</span>
</Col>
<Col
md="5"
Expand All @@ -199,28 +196,25 @@
</Col>
</div>
)}
<div className="row" style={{ alignItems: 'center' }}>
<div className="row">
<Col
md="9"
xs="12"
style={{
backgroundColor: darkMode ? '#1C2541' : '#e9ecef',
border: '1px solid #ced4da',
marginBottom: '10px',
display: 'flex',
alignItems: 'center',
padding: '10px 15px',
minHeight: '45px',
backgroundColor: darkMode ? '#1C2541' : '#e9ecef',
border: '1px solid #ced4da',
marginBottom: '10px',
height: '10%',
}}
>
<span className="teams-span" style={{fontWeight: 'bold'}}>Teams</span>
<span className="teams-span">Teams</span>
</Col>
<Col md="3" xs="12" style={{ padding: '0', marginBottom: '10px', border: '1px solid #ced4da', minHeight: '45px', display: 'flex', alignItems: 'center' }}>
<Col md="3" xs="12" style={{ padding: '0', marginBottom: '10px' }}>
<Input
id="teamCode"
value={teamCode}
onChange={handleCodeChange}
style={darkMode ? {...colordark, border: 'none', height: '100%'} : {...styleDefault, border: 'none', height: '100%'}}
style={darkMode ? colordark : styleDefault}
placeholder="X-XXX"
onFocus={() => !showDropdown && setShowDropdown(true)}
disabled={!props.canEditTeamCode}
Expand Down
7 changes: 1 addition & 6 deletions src/components/Warnings/Warnings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,9 @@ export default function Warning({
if (showTrackers) {
setToggle(true);
if (usersWarnings.length === 0) {
const index = Array.from(personId ?? '').reduce(
(acc, c) => acc + (c.codePointAt(0) ?? 0),
0,
);
const delay = index % 5000;
const timer = setTimeout(() => {
fetchUsersWarningsById();
}, delay);
}, 100);
return () => clearTimeout(timer);
}
} else {
Expand Down
12 changes: 3 additions & 9 deletions src/services/httpService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { isCancel } from 'axios';
import axios from 'axios';
import { toast } from 'react-toastify';
import logService from './logService';

Expand All @@ -9,14 +9,8 @@ if (axios.defaults && axios.defaults.headers && axios.defaults.headers.post) {
if (axios.interceptors && axios.interceptors.response && axios.interceptors.response.use) {
axios.interceptors.response.use(null, error => {
if (!(error.response && error.response.status >= 400 && error.response.status <= 500)) {
if (
!isCancel(error) &&
error.code !== 'ERR_INSUFFICIENT_RESOURCES' &&
error.code !== 'ERR_NETWORK'
) {
logService.logError(error);
toast.error('An unexpected error occurred.');
}
logService.logError(error);
toast.error('An unexpected error occurred.');
}
return Promise.reject(error);
});
Expand Down
Loading