Base solution for your next web application

Activities of "darutter0508"

Question

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 8.3
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net core

If issue related with ABP Framework

  • What is ABP Framework version?

If issue is about UI

  • Which theme are you using?
  • What are the theme settings?

I am trying to publish our site to IIS. We have 2 different versions of IIS on 2 different servers (8.0 and 10.0). If we publish the site to the "Default Web Site", the site will come up, but because the routing has the "localhost" prepended to the URL, all of the paths to the supporting resources can't be found. When we publish it as a Site (at the root of the IIS), the site cannot be hit. This happens on both IIS instances. We have published the site to Azure Web Service and have it running fine there, but need it deployed to our IIS instance. Please provide suggestions / insight into what may be causing the site not to be available.

Question

When I compile my project I get the following issues:

.Core\Friendships\Cache\UserFriendsCache.cs(44,20,46,150): warning CS0612: 'CacheExtensions.Get<TKey, TValue>(ICache, TKey, Func<TKey, TValue>)' is obsolete .Core\Friendships\Cache\UserFriendsCache.cs(51,20,53,105): warning CS0612: 'CacheExtensions.GetOrDefault<TKey, TValue>(ICache, TKey)' is obsolete

I downloaded the latest code for version 9.0 and checked the source for the UserFriendsCache.cs and it is still using the same calls. Is there a fix for this?

I got the notice that version 8.9 is available. How do I update my project to use the latest version?

I have a partial view (list view of items) that launches another partial view (also a list view of items) from the context menu. When the second partial view is initially launched everything works as expected. The appservice.GetAll() is called and the second list view is populated with the results. However when I close the second partial view and relaunch the second partial view the appservice.GetAll() is not called and the list in the partial view is empty. Please explain what is happening and how to resolve. Below are the files involved.

The initial page is the Positions index view. This page is the standard list page generated using the RadTool. The index.js file has been modified as follows: (function () { $(function () {

    var _$positionsTable = $('#PositionsTable');
    var _positionsService = abp.services.app.positions;
	
    $('.date-picker').datetimepicker({
        locale: abp.localization.currentLanguage.name,
        format: 'L'
    });

    var _permissions = {
        create: abp.auth.hasPermission('Pages.Administration.Positions.Create'),
        edit: abp.auth.hasPermission('Pages.Administration.Positions.Edit'),
        'delete': abp.auth.hasPermission('Pages.Administration.Positions.Delete')
    };

    var _createOrEditModal = new app.ModalManager({
        viewUrl: abp.appPath + 'Sapphire/Positions/CreateOrEditModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/Sapphire/Views/Positions/_CreateOrEditModal.js',
        modalClass: 'CreateOrEditPositionModal'
    });

	 var _viewPositionModal = new app.ModalManager({
        viewUrl: abp.appPath + 'Sapphire/Positions/ViewpositionModal',
        modalClass: 'ViewPositionModal'
    });

    var _indexPositionQualificationModal = new app.ModalManager({
        viewUrl: abp.appPath + 'Sapphire/PositionQualifications/_IndexModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/Sapphire/Views/PositionQualifications/_IndexModal.js',
        modalClass: 'PositionQualificationsViewModel'
    });
	

    var getDateFilter = function (element) {
        if (element.data("DateTimePicker").date() == null) {
            return null;
        }
        return element.data("DateTimePicker").date().format("YYYY-MM-DDT00:00:00Z"); 
    }

    var dataTable = _$positionsTable.DataTable({
        paging: true,
        serverSide: true,
        processing: true,
        listAction: {
            ajaxFunction: _positionsService.getAll,
            inputFilter: function () {
                return {
				filter: $('#PositionsTableFilter').val(),
				nameFilter: $('#NameFilterId').val()
                };
            }
        },
        columnDefs: [
            {
                width: 120,
                targets: 0,
                data: null,
                orderable: false,
                autoWidth: false,
                defaultContent: '',
                rowAction: {
                    cssClass: 'btn btn-brand dropdown-toggle',
                    text: '&lt;i class=&quot;fa fa-cog&quot;&gt;&lt;/i&gt; ' + app.localize('Actions') + ' &lt;span class=&quot;caret&quot;&gt;&lt;/span&gt;',
                    items: [
					{
                            text: app.localize('View'),
                            action: function (data) {
                                _viewPositionModal.open({ id: data.record.position.id });
                            }
                    },
					{
                        text: app.localize('Edit'),
                        visible: function () {
                            return _permissions.edit;
                        },
                        action: function (data) {
                            _createOrEditModal.open({ id: data.record.position.id });
                        }
                    }, 
                    { // NEW CONTEXT MENU OPTION - launches second list view
                        text: app.localize('Qualifications'),
                        visible: function () {
                            return _permissions.edit;
                        },
                        action: function (data) {
                            _indexPositionQualificationModal.open({ id: data.record.position.id });
                        }
                    }, 
					{
                        text: app.localize('Delete'),
                        visible: function () {
                            return _permissions.delete;
                        },
                        action: function (data) {
                            deletePosition(data.record.position);
                        }
                    }]
                }
            },
			{
				targets: 1,
					data: "position.name",
					name: "name"   
            },
            {
                targets: 2,
                data: "position.qualificationNames",
                name: "qualifications"
            }
        ]
    });

    function getPositions() {
        dataTable.ajax.reload();
    }

    function deletePosition(position) {
        abp.message.confirm(
            '',
            app.localize('AreYouSure'),
            function (isConfirmed) {
                if (isConfirmed) {
                    _positionsService.delete({
                        id: position.id
                    }).done(function () {
                        getPositions(true);
                        abp.notify.success(app.localize('SuccessfullyDeleted'));
                    });
                }
            }
        );
    }

	$('#ShowAdvancedFiltersSpan').click(function () {
        $('#ShowAdvancedFiltersSpan').hide();
        $('#HideAdvancedFiltersSpan').show();
        $('#AdvacedAuditFiltersArea').slideDown();
    });

    $('#HideAdvancedFiltersSpan').click(function () {
        $('#HideAdvancedFiltersSpan').hide();
        $('#ShowAdvancedFiltersSpan').show();
        $('#AdvacedAuditFiltersArea').slideUp();
    });

    $('#CreateNewPositionButton').click(function () {
        _createOrEditModal.open();
    });

	

    abp.event.on('app.createOrEditPositionModalSaved', function () {
        getPositions();
    });

	$('#GetPositionsButton').click(function (e) {
        e.preventDefault();
        getPositions();
    });

	$(document).keypress(function(e) {
	  if(e.which === 13) {
		getPositions();
	  }
	});
});

})();

The list view that gets launched from the "Qualifications" context menu and its associated javascript file are below:

@using Sapphire.Authorization @using Sapphire.Web.Areas.Sapphire.Models.PositionQualifications @using Sapphire.Web.Areas.Sapphire.Startup @using Sapphire.Web.Areas.Sapphire.Models.Common.Modals @model PositionQualificationsViewModel @{ ViewBag.CurrentPageName = SapphirePageNames.Common.PositionQualifications; } @section Scripts { <script abp-src="/view-resources/Areas/Sapphire/Views/PositionQualifications/_IndexModal.js" asp-append-version="true"></script> }

<input type="hidden" id="id" name="id" value="@Model.PositionId" />

@await Html.PartialAsync("~/Areas/Sapphire/Views/Common/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("Qualifications") + " for " + ViewBag.PositionName))

<div class="modal-body" id="IndexModal"> <div class="kt-subheader__toolbar"> <div class="kt-subheader__wrapper"> @if (IsGranted(AppPermissions.Pages_Administration_PositionQualifications_Create)) { <button id="CreateNewPositionQualificationButton" class="btn btn-primary blue"><i class="fa fa-plus"></i> @L("CreateNewPositionQualification")</button> } </div> </div> <div class="row align-items-center"> <table id="PositionQualificationsTable" class="display table table-striped table-bordered table-hover dt-responsive nowrap"> <thead> <tr> <th>@L("Actions")</th> <th>@L("QualificationName")</th> <th>@L("RequirementLevel")</th> </tr> </thead> </table> </div> <div class="align-bottom"> <button type="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true" id="CloseModalButton">@L("Done")</button> </div> </div>

(function () { $(function () {

    var _$positionQualificationsTable = $('#PositionQualificationsTable');
    var _positionQualificationsService = abp.services.app.positionQualifications;

    $('.date-picker').datetimepicker({
        locale: abp.localization.currentLanguage.name,
        format: 'L'
    });

    var _permissions = {
        create: abp.auth.hasPermission('Pages.Administration.PositionQualifications.Create'),
        edit: abp.auth.hasPermission('Pages.Administration.PositionQualifications.Edit'),
        'delete': abp.auth.hasPermission('Pages.Administration.PositionQualifications.Delete')
    };

    var _createOrEditModal = new app.ModalManager({
        viewUrl: abp.appPath + 'Sapphire/PositionQualifications/CreateOrEditModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/Sapphire/Views/PositionQualifications/_CreateOrEditModal.js',
        modalClass: 'CreateOrEditPositionQualificationModal'
    });

    var _viewPositionQualificationModal = new app.ModalManager({
        viewUrl: abp.appPath + 'Sapphire/PositionQualifications/ViewpositionQualificationModal',
        modalClass: 'ViewPositionQualificationModal'
    });




    var getDateFilter = function (element) {
        if (element.data("DateTimePicker").date() == null) {
            return null;
        }
        return element.data("DateTimePicker").date().format("YYYY-MM-DDT00:00:00Z");
    }

    var itmId = $('#id').val();

    var dataTable = _$positionQualificationsTable.DataTable({
        paging: true,
        serverSide: true,
        processing: true,
        listAction: {
            ajaxFunction: _positionQualificationsService.getAllForPosition,
            inputFilter: function () {
                return {
                    filter: $('#PositionQualificationsTableFilter').val(),
                    positionNameFilter: $('#PositionNameFilterId').val(),
                    qualificationNameFilter: $('#QualificationNameFilterId').val(),
                    requirementLevelFilter: $('#RequirementLevelFilterId').val(),
                    positionId: itmId
                };
            }
        },
        columnDefs: [
            {
                width: 120,
                targets: 0,
                data: null,
                orderable: false,
                autoWidth: false,
                defaultContent: '',
                rowAction: {
                    cssClass: 'btn btn-brand dropdown-toggle',
                    text: '&lt;i class=&quot;fa fa-cog&quot;&gt;&lt;/i&gt; ' + app.localize('Actions') + ' &lt;span class=&quot;caret&quot;&gt;&lt;/span&gt;',
                    items: [
                        {
                            text: app.localize('View'),
                            action: function (data) {
                                _viewPositionQualificationModal.open({ id: data.record.positionQualification.id, positionId: itmId });
                            }
                        },
                        {
                            text: app.localize('Edit'),
                            visible: function () {
                                return _permissions.edit;
                            },
                            action: function (data) {
                                _createOrEditModal.open({ id: data.record.positionQualification.id, positionId: itmId});
                            }
                        },
                        {
                            text: app.localize('Delete'),
                            visible: function () {
                                return _permissions.delete;
                            },
                            action: function (data) {
                                deletePositionQualification(data.record.positionQualification);
                            }
                        }]
                }
            },
            {
                targets: 1,
                data: "qualificationName",
                name: "qualificationFk.name"
            },
            {
                targets: 2,
                data: "positionQualification.requirementLevel",
                name: "requirementLevel",
                render: function (requirementLevel) {
                    return app.localize('Enum_RequirementLevels_' + requirementLevel);
                }
            }
        ]
    });

    function getPositionQualifications() {
        dataTable.ajax.reload();
    }

    function deletePositionQualification(positionQualification) {
        abp.message.confirm(
            '',
            app.localize('AreYouSure'),
            function (isConfirmed) {
                if (isConfirmed) {
                    _positionQualificationsService.delete({
                        id: positionQualification.id
                    }).done(function () {
                        getPositionQualifications(true);
                        abp.notify.success(app.localize('SuccessfullyDeleted'));
                    });
                }
            }
        );
    }

    $('#ShowAdvancedFiltersSpan').click(function () {
        $('#ShowAdvancedFiltersSpan').hide();
        $('#HideAdvancedFiltersSpan').show();
        $('#AdvacedAuditFiltersArea').slideDown();
    });

    $('#HideAdvancedFiltersSpan').click(function () {
        $('#HideAdvancedFiltersSpan').hide();
        $('#ShowAdvancedFiltersSpan').show();
        $('#AdvacedAuditFiltersArea').slideUp();
    });

    $('#CreateNewPositionQualificationButton').click(function () {
        _createOrEditModal.open({ id: null, positionId: itmId });
    });

    // closes the modal and returns to the Positions list view modal
    $('#CloseModalButton').click(function () {
        $('#IndexModal').close;
    });

    abp.event.on('app.createOrEditPositionQualificationModalSaved', function () {
        getPositionQualifications();
    });

    $('#GetPositionQualificationsButton').click(function (e) {
        e.preventDefault();
        getPositionQualifications();
    });

    $(document).keypress(function (e) {
        if (e.which === 13) {
            getPositionQualifications();
        }
    });
});

})();

I updated my NuGet packages to the latest Abp set and now I get a few deprecated method errors in the ChatHub and UserFriendsCache classes. In the ChatHub, the AbpSession is reported as deprecated and in the UserFriendsCache, the .Get<string, UserWithFriendsCacheItem> and .GetOrDefault<string, UserWithFriendsCacheItem> methods are both flagged as deprecated. What do I use to replace these methods?

I am using the .net core with jquery 8.3.0. I have extended the OrganizationUnit to include an integer column and was able to create a root node to the structure. However, when I attempt to add a sub-unit (child of the root) I get the following SQL exception:

INFO 2020-04-27 11:32:10,384 [15 ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'Sapphire.Web.Areas.Sapphire.Controllers.OrganizationUnitsController.CreateModal (Sapphire.Web.Mvc)' ERROR 2020-04-27 11:32:12,620 [15 ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request. System.InvalidOperationException: The connection does not support MultipleActiveResultSets. at Microsoft.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)

This is happening in the save process. It performs the InsertAsync() without an error but later in the process it throws this error. Please let me know how to resolve this.

I am trying to extend OrganizationUnit to add an integer value that would be populated from an enumeration. I found the post on extending the OrganizationUnit and followed it as best I could, but even before I get to the point of needing to display / retrieve the data from the input screen it fails to retrieve records from the database. I had entered data into the AbpOrganizationUnit table using the "out of the box" configuration prior to making the extended object. As soon as I create the extended object and put the reference in the DbContext.cs file, the call to GetAllListAsync() fails.

My extended OrganizationUnit class:

using Abp.Organizations;
using Sapphire.Enums;

namespace Sapphire.Organizations
{
    public class ExtendedOrganizationUnit : OrganizationUnit
    {
        public OrganizationTypes OrganizationTypeId { get; set; } = OrganizationTypes.Administration;
    }
}

in my DbContext.cs file:

public virtual DbSet<ExtendedOrganizationUnit> ExtendedOrganizationUnits { get; set; }

I ran the migration and the new column (OrganizationTypeId) is now in the table.

When I run the call:

var organizationUnits = await _organizationUnitRepository.GetAllListAsync();

it executes without any errors but returns no rows, even though prior to adding the entry in the DbContext.cs file, it would return my 8 existing rows.

Can you provide some guidance on how to resolve this?

Metronic has a way of creating a section header in the menu. Is there a way to create those section headers in the standard NavigationProvider MenuDefinition structure?

Question

Several menu items have been added to the menu (side menu using Theme 11) and I want to set the order for how they display. Using the order: parameter in the constructor for the menu items doesn't do anything. As a matter of fact, the order of the items does not follow any rhyme or reason. I have manually changed the order in which items are added to the menu and they don't show up in the order that they are added.

I am using the Metronics Theme 11 for our site and when the menu items expands below the viewable area the scroll bar does not appear and the user cannot scroll to see the rest of the menu. In the demo of Metronics theme 11 the .ps__thumb-y has a height value of 300, but in what gets rendered in my app the height has not value or is set to 0. What do I need to do to remedy this?

Using version 8.3.1 with .Net Core MVC and JQuery

Showing 1 to 10 of 13 entries