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
7 changes: 6 additions & 1 deletion src/components/Board/Board.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,12 @@ export function pushLocalChangesToApi(remoteBoards = []) {
continue;
}
console.error('Failed to push board to API:', board.id, e);
trackSyncException(e, { phase: 'pushBoard', boardId: board.id });
trackSyncException(e, {
phase: 'pushBoard',
boardId: board.id,
status: String(e.response?.status ?? ''),
apiError: String(e.response?.data?.error ?? '')
});
}
}

Expand Down
1 change: 1 addition & 0 deletions src/components/Board/Board.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ export const SYNC_STATUS = {
};

export const DEFAULT_BOARD_EMAIL = 'support@cboard.io';
export const DEFAULT_BOARD_NAME = 'Untitled Board';
15 changes: 10 additions & 5 deletions src/components/Board/Board.utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import moment from 'moment';
import { SHORT_ID_MAX_LENGTH, DEFAULT_BOARD_EMAIL } from './Board.constants';
import {
SHORT_ID_MAX_LENGTH,
DEFAULT_BOARD_EMAIL,
DEFAULT_BOARD_NAME
} from './Board.constants';
import { DEFAULT_BOARDS } from '../../helpers';

/**
Expand Down Expand Up @@ -59,13 +63,14 @@ export const isUnloggedCreatedBoard = board =>
* @returns {string} Board name
*/
const extractBoardName = board => {
if (board.name) return board.name;
if (board.name && board.name.trim()) return board.name.trim();
if (board.nameKey) {
const splitNameKeyParts = board.nameKey.split('.');
const NAMEKEY_LAST_INDEX = splitNameKeyParts.length - 1;
return splitNameKeyParts[NAMEKEY_LAST_INDEX];
const derivedName = splitNameKeyParts[NAMEKEY_LAST_INDEX];
if (derivedName && derivedName.trim()) return derivedName.trim();
}
return '';
return DEFAULT_BOARD_NAME;
};

/**
Expand All @@ -80,7 +85,7 @@ const extractBoardName = board => {
export const transformBoardForUser = (board, userEmail, userName, locale) => ({
...board,
email: userEmail,
author: userName || userEmail,
author: (userName && userName.trim()) || userEmail,
name: extractBoardName(board),
isPublic: false,
locale: locale,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Board/TileEditor/TileEditor.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export class TileEditor extends Component {
return (
<div className="TileEditor">
<FullScreenDialog
disableSubmit={!currentLabel}
disableSubmit={!currentLabel || !currentLabel.trim()}
buttons={buttons}
open={open}
title={
Expand Down
Loading