Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlazoriseUI AbpCrudPageBase same message on created and updated entity #20113

Closed
1 task done
nacho-gonzalez opened this issue Jun 25, 2024 · 1 comment · Fixed by #20114
Closed
1 task done

BlazoriseUI AbpCrudPageBase same message on created and updated entity #20113

nacho-gonzalez opened this issue Jun 25, 2024 · 1 comment · Fixed by #20114
Assignees

Comments

@nacho-gonzalez
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

AbpCrudPageBase (in the development branch) for BlazoriseUI uses the same "SavedSuccessfully" localization resource to notify successful entity creations or updates.

protected virtual async Task OnUpdatedEntityAsync()
{
        await GetEntitiesAsync();

        await InvokeAsync(EditModal!.Hide);
        await Notify.Success(L["SavedSuccessfully"]);
}

protected virtual async Task OnCreatedEntityAsync()
{
        NewEntity = new TCreateViewModel();
        await GetEntitiesAsync();

        await InvokeAsync(CreateModal!.Hide);
        await Notify.Success(L["SavedSuccessfully"]);
}

I think it's a mistake and should use different resources: "SavedSuccessfully" in OnCreatedEntityAsync and "UpdatedSuccessfully" in OnUpdatedEntityAsync.

In addition, It seems the method GetDeleteConfirmationMessage is not being used. I guess the purpose is to show a confirmation message before deleting an entity, which is a very common feature.

protected virtual string GetDeleteConfirmationMessage(TListViewModel entity)
{
        return UiLocalizer["ItemWillBeDeletedMessage"];
}

Finally, instead of calling await Notify.Success(L["SavedSuccessfully"]); or await Notify.Success(L["UpdatedSuccessfully"]); I would suggest to use a method that can be overridden to get the message, like GetSavedSuccessfullyMessage() and GetUpdatedSuccessfullyMessage(). In that way only this method needs to be overridden to change the default message.

Reproduction Steps

  1. Create a Blazor Server web project with ABP 8.2.0-rc.5
  2. When creating and updating entities using AbpCrudPageBase methods, the same message is received regardless it's a creation or an update.

Expected behavior

Display different successful messages for creating and updating entities

Actual behavior

When creating and updating entities using AbpCrudPageBase methods, the same message is received regardless it's a creation or an update.

Regression?

No response

Known Workarounds

No response

Version

8.2.0-rc.5

User Interface

Blazor Server

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

@maliming
Copy link
Member

hi

I added the CreatedSuccessfully message and some virtual methods on #20114

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 a pull request may close this issue.

2 participants