Skip to content

Commit 20600cd

Browse files
committed
[IMP] commands: modify enum of CommandResult
When a command is rejected, the dispatch result contains a list of numbers, which we then need to map to the enum by ourselves if we want to know the actual reason of rejection. This commit converts the enum of CommandResult from numbers to explicit string values which describe the reason for command rejection in order to save time while debugging. Task ID : 3254446 closes #2845 Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
1 parent 4b1be76 commit 20600cd

File tree

1 file changed

+96
-96
lines changed

1 file changed

+96
-96
lines changed

src/types/commands.ts

Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,102 +1067,102 @@ export class DispatchResult {
10671067
export type CancelledReason = Exclude<CommandResult, CommandResult.Success>;
10681068

10691069
export const enum CommandResult {
1070-
Success,
1071-
CancelledForUnknownReason,
1072-
WillRemoveExistingMerge,
1073-
MergeIsDestructive,
1074-
CellIsMerged,
1075-
InvalidTarget,
1076-
EmptyUndoStack,
1077-
EmptyRedoStack,
1078-
NotEnoughElements,
1079-
NotEnoughSheets,
1080-
MissingSheetName,
1081-
UnchangedSheetName,
1082-
DuplicatedSheetName,
1083-
DuplicatedSheetId,
1084-
ForbiddenCharactersInSheetName,
1085-
WrongSheetMove,
1086-
WrongSheetPosition,
1087-
InvalidAnchorZone,
1088-
SelectionOutOfBound,
1089-
TargetOutOfSheet,
1090-
WrongCutSelection,
1091-
WrongPasteSelection,
1092-
WrongPasteOption,
1093-
WrongFigurePasteOption,
1094-
EmptyClipboard,
1095-
EmptyRange,
1096-
InvalidRange,
1097-
InvalidZones,
1098-
InvalidSheetId,
1099-
InvalidFigureId,
1100-
InputAlreadyFocused,
1101-
MaximumRangesReached,
1102-
InvalidChartDefinition,
1103-
InvalidDataSet,
1104-
InvalidLabelRange,
1105-
InvalidScorecardKeyValue,
1106-
InvalidScorecardBaseline,
1107-
InvalidGaugeDataRange,
1108-
EmptyGaugeRangeMin,
1109-
GaugeRangeMinNaN,
1110-
EmptyGaugeRangeMax,
1111-
GaugeRangeMaxNaN,
1112-
GaugeRangeMinBiggerThanRangeMax,
1113-
GaugeLowerInflectionPointNaN,
1114-
GaugeUpperInflectionPointNaN,
1115-
GaugeLowerBiggerThanUpper,
1116-
InvalidAutofillSelection,
1117-
WrongComposerSelection,
1118-
MinBiggerThanMax,
1119-
LowerBiggerThanUpper,
1120-
MidBiggerThanMax,
1121-
MinBiggerThanMid,
1122-
FirstArgMissing,
1123-
SecondArgMissing,
1124-
MinNaN,
1125-
MidNaN,
1126-
MaxNaN,
1127-
ValueUpperInflectionNaN,
1128-
ValueLowerInflectionNaN,
1129-
MinInvalidFormula,
1130-
MidInvalidFormula,
1131-
MaxInvalidFormula,
1132-
ValueUpperInvalidFormula,
1133-
ValueLowerInvalidFormula,
1134-
InvalidSortZone,
1135-
WaitingSessionConfirmation,
1136-
MergeOverlap,
1137-
TooManyHiddenElements,
1138-
Readonly,
1139-
InvalidViewportSize,
1140-
InvalidScrollingDirection,
1141-
FigureDoesNotExist,
1142-
InvalidConditionalFormatId,
1143-
InvalidCellPopover,
1144-
EmptyTarget,
1145-
InvalidFreezeQuantity,
1146-
FrozenPaneOverlap,
1147-
ValuesNotChanged,
1148-
InvalidFilterZone,
1149-
FilterOverlap,
1150-
FilterNotFound,
1151-
MergeInFilter,
1152-
NonContinuousTargets,
1153-
DuplicatedFigureId,
1154-
InvalidSelectionStep,
1155-
DuplicatedChartId,
1156-
ChartDoesNotExist,
1157-
InvalidHeaderIndex,
1158-
InvalidQuantity,
1159-
MoreThanOneColumnSelected,
1160-
EmptySplitSeparator,
1161-
SplitWillOverwriteContent,
1162-
NoSplitSeparatorInSelection,
1163-
NoActiveSheet,
1164-
InvalidLocale,
1165-
AlreadyInPaintingFormatMode,
1070+
Success = "Success",
1071+
CancelledForUnknownReason = "CancelledForUnknownReason",
1072+
WillRemoveExistingMerge = "WillRemoveExistingMerge",
1073+
MergeIsDestructive = "MergeIsDestructive",
1074+
CellIsMerged = "CellIsMerged",
1075+
InvalidTarget = "InvalidTarget",
1076+
EmptyUndoStack = "EmptyUndoStack",
1077+
EmptyRedoStack = "EmptyRedoStack",
1078+
NotEnoughElements = "NotEnoughElements",
1079+
NotEnoughSheets = "NotEnoughSheets",
1080+
MissingSheetName = "MissingSheetName",
1081+
UnchangedSheetName = "UnchangedSheetName",
1082+
DuplicatedSheetName = "DuplicatedSheetName",
1083+
DuplicatedSheetId = "DuplicatedSheetId",
1084+
ForbiddenCharactersInSheetName = "ForbiddenCharactersInSheetName",
1085+
WrongSheetMove = "WrongSheetMove",
1086+
WrongSheetPosition = "WrongSheetPosition",
1087+
InvalidAnchorZone = "InvalidAnchorZone",
1088+
SelectionOutOfBound = "SelectionOutOfBound",
1089+
TargetOutOfSheet = "TargetOutOfSheet",
1090+
WrongCutSelection = "WrongCutSelection",
1091+
WrongPasteSelection = "WrongPasteSelection",
1092+
WrongPasteOption = "WrongPasteOption",
1093+
WrongFigurePasteOption = "WrongFigurePasteOption",
1094+
EmptyClipboard = "EmptyClipboard",
1095+
EmptyRange = "EmptyRange",
1096+
InvalidRange = "InvalidRange",
1097+
InvalidZones = "InvalidZones",
1098+
InvalidSheetId = "InvalidSheetId",
1099+
InvalidFigureId = "InvalidFigureId",
1100+
InputAlreadyFocused = "InputAlreadyFocused",
1101+
MaximumRangesReached = "MaximumRangesReached",
1102+
InvalidChartDefinition = "InvalidChartDefinition",
1103+
InvalidDataSet = "InvalidDataSet",
1104+
InvalidLabelRange = "InvalidLabelRange",
1105+
InvalidScorecardKeyValue = "InvalidScorecardKeyValue",
1106+
InvalidScorecardBaseline = "InvalidScorecardBaseline",
1107+
InvalidGaugeDataRange = "InvalidGaugeDataRange",
1108+
EmptyGaugeRangeMin = "EmptyGaugeRangeMin",
1109+
GaugeRangeMinNaN = "GaugeRangeMinNaN",
1110+
EmptyGaugeRangeMax = "EmptyGaugeRangeMax",
1111+
GaugeRangeMaxNaN = "GaugeRangeMaxNaN",
1112+
GaugeRangeMinBiggerThanRangeMax = "GaugeRangeMinBiggerThanRangeMax",
1113+
GaugeLowerInflectionPointNaN = "GaugeLowerInflectionPointNaN",
1114+
GaugeUpperInflectionPointNaN = "GaugeUpperInflectionPointNaN",
1115+
GaugeLowerBiggerThanUpper = "GaugeLowerBiggerThanUpper",
1116+
InvalidAutofillSelection = "InvalidAutofillSelection",
1117+
WrongComposerSelection = "WrongComposerSelection",
1118+
MinBiggerThanMax = "MinBiggerThanMax",
1119+
LowerBiggerThanUpper = "LowerBiggerThanUpper",
1120+
MidBiggerThanMax = "MidBiggerThanMax",
1121+
MinBiggerThanMid = "MinBiggerThanMid",
1122+
FirstArgMissing = "FirstArgMissing",
1123+
SecondArgMissing = "SecondArgMissing",
1124+
MinNaN = "MinNaN",
1125+
MidNaN = "MidNaN",
1126+
MaxNaN = "MaxNaN",
1127+
ValueUpperInflectionNaN = "ValueUpperInflectionNaN",
1128+
ValueLowerInflectionNaN = "ValueLowerInflectionNaN",
1129+
MinInvalidFormula = "MinInvalidFormula",
1130+
MidInvalidFormula = "MidInvalidFormula",
1131+
MaxInvalidFormula = "MaxInvalidFormula",
1132+
ValueUpperInvalidFormula = "ValueUpperInvalidFormula",
1133+
ValueLowerInvalidFormula = "ValueLowerInvalidFormula",
1134+
InvalidSortZone = "InvalidSortZone",
1135+
WaitingSessionConfirmation = "WaitingSessionConfirmation",
1136+
MergeOverlap = "MergeOverlap",
1137+
TooManyHiddenElements = "TooManyHiddenElements",
1138+
Readonly = "Readonly",
1139+
InvalidViewportSize = "InvalidViewportSize",
1140+
InvalidScrollingDirection = "InvalidScrollingDirection",
1141+
FigureDoesNotExist = "FigureDoesNotExist",
1142+
InvalidConditionalFormatId = "InvalidConditionalFormatId",
1143+
InvalidCellPopover = "InvalidCellPopover",
1144+
EmptyTarget = "EmptyTarget",
1145+
InvalidFreezeQuantity = "InvalidFreezeQuantity",
1146+
FrozenPaneOverlap = "FrozenPaneOverlap",
1147+
ValuesNotChanged = "ValuesNotChanged",
1148+
InvalidFilterZone = "InvalidFilterZone",
1149+
FilterOverlap = "FilterOverlap",
1150+
FilterNotFound = "FilterNotFound",
1151+
MergeInFilter = "MergeInFilter",
1152+
NonContinuousTargets = "NonContinuousTargets",
1153+
DuplicatedFigureId = "DuplicatedFigureId",
1154+
InvalidSelectionStep = "InvalidSelectionStep",
1155+
DuplicatedChartId = "DuplicatedChartId",
1156+
ChartDoesNotExist = "ChartDoesNotExist",
1157+
InvalidHeaderIndex = "InvalidHeaderIndex",
1158+
InvalidQuantity = "InvalidQuantity",
1159+
MoreThanOneColumnSelected = "MoreThanOneColumnSelected",
1160+
EmptySplitSeparator = "EmptySplitSeparator",
1161+
SplitWillOverwriteContent = "SplitWillOverwriteContent",
1162+
NoSplitSeparatorInSelection = "NoSplitSeparatorInSelection",
1163+
NoActiveSheet = "NoActiveSheet",
1164+
InvalidLocale = "InvalidLocale",
1165+
AlreadyInPaintingFormatMode = "AlreadyInPaintingFormatMode",
11661166
}
11671167

11681168
export interface CommandHandler<T> {

0 commit comments

Comments
 (0)