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

Created UiMessageAlert for Blazorise implementation #5712

Merged
merged 7 commits into from
Oct 8, 2020

Conversation

stsrki
Copy link
Contributor

@stsrki stsrki commented Oct 6, 2020

It's still WIP but has some basic functionality:

  • Shows the message by using the service class
  • Ability to confirm or cancel the the operation
  • Styling of buttons and icons

EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Authentication.OpenIdConnect", "src\Volo.Abp.AspNetCore.Authentication.OpenIdConnect\Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj", "{DEFE3DB2-EA4F-4F90-87FC-B25D64427BC5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Authentication.OpenIdConnect", "src\Volo.Abp.AspNetCore.Authentication.OpenIdConnect\Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj", "{DEFE3DB2-EA4F-4F90-87FC-B25D64427BC5}"
Copy link
Member

Choose a reason for hiding this comment

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

I don't know why all these project GUID changes. Does it hurt the solution? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea why this happens. it's also happening on my own projects sometimes. Never had any problems. I can revert it if needed?

Task NotifyConfirmationReceivedAsync(string message, string title, TaskCompletionSource<bool> callback);
}

public class UiMessageEventArgs : EventArgs
Copy link
Member

Choose a reason for hiding this comment

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

Every type (class, interface, enum...) should be localized in its own file.

[Dependency(ReplaceServices = true)]
public class BlazoriseUiMessageService : IUiMessageService, IScopedDependency
{
private readonly IUiMessageNotifierService uiMessageNotifierService;
Copy link
Member

Choose a reason for hiding this comment

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

This class almost does nothing but delegates the work to the IUiMessageNotifierService. Also, IUiMessageNotifierService has no other purpose. Should we remove IUiMessageNotifierService (and its implementations) and merge its logic to this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed IUiMessageNotifierService and just used UiMessageNotifierService


sb.Append($"color:{MessageIconColor}");

return sb.ToString();
Copy link
Member

Choose a reason for hiding this comment

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

I suppose you will enhance this method. Otherwise, simply returning $"color:{MessageIconColor}" would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was to add more features in the future so I would just leave it like this.

@@ -15,6 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac.WebAssembly\Volo.Abp.Autofac.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.BlazoriseUI\Volo.Abp.BlazoriseUI.csproj" />
Copy link
Member

Choose a reason for hiding this comment

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

We should not need to reference the Volo.Abp.BlazoriseUI.csproj from here. Because Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme (indirectly) depends on the Volo.Abp.BlazoriseUI.csproj project.

BTW, if you would need to add an ABP package, you always should add a [DependsOn(...)] attribute to the module class in your project (see the doc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@@ -14,16 +14,41 @@
<h5 class="m-1"> <i class="fas fa-rocket"></i> Congratulations, <strong>MyProjectName</strong> is successfully running!</h5>
</Badge>

<Card>
Copy link
Member

Choose a reason for hiding this comment

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

We should not commit such test code to GitHub. This is the startup template that is used when a developer wants to create a new solution, so we don't wan't to make it dirty :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know this is just for testing. I was expecting for you to remove it after you review the UI :)

using Microsoft.AspNetCore.Components;
using Volo.Abp.AspNetCore.Components.WebAssembly;

namespace MyCompanyName.MyProjectName.Blazor.Pages
Copy link
Member

Choose a reason for hiding this comment

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

Same comment is valid here (see my comment for the Index.razor)

@hikalkan hikalkan merged commit 7729bd5 into dev Oct 8, 2020
@hikalkan hikalkan deleted the dev-stsrki-messageservice branch October 8, 2020 06:57
@hikalkan hikalkan linked an issue Oct 8, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blazor: Complete the IUiMessageService
2 participants