Base solution for your next web application
Open Closed

History for Entity in Index.js generated by RAD Tool #6396


User avatar
0
martin created

My solution is Auditing Entities and I can see the changes in the Database table and Admin pages.

What do I need to do to get this button/dropdown option working in the various Index.js for each Index page ?


		        var _entityTypeHistoryModal = app.modals.EntityTypeHistoryModal.create();
		        function entityHistoryIsEnabled() {
            return abp.custom.EntityHistory &&
                abp.custom.EntityHistory.IsEnabled &&
                _.filter(abp.custom.EntityHistory.EnabledEntities, entityType => entityType === _entityTypeFullName).length === 1;
        }

........

 {
                            text: app.localize('History'),
                            visible: function () {
                                return entityHistoryIsEnabled();
                            },
                            action: function (data) {
                                _entityTypeHistoryModal.open({
                                    entityTypeFullName: _entityTypeFullName,
                                    entityId: data.record.paidBy.id
                                });
                            }
						}, 

8 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @martin

    Could you execute abp.custom.EntityHistory on your browser console when you are viewing your app and share it's result with us ?

    Thanks,

  • User Avatar
    0
    martin created

    I can't execute abp.custome.EntityHistory via the console maybe that is part of the problem ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    @martin probably.

    Could you share your ABP nuget package version and AspNet Zero version as well ?

    Thanks,

  • User Avatar
    0
    martin created

    Abp v4.1.0 ASP.NET CORE MVC & jQuery .NET Core 2.2 v6.4.0

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @martin

    Then it should totally work. If you can share your project via email to [email protected], we can take a look at this problem at weekend. If not, we can assist you via TeamViewer next week.

    Please contact with [email protected] for both options.

    Thanks,

  • User Avatar
    0
    deltavision created

    Hi

    I have exactly the same issue on testing RAD tool with new entity - History not showing on Action button.

    Did you find the solution for this?

  • User Avatar
    0
    yekalkan created

    @deltavision

    Is entity history enabled in your project?

    see https://docs.aspnetzero.com/documents/aspnet-core-mvc/latest/Features-Mvc-Core-Entity-History

    make sure you uncomment following line in *.EntityFrameworkCore\EntityFrameworkCore\YourProjectNameEntityFrameworkCoreModule.cs

    //Configuration.EntityHistory.Selectors.Add("AbpZeroTemplateEntities", EntityHistoryHelper.TrackedTypes);

  • User Avatar
    0
    deltavision created

    Hi @yekalkan

    history is enabled in project (as general)

    Your info works - thank you.

    But why is logging/history - working under audit logs - without uncommeting the two lines?