Skip to content

Implement DeleteRowObject functionality#291

Merged
scottolsonjr merged 5 commits intomainfrom
162-implement-deleterowobject
Feb 14, 2026
Merged

Implement DeleteRowObject functionality#291
scottolsonjr merged 5 commits intomainfrom
162-implement-deleterowobject

Conversation

@scottolsonjr
Copy link
Contributor

Implement DeleteRowObject functionality in decorators and add corresponding unit tests

@scottolsonjr scottolsonjr requested a review from Copilot February 14, 2026 00:45
@scottolsonjr scottolsonjr linked an issue Feb 14, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements “DeleteRowObject” support across the RarelySimple.AvatarScriptLink.Net decorator layer (OptionObject variants + FormObject) so callers can mark rows for deletion by RowId, and adds unit tests validating the new behavior.

Changes:

  • Refactors legacy OptionObjectHelpers.DeleteRowObject to use FindIndex for locating the target form/row.
  • Adds DeleteRowObject APIs to FormObjectDecorator and all OptionObject*Decorator variants, wiring through their helper classes.
  • Adds MSTest coverage for successful deletion and common error cases.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
dotnet/RarelySimple.AvatarScriptLink/Helpers/OptionObject/DeleteRowObject.cs Refactors row deletion lookup logic in legacy helpers.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/OptionObjectDecoratorHelper.cs Adds helper method to delete a row within a specified form in OptionObjectDecorator.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/OptionObjectDecorator.cs Exposes DeleteRowObject(formId, rowId) on OptionObjectDecorator.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/OptionObject2DecoratorHelper.cs Adds helper method to delete a row within a specified form in OptionObject2Decorator.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/OptionObject2Decorator.cs Exposes DeleteRowObject(formId, rowId) on OptionObject2Decorator.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/OptionObject2015DecoratorHelper.cs Adds helper method to delete a row within a specified form in OptionObject2015Decorator.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/OptionObject2015Decorator.cs Exposes DeleteRowObject(formId, rowId) on OptionObject2015Decorator.
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/FormObjectDecoratorHelper.cs Implements row deletion behavior (current row + other rows).
dotnet/RarelySimple.AvatarScriptLink.Net/Decorators/FormObjectDecorator.cs Exposes DeleteRowObject overloads on FormObjectDecorator.
dotnet/RarelySimple.AvatarScriptLink.Net.Tests/Decorators/OptionObjectDecoratorTests.cs Adds tests for OptionObjectDecorator row deletion and error cases.
dotnet/RarelySimple.AvatarScriptLink.Net.Tests/Decorators/OptionObject2DecoratorTests.cs Adds tests for OptionObject2Decorator row deletion and error cases.
dotnet/RarelySimple.AvatarScriptLink.Net.Tests/Decorators/OptionObject2015DecoratorTests.cs Adds tests for OptionObject2015Decorator row deletion and error cases.
dotnet/RarelySimple.AvatarScriptLink.Net.Tests/Decorators/FormObjectDecoratorTests.cs Adds tests for FormObjectDecorator row deletion (current + other rows + errors).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

dotnet/RarelySimple.AvatarScriptLink/Helpers/OptionObject/DeleteRowObject.cs:74

  • Missing null check for formObject parameter. Similar methods in the codebase, such as AddRowObject (line 43-44 in AddRowObject.cs), include a null check for the formObject parameter before accessing its properties. Add a null check: if (formObject == null) throw new ArgumentNullException(nameof(formObject), ...);
        public static IFormObject DeleteRowObject(IFormObject formObject, string rowId)
        {
            if (string.IsNullOrEmpty(rowId))
                throw new ArgumentNullException(nameof(rowId), ScriptLinkHelpers.GetLocalizedString(ParameterCannotBeNull, CultureInfo.CurrentCulture));
            if (formObject.CurrentRow?.RowId == rowId)
            {
                formObject.CurrentRow.RowAction = RowAction.Delete;
                return formObject;
            }
            if (formObject.MultipleIteration)
            {
                int rowIndex = formObject.OtherRows.FindIndex(r => r.RowId == rowId);
                if (rowIndex >= 0)
                {
                    formObject.OtherRows[rowIndex].RowAction = RowAction.Delete;
                    return formObject;
                }
            }
            throw new ArgumentException(ScriptLinkHelpers.GetLocalizedString("noRowObjectsFoundByRowId", CultureInfo.CurrentCulture), nameof(rowId));
        }

@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

@scottolsonjr scottolsonjr merged commit 66d6c66 into main Feb 14, 2026
12 checks passed
@scottolsonjr scottolsonjr deleted the 162-implement-deleterowobject branch February 14, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement DeleteRowObject

2 participants