chore: handle undefined identifier case
This commit is contained in:
parent
b24e530816
commit
282597bf83
4 changed files with 9 additions and 39 deletions
|
|
@ -120,7 +120,7 @@ export const IssueBlock = observer((props: IssueBlockProps) => {
|
|||
};
|
||||
|
||||
//TODO: add better logic. This is to have a min width for ID/Key based on the length of project identifier
|
||||
const keyMinWidth = (projectIdentifier.length + 5) * 7;
|
||||
const keyMinWidth = ((projectIdentifier?.length ?? 0) + 5) * 7;
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ const IssueRowDetails = observer((props: IssueRowDetailsProps) => {
|
|||
const isIssueSelected = selectionHelpers.getIsEntitySelected(issueDetail.id);
|
||||
|
||||
//TODO: add better logic. This is to have a min width for ID/Key based on the length of project identifier
|
||||
const keyMinWidth = (getProjectIdentifierById(issueDetail.project_id)?.length + 5) * 7;
|
||||
const keyMinWidth = (getProjectIdentifierById(issueDetail.project_id)?.length ?? 0 + 5) * 7;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export interface IProjectStore {
|
|||
currentProjectDetails: IProject | undefined;
|
||||
// actions
|
||||
getProjectById: (projectId: string) => IProject | null;
|
||||
getProjectIdentifierById: (projectId: string) => string;
|
||||
getProjectIdentifierById: (projectId: string) => string | undefined;
|
||||
// fetch actions
|
||||
fetchProjects: (workspaceSlug: string) => Promise<IProject[]>;
|
||||
fetchProjectDetails: (workspaceSlug: string, projectId: string) => Promise<IProject>;
|
||||
|
|
@ -261,7 +261,7 @@ export class ProjectStore implements IProjectStore {
|
|||
* @param projectId
|
||||
* @returns string
|
||||
*/
|
||||
getProjectIdentifierById = computedFn((projectId: string) => {
|
||||
getProjectIdentifierById = computedFn((projectId: string): string | undefined => {
|
||||
const projectInfo = this.projectMap?.[projectId];
|
||||
return projectInfo?.identifier;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue