mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
[WEB-881] fix: Sentry errors from previous build (#4142)
* Sentry Fix for "Non-Error promise rejection captured with value: Route change to url was aborted" * Sentry fix for "undefined is not an object (evaluating 'n.response')" * Possible Sentry Fix for "TypeError Function.entries(<anonymous>)" * Possible Sentry fix for "null is not an object (evaluating 'e.type')"
This commit is contained in:
parent
03df410b52
commit
95580d0c62
@ -189,7 +189,7 @@ function createToolbox({
|
||||
tippyOptions,
|
||||
onSelectColor,
|
||||
onClickItem,
|
||||
colors,
|
||||
colors = {},
|
||||
}: {
|
||||
triggerButton: Element | null;
|
||||
items: ToolboxItem[];
|
||||
|
@ -19,7 +19,7 @@ type Props = {
|
||||
export const replaceUnderscoreIfSnakeCase = (str: string) => str.replace(/_/g, " ");
|
||||
|
||||
export const AppliedFiltersList: React.FC<Props> = (props) => {
|
||||
const { appliedFilters, handleRemoveAllFilters, handleRemoveFilter, states } = props;
|
||||
const { appliedFilters = {}, handleRemoveAllFilters, handleRemoveFilter, states } = props;
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap items-stretch gap-2 bg-custom-background-100">
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
import { ILayoutDisplayFiltersOptions } from "@/constants/issue";
|
||||
|
||||
type Props = {
|
||||
displayFilters: IIssueDisplayFilterOptions;
|
||||
displayFilters: IIssueDisplayFilterOptions | undefined;
|
||||
displayProperties: IIssueDisplayProperties;
|
||||
handleDisplayFiltersUpdate: (updatedDisplayFilter: Partial<IIssueDisplayFilterOptions>) => void;
|
||||
handleDisplayPropertiesUpdate: (updatedDisplayProperties: Partial<IIssueDisplayProperties>) => void;
|
||||
@ -80,8 +80,8 @@ export const DisplayFiltersSelection: React.FC<Props> = observer((props) => {
|
||||
|
||||
{/* sub-group by */}
|
||||
{isDisplayFilterEnabled("sub_group_by") &&
|
||||
displayFilters.group_by !== null &&
|
||||
displayFilters.layout === "kanban" && (
|
||||
displayFilters?.group_by !== null &&
|
||||
displayFilters?.layout === "kanban" && (
|
||||
<div className="py-2">
|
||||
<FilterSubGroupBy
|
||||
displayFilters={displayFilters}
|
||||
@ -100,7 +100,7 @@ export const DisplayFiltersSelection: React.FC<Props> = observer((props) => {
|
||||
{isDisplayFilterEnabled("order_by") && (
|
||||
<div className="py-2">
|
||||
<FilterOrderBy
|
||||
selectedOrderBy={displayFilters.order_by}
|
||||
selectedOrderBy={displayFilters?.order_by}
|
||||
handleUpdate={(val) =>
|
||||
handleDisplayFiltersUpdate({
|
||||
order_by: val,
|
||||
@ -115,7 +115,7 @@ export const DisplayFiltersSelection: React.FC<Props> = observer((props) => {
|
||||
{isDisplayFilterEnabled("type") && (
|
||||
<div className="py-2">
|
||||
<FilterIssueType
|
||||
selectedIssueType={displayFilters.type}
|
||||
selectedIssueType={displayFilters?.type}
|
||||
handleUpdate={(val) =>
|
||||
handleDisplayFiltersUpdate({
|
||||
type: val,
|
||||
@ -130,8 +130,8 @@ export const DisplayFiltersSelection: React.FC<Props> = observer((props) => {
|
||||
<div className="py-2">
|
||||
<FilterExtraOptions
|
||||
selectedExtraOptions={{
|
||||
show_empty_groups: displayFilters.show_empty_groups ?? true,
|
||||
sub_issue: displayFilters.sub_issue ?? true,
|
||||
show_empty_groups: displayFilters?.show_empty_groups ?? true,
|
||||
sub_issue: displayFilters?.sub_issue ?? true,
|
||||
}}
|
||||
handleUpdate={(key, val) =>
|
||||
handleDisplayFiltersUpdate({
|
||||
|
@ -8,7 +8,7 @@ import { ISSUE_GROUP_BY_OPTIONS } from "@/constants/issue";
|
||||
// constants
|
||||
|
||||
type Props = {
|
||||
displayFilters: IIssueDisplayFilterOptions;
|
||||
displayFilters: IIssueDisplayFilterOptions | undefined;
|
||||
groupByOptions: TIssueGroupByOptions[];
|
||||
handleUpdate: (val: TIssueGroupByOptions) => void;
|
||||
ignoreGroupedFilters: Partial<TIssueGroupByOptions>[];
|
||||
@ -19,8 +19,8 @@ export const FilterGroupBy: React.FC<Props> = observer((props) => {
|
||||
|
||||
const [previewEnabled, setPreviewEnabled] = useState(true);
|
||||
|
||||
const selectedGroupBy = displayFilters.group_by ?? null;
|
||||
const selectedSubGroupBy = displayFilters.sub_group_by ?? null;
|
||||
const selectedGroupBy = displayFilters?.group_by ?? null;
|
||||
const selectedSubGroupBy = displayFilters?.sub_group_by ?? null;
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -32,7 +32,11 @@ export const FilterGroupBy: React.FC<Props> = observer((props) => {
|
||||
{previewEnabled && (
|
||||
<div>
|
||||
{ISSUE_GROUP_BY_OPTIONS.filter((option) => groupByOptions.includes(option.key)).map((groupBy) => {
|
||||
if (displayFilters.layout === "kanban" && selectedSubGroupBy !== null && groupBy.key === selectedSubGroupBy)
|
||||
if (
|
||||
displayFilters?.layout === "kanban" &&
|
||||
selectedSubGroupBy !== null &&
|
||||
groupBy.key === selectedSubGroupBy
|
||||
)
|
||||
return null;
|
||||
if (ignoreGroupedFilters.includes(groupBy?.key)) return null;
|
||||
|
||||
|
@ -48,7 +48,7 @@ export const ProjectAppliedFiltersList: React.FC<Props> = (props) => {
|
||||
<div className="flex items-start justify-between gap-1.5">
|
||||
<div className="flex flex-wrap items-stretch gap-2 bg-custom-background-100">
|
||||
{/* Applied filters */}
|
||||
{Object.entries(appliedFilters).map(([key, value]) => {
|
||||
{Object.entries(appliedFilters ?? {}).map(([key, value]) => {
|
||||
const filterKey = key as keyof TProjectFilters;
|
||||
|
||||
if (!value) return;
|
||||
|
@ -197,16 +197,16 @@ export const CreateProjectForm: FC<Props> = observer((props) => {
|
||||
onChange={(val: any) => {
|
||||
let logoValue = {};
|
||||
|
||||
if (val.type === "emoji")
|
||||
if (val?.type === "emoji")
|
||||
logoValue = {
|
||||
value: convertHexEmojiToDecimal(val.value.unified),
|
||||
url: val.value.imageUrl,
|
||||
};
|
||||
else if (val.type === "icon") logoValue = val.value;
|
||||
else if (val?.type === "icon") logoValue = val.value;
|
||||
|
||||
onChange({
|
||||
in_use: val.type,
|
||||
[val.type]: logoValue,
|
||||
in_use: val?.type,
|
||||
[val?.type]: logoValue,
|
||||
});
|
||||
}}
|
||||
defaultIconColor={value.in_use && value.in_use === "icon" ? value.icon?.color : undefined}
|
||||
|
@ -157,16 +157,16 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
||||
onChange={(val) => {
|
||||
let logoValue = {};
|
||||
|
||||
if (val.type === "emoji")
|
||||
if (val?.type === "emoji")
|
||||
logoValue = {
|
||||
value: convertHexEmojiToDecimal(val.value.unified),
|
||||
url: val.value.imageUrl,
|
||||
};
|
||||
else if (val.type === "icon") logoValue = val.value;
|
||||
else if (val?.type === "icon") logoValue = val.value;
|
||||
|
||||
onChange({
|
||||
in_use: val.type,
|
||||
[val.type]: logoValue,
|
||||
in_use: val?.type,
|
||||
[val?.type]: logoValue,
|
||||
});
|
||||
}}
|
||||
defaultIconColor={value?.in_use && value.in_use === "icon" ? value?.icon?.color : undefined}
|
||||
|
@ -59,9 +59,9 @@ const myIssuesParamsToKey = (params: any) => {
|
||||
let labelsKey = labels ? labels.split(",") : [];
|
||||
const startDateKey = start_date ?? "";
|
||||
const targetDateKey = target_date ?? "";
|
||||
const type = params.type ? params.type.toUpperCase() : "NULL";
|
||||
const groupBy = params.group_by ? params.group_by.toUpperCase() : "NULL";
|
||||
const orderBy = params.order_by ? params.order_by.toUpperCase() : "NULL";
|
||||
const type = params?.type ? params.type.toUpperCase() : "NULL";
|
||||
const groupBy = params?.group_by ? params.group_by.toUpperCase() : "NULL";
|
||||
const orderBy = params?.order_by ? params.order_by.toUpperCase() : "NULL";
|
||||
|
||||
// sorting each keys in ascending order
|
||||
assigneesKey = assigneesKey.sort().join("_");
|
||||
|
@ -152,6 +152,8 @@ export const getNumberCount = (number: number): string => {
|
||||
export const objToQueryParams = (obj: any) => {
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (!obj) return params.toString();
|
||||
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if (value !== undefined && value !== null) params.append(key, value as string);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ const useReloadConfirmations = (isActive = true) => {
|
||||
const leave = confirm("Are you sure you want to leave? Changes you made may not be saved.");
|
||||
if (!leave) {
|
||||
router.events.emit("routeChangeError");
|
||||
throw `Route change to "${url}" was aborted (this error can be safely ignored).`;
|
||||
}
|
||||
},
|
||||
[isActive, showAlert, router.events]
|
||||
|
@ -55,7 +55,7 @@ const AppPostInstallation: NextPageWithLayout = () => {
|
||||
window.close();
|
||||
})
|
||||
.catch((err) => {
|
||||
throw err.response;
|
||||
throw err?.response;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user