Skip to content

Commit

Permalink
Merge pull request #2123 from ever-co/fix/deepScans
Browse files Browse the repository at this point in the history
Fix: DeepScan Errors
  • Loading branch information
evereq authored Jan 26, 2024
2 parents 87222fd + 8d8fe5d commit 36c7dc6
Show file tree
Hide file tree
Showing 32 changed files with 56 additions and 65 deletions.
2 changes: 1 addition & 1 deletion apps/mobile/app/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ComponentType } from 'react';
import { Pressable, PressableProps, PressableStateCallbackType, StyleProp, TextStyle, ViewStyle } from 'react-native';
import { colors, spacing, typography } from '../theme';
import { colors, spacing } from '../theme';
import { Text, TextProps } from './Text';

type Presets = keyof typeof $viewPresets;
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/components/LabelItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, { FC, ReactNode } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { typography } from '../theme';
import { limitTextCharaters } from '../helpers/sub-text';
// import { limitTextCharaters } from '../helpers/sub-text';

interface Props {
label: string;
Expand Down
8 changes: 4 additions & 4 deletions apps/mobile/app/components/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ function Switch(props: ToggleInputProps) {

const offsetLeft = ($innerStyleOverride?.paddingStart ||
$innerStyleOverride?.paddingLeft ||
$switchInner?.paddingStart ||
$switchInner?.paddingLeft ||
$switchInner.paddingStart ||
$switchInner.paddingLeft ||
0) as number;

const offsetRight = ($innerStyleOverride?.paddingEnd ||
$innerStyleOverride?.paddingRight ||
$switchInner?.paddingEnd ||
$switchInner?.paddingRight ||
$switchInner.paddingEnd ||
$switchInner.paddingRight ||
0) as number;

const start = withTiming(on ? '100%' : '0%');
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/models/task/Task.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { types } from 'mobx-state-tree';
// import { types } from 'mobx-state-tree';
import { ITeamTask } from '../../services/interfaces/ITask';

export interface ITaskCreateParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';
import { Card } from 'react-native-paper';
import { Skeleton } from 'react-native-skeletons';
import { useOrganizationTeam } from '../../../../services/hooks/useOrganization';
// import { useOrganizationTeam } from '../../../../services/hooks/useOrganization';
import { useAppTheme } from '../../../../theme';

const ProfileScreenSkeleton = () => {
const { colors, dark } = useAppTheme();
const { isTeamManager } = useOrganizationTeam();
// const { isTeamManager } = useOrganizationTeam();

const MemberCard = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { View, StyleSheet, TextInput, Text } from 'react-native';
import { FontAwesome, AntDesign, Entypo } from '@expo/vector-icons';
import { View, StyleSheet, Text } from 'react-native';
import { FontAwesome, AntDesign } from '@expo/vector-icons';
import { typography, useAppTheme } from '../../../../theme';

type ITasDisplayBox = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function getOrganizationTeamRequest(
params[`relations[${i}]`] = rl;
});

const queries = new URLSearchParams(params || {});
const queries = new URLSearchParams(params);
return serverFetch<IOrganizationTeamWithMStatus>({
path: `/organization-team/${teamId}?${queries.toString()}`,
method: 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function useTeamMemberCard(member: IOrganizationTeamList["members"][numbe
const taskStatistics =
tasksStatisticsState?.all.find((statistics) => statistics.id === responseTask.id) ||
[]
responseTask.totalWorkedTime = taskStatistics?.duration || 0
responseTask.totalWorkedTime = taskStatistics.duration || 0
}

return responseTask
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/services/hooks/useLanguageModal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import { ILanguageItemList } from '../interfaces/IUserData';

export function useLanguageModal() {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/services/hooks/useOrganization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function useOrganizationTeam() {
getOrganizationTeam();
}, [organizationTeams]);

const activeTeamManagers = members?.filter((m) => m.role?.name === 'MANAGER');
const activeTeamManagers = members.filter((m) => m.role?.name === 'MANAGER');

const isManager = () => {
if (activeTeam) {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/services/hooks/useTimezoneModal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';

export function useTimezoneModal() {
const [isModalOpen, setIsModalOpen] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/[locale]/settings/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Team = () => {
{!user ? (
<SettingsTeamSkeleton />
) : (
<MainLayout className="items-start pb-1">
<MainLayout className="items-start pb-1 max-h-s">
<div className="pt-12 pb-4 bg-white dark:bg-dark--theme">
<Container>
<div className="flex items-center gap-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const TaskSecondaryInfo = () => {
taskStatusClassName="text-[0.625rem] h-[1.5625rem] max-w-[7.6875rem] rounded 3xl:text-xs"
/>
</TaskRow>
{tags && tags.length > 0 && (
{tags.length > 0 && (
<TaskRow>
<div className="flex flex-row flex-wrap gap-1 max-w-[10rem]">
{tags.map((tag, i) => {
Expand Down Expand Up @@ -225,11 +225,11 @@ const TaskSecondaryInfo = () => {
const EpicParent = ({ task }: { task: ITeamTask }) => {
const t = useTranslations();

if (task.issueType === 'Story') {
if (task?.issueType === 'Story') {
return <></>;
}

return (!task.issueType || task.issueType === 'Task' || task.issueType === 'Bug') && task?.rootEpic ? (
return (!task?.issueType || task?.issueType === 'Task' || task?.issueType === 'Bug') && task?.rootEpic ? (
<TaskRow labelTitle={t('pages.taskDetails.EPIC')}>
<Tooltip label={`#${task?.rootEpic?.number} ${task?.rootEpic?.title}`} placement="auto">
<Link href={`/task/${task?.rootEpic?.id}`} target="_blank">
Expand Down
6 changes: 3 additions & 3 deletions apps/web/components/shared/collaborate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const Collaborate = () => {
<CommandGroup className="p-2">
{members.map((member) => (
<CommandItem
key={member.id}
key={member?.id}
className="flex items-center px-2 cursor-pointer"
onSelect={() => {
handleMemberClick(member);
Expand Down Expand Up @@ -135,7 +135,7 @@ const Collaborate = () => {
<p className="text-sm font-medium leading-none">{member?.name}</p>
<p className="text-xs text-muted-foreground">{member?.email}</p>
</div>
{selectedMemberIds.includes(member.id) ? (
{selectedMemberIds.includes(member?.id) ? (
<Check className="flex w-5 h-5 ml-auto text-primary dark:text-white" />
) : null}
</CommandItem>
Expand All @@ -148,7 +148,7 @@ const Collaborate = () => {
<div className="flex -space-x-3.5 overflow-hidden">
{collaborativeMembers.map((member) => (
<div
key={member.id}
key={member?.id}
className={clsxm(
'w-[2rem] h-[2rem]',
'flex justify-center items-center',
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/shared/tasks/assigned-tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const AssignedTask = ({ now = false, task }: ITaskDetailCard) => {
<div className="flex items-center justify-between ">
<div
className={`text-black dark:text-[#FFFFFF] text-[14px] ${
now == true ? 'font-semibold' : 'font-semibold'
now == true ? 'font-semibold' : 'font-normal'
} w-[413px]`}
>
{`#${task && task.taskNumber} `} {task && task.title}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/shared/tasks/unassigned-task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const UnAssignedTask = ({ now = false, task }: ITaskDetailCard) => {
<div className="flex items-center justify-between ">
<div
className={`text-black dark:text-[#FFFFFF] text-[14px] ${
now == true ? 'font-semibold' : 'font-semibold'
now == true ? 'font-semibold' : 'font-medium'
} w-[413px]`}
>
{`#${task && task.taskNumber} `} {task && task.title}
Expand Down
6 changes: 2 additions & 4 deletions apps/web/lib/components/color-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const ColorPicker = ({
<div className="flex mr-[0.5rem] gap-3">
<button
disabled={!isTeamManager}
className={`outline-none ${!isTeamManager && 'pointer-events-none'} z-50`}
className={`outline-none z-50`}
onClick={() => {
setDisabled(!disabled);
}}
Expand All @@ -107,9 +107,7 @@ export const ColorPicker = ({
setColor(null);
onChange && onChange(null);
}}
className={`outline-none ${
!isTeamManager ? 'pointer-events-none' : 'cursor-pointer'
}`}
className={`outline-none ${'cursor-pointer'}`}
>
<TrashIcon />
</span>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/lib/components/emoji-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const EmojiPicker = ({
<div className="flex mr-[0.5rem] gap-3">
<button
disabled={!isTeamManager}
className={`outline-none ${!isTeamManager && 'pointer-events-none'}`}
className={`outline-none `}
onClick={() => {
setDisabled(!disabled);
}}
Expand All @@ -97,7 +97,7 @@ export const EmojiPicker = ({
setValue(null);
onChange('');
}}
className={`outline-none ${!isTeamManager && 'pointer-events-none'}`}
className={`outline-none `}
>
<TrashIcon />
</button>
Expand Down
1 change: 0 additions & 1 deletion apps/web/lib/components/inputs/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export const TimeInputField = forwardRef<HTMLInputElement, ITimeProps>(
<input
type={type}
ref={ref}
defaultValue={value === undefined ? '00' : undefined}
value={value}
{...res}
className={clsxm('outline-none p-0 bg-transparent w-full text-center', className)}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/components/svgs/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ export function UncheckedBoxIcon({ className }: IClassName) {
<path
d="M5.8125 13.625H9.1875C12 13.625 13.125 12.5 13.125 9.6875V6.3125C13.125 3.5 12 2.375 9.1875 2.375H5.8125C3 2.375 1.875 3.5 1.875 6.3125V9.6875C1.875 12.5 3 13.625 5.8125 13.625Z"
stroke="#292D32"
stroke-opacity="0.4"
strokeOpacity="0.4"
strokeWidth="1.2"
strokeLinecap="round"
strokeLinejoin="round"
Expand Down
8 changes: 6 additions & 2 deletions apps/web/lib/components/typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,13 @@ Text.Heading.displayName = 'TextHeading';
* <label /> by custom
*/
Text.Label = forwardRef<HTMLLabelElement, Props & React.ComponentPropsWithRef<'label'>>(
({ children, className, ...rest }) => {
({ children, className, ...rest }, ref) => {
return (
<label className={clsxm('ml-2 text-sm font-medium text-gray-900 dark:text-gray-300', className)} {...rest}>
<label
ref={ref}
className={clsxm('ml-2 text-sm font-medium text-gray-900 dark:text-gray-300', className)}
{...rest}
>
{children}
</label>
);
Expand Down
4 changes: 2 additions & 2 deletions apps/web/lib/features/task/task-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function TaskCard(props: Props) {
</div>

{/* TaskCardMenu */}
{task && memberInfo && currentMember && (
{task && currentMember && (
<TaskCardMenu task={task} loading={loading} memberInfo={memberInfo} viewType={viewType} />
)}
</div>
Expand Down Expand Up @@ -235,7 +235,7 @@ export function TaskCard(props: Props) {

<ActiveTaskStatusDropdown task={task || null} onChangeLoading={(load) => setLoading(load)} />

{task && memberInfo && currentMember && (
{task && currentMember && (
<TaskCardMenu task={task} loading={loading} memberInfo={memberInfo} viewType={viewType} />
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/features/task/task-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function useActiveTaskStatus<T extends ITaskStatusField>(

const { item, items, onChange } = useStatusValue<T>({
status: status,
value: props.defaultValue ? props.defaultValue : task ? task[field] : props.defaultValue || undefined,
value: props.defaultValue ? props.defaultValue : task ? task[field] : undefined,
onValueChange: onItemChange,
defaultValues: props.defaultValues
});
Expand Down
8 changes: 4 additions & 4 deletions apps/web/lib/features/team-member-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import get from 'lodash/get';
export function TaskCell({ row }: { row: any }) {
const member = row.original as OT_Member;
const memberInfo = useTeamMemberCard(member);
const taskEdition = useTMCardTaskEdit(memberInfo?.memberTask);
const taskEdition = useTMCardTaskEdit(memberInfo.memberTask);
const publicTeam = false;

return (
Expand Down Expand Up @@ -43,8 +43,8 @@ export function WorkedOnTaskCell({ row }: { row: any }) {
<TaskTimes
activeAuthTask={true}
memberInfo={memberInfo}
task={memberInfo?.memberTask}
isAuthUser={memberInfo?.isAuthUser}
task={memberInfo.memberTask}
isAuthUser={memberInfo.isAuthUser}
className="2xl:w-32 3xl:w-[8rem] min-w-[15rem] w-52 lg:w-1/5 flex flex-col gap-y-[1.125rem] justify-center"
/>
);
Expand All @@ -53,7 +53,7 @@ export function WorkedOnTaskCell({ row }: { row: any }) {
export function TaskEstimateInfoCell({ row }: { row: any }) {
const member = row.original as OT_Member;
const memberInfo = useTeamMemberCard(member);
const taskEdition = useTMCardTaskEdit(memberInfo?.memberTask);
const taskEdition = useTMCardTaskEdit(memberInfo.memberTask);

return (
<TaskEstimateInfo
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/features/team-members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function TeamMembers({ publicTeam = false, kanbanView: view = IssuesView.
const orderedMembers = [...members].sort((a, b) => (sortByWorkStatus(a, b) ? -1 : 1));

const blockViewMembers =
activeFilter == 'all' ? orderedMembers : orderedMembers.filter((m) => m.timerStatus == activeFilter) || [];
activeFilter == 'all' ? orderedMembers : orderedMembers.filter((m) => m.timerStatus === activeFilter) || [];

const currentUser = members.find((m) => m.employee.userId === user?.id);
const $members = members
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/features/team/team-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function TeamItem({
style={{
background: color || `${stc(title)}80`,

...(color ? { color: color ? readableColorHex : undefined } : {})
...(color ? { color: readableColorHex } : {})
}}
>
{logo && isValidUrl(logo) ? (
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/settings/integration-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const IntegrationSetting = () => {
} as { [x: string]: string };
}, [locale]);

const queries = new URLSearchParams(params || {});
const queries = new URLSearchParams(params);
const url = `https://github.com/apps/${GITHUB_APP_NAME.value}/installations/new?${queries.toString()}`;

const { activeTeam } = useOrganizationTeams();
Expand Down
6 changes: 3 additions & 3 deletions apps/web/lib/settings/issue-types-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ export const IssueTypesForm = () => {
issueTypes.map((type) => (
<StatusesListCard
key={type.id}
statusTitle={type?.name ? type?.name?.split('-').join(' ') : ''}
bgColor={type?.color || ''}
statusIcon={type?.fullIconUrl || ''}
statusTitle={type.name ? type.name?.split('-').join(' ') : ''}
bgColor={type.color || ''}
statusIcon={type.fullIconUrl || ''}
onEdit={() => {
setCreateNew(false);
setEdit(type);
Expand Down
10 changes: 1 addition & 9 deletions apps/web/lib/settings/member-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,7 @@ export const MemberTable = ({ members }: { members: OT_Member[] }) => {
</td>
<td className="py-4 text-sm font-semibold">
{/* TODO dynamic */}
<MemberTableStatus
status={
member.employee.isActive
? 'Member'
: !member.employee.isActive
? 'Suspended'
: 'Left'
}
/>
<MemberTableStatus status={member.employee.isActive ? 'Member' : 'Suspended'} />
</td>
<td className="flex items-center justify-center py-4">
<TableActionPopover member={member} handleEdit={handleEdit} />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/settings/team-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const TeamAvatar = ({ disabled, bgColor }: { disabled: boolean; bgColor?:
)}
style={{
backgroundColor: bgColor || `${stc(activeTeam?.name || '')}80`,
...(bgColor ? { color: bgColor ? readableColorHex : undefined } : {})
...(bgColor ? { color: readableColorHex } : {})
}}
>
{activeTeam?.image?.thumbUrl || activeTeam?.image?.fullUrl ? (
Expand Down
6 changes: 2 additions & 4 deletions apps/web/lib/settings/team-size-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ const TeamSize = ({
</div>
{isTeamManager && (
<button
className={`flex mr-[0.5rem] gap-3 outline-none ${
!isTeamManager && 'pointer-events-none'
}`}
disabled={!isTeamManager}
className={`flex mr-[0.5rem] gap-3 outline-none`}
disabled={false}
onClick={() => {
setDisabled(!disabled);
}}
Expand Down
Loading

0 comments on commit 36c7dc6

Please sign in to comment.