Skip to content

Commit

Permalink
Merge pull request #2164 from ever-co/2163-fix-deepscan-linting-issue…
Browse files Browse the repository at this point in the history
…s-in-full-app

fix(DeepScan): fix the regex and unused imports and conditional rende…
  • Loading branch information
evereq authored Feb 5, 2024
2 parents 402764a + 65e4814 commit 4d3b1c1
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 17 deletions.
6 changes: 3 additions & 3 deletions apps/extensions/components/popup/Tasks.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import classNames from 'classnames';
import React, { useEffect, useRef, useState } from 'react';
import { act } from 'react-dom/test-utils';
import React, { useEffect, useState } from 'react';

import AppDropdown from '~components/shared/AppDropdown';
import { roundInput, textEllipsis } from '~misc/tailwindClasses';
Expand Down Expand Up @@ -135,7 +134,8 @@ const Tasks: React.FC<Props> = ({ port }) => {
'ml-2 bg-slate-900 text-white rounded p-2',
isEmptyEstimate() && 'bg-slate-600'
)}
onClick={addNewTask}>
onClick={addNewTask}
>
Add Task
</button>
)}
Expand Down
1 change: 0 additions & 1 deletion apps/extensions/components/popup/Timer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import classNames from 'classnames';
import React, { useEffect, useState } from 'react';

import browser from '~misc/browser';
import { MessageTypesFromBackgroundEnum, MessageTypesToBackgroundEnum } from '~typescript/enums/MessageTypesEnum';
import { TimerStateEnum } from '~typescript/enums/TimerStateEnum';
import type { IPostMessage } from '~typescript/interfaces/PostMessage';
Expand Down
5 changes: 1 addition & 4 deletions apps/extensions/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import Timer from '~components/popup/Timer';
import './style.css';

import browser from '~misc/browser';
import { MessageTypesFromBackgroundEnum } from '~typescript/enums/MessageTypesEnum';
import { TimerStateEnum } from '~typescript/enums/TimerStateEnum';
import { IPostMessage } from '~typescript/interfaces/PostMessage';
import { ITimerUpdate } from '~typescript/interfaces/TimerUpdate';


function IndexPopup() {
const [port, setPort] = useState<chrome.runtime.Port | null>(null);
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function Icon(props: IconProps) {
} = props;

const isPressable = !!WrapperProps.onPress;
const Wrapper: ComponentType<TouchableOpacityProps> = WrapperProps?.onPress ? TouchableOpacity : View;
const Wrapper: ComponentType<TouchableOpacityProps> = WrapperProps && WrapperProps?.onPress ? TouchableOpacity : View;

return (
<Wrapper
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/helpers/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export const VALID_HEX_COLOR = /^#(?:[0-9a-fA-F]{3,4}){1,2}$/;
export const PHONE_REGEX = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/;

export const URL_REGEX =
/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)$/;
/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/=]*)$/;
2 changes: 1 addition & 1 deletion apps/web/app/helpers/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export const VALID_HEX_COLOR = /^#(?:[0-9a-fA-F]{3,4}){1,2}$/;
export const PHONE_REGEX = /^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/;

export const URL_REGEX =
/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&//=]*)$/;
/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&/=]*)$/;
2 changes: 1 addition & 1 deletion apps/web/app/hooks/auth/useAuthenticationPasscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function useAuthenticationPasscode() {
return;
}

if (data?.workspaces && data.workspaces.length) {
if (data && Array.isArray(data.workspaces) && data.workspaces.length > 0) {
setWorkspaces(data.workspaces);

setScreen('workspace');
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/hooks/features/usePublicOrganizationTeams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function usePublicOrganizationTeams() {
}

let responseTasks = (res.data.tasks as ITeamTask[]) || [];
if (responseTasks && responseTasks.length) {
if (Array.isArray(responseTasks) && responseTasks.length > 0) {
responseTasks = responseTasks.map((task) => {
const clone = cloneDeep(task);
if (task.tags && task.tags?.length) {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/services/client/api/public-organization-team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function getPublicOrganizationTeamsAPI(profile_link: string, team_id: str
params[`relations[${i}]`] = rl;
});

const queries = qs.stringify(params || {});
const queries = qs.stringify(params);

const endpoint = GAUZY_API_BASE_SERVER_URL.value
? `/public/team/${profile_link}/${team_id}?${queries}`
Expand All @@ -48,7 +48,7 @@ export function getPublicOrganizationTeamsMiscDataAPI(profile_link: string, team
params[`relations[${i}]`] = rl;
});

const queries = qs.stringify(params || {});
const queries = qs.stringify(params);

const endpoint = GAUZY_API_BASE_SERVER_URL.value
? `/public/team/${profile_link}/${team_id}?${queries}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function getPublicOrganizationTeamMiscDataRequest({
params[`relations[${i}]`] = rl;
});

const queries = qs.stringify(params || {});
const queries = qs.stringify(params);

return serverFetch<IOrganizationTeamWithMStatus>({
path: `/public/team/${profileLink}/${teamId}?${queries.toString()}`,
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

0 comments on commit 4d3b1c1

Please sign in to comment.