Base solution for your next web application

Activities of "dmux"

I know this is closed two years ago, but for those (like me) finding this solution from a search...

The solution above did not work for me, and I was also reluctant to edit the ModalManager.js in case a future upgrade of ASPNETZERO reverted my change.

So I did this in my CreateOrEditModal.js file, in the "this.init" function, right after invoking summernote():

       $('.note-editing-area').keydown(function (e) {
           if (e.which === 13) {
               e.stopPropagation();
           }
       });

Because SummerNote uses the note-editing-area class for its text input box.

I am using Visual Studio 16.3.10, because I udpated 16.4 Preview 4 to Preview 6 and it seemed to cause serious problems. So I uninstalled it and went back to the released version. Then I installed the RAD Tool (2.1).

My project is ASPNETCore MVC v8.0

I have just discovered that the RAD tool is now producing sections of javascript that gulp rejects. As far as I can tell the offending code is in the datatable listAction in the generated index.js, where it is defining the inputFilter parameters for the query. It looks like it is putting placeholders in and not substituting values.

Original code (produced previously by RAD tool):

        var dataTable = _$productsTable.DataTable({
            paging: true,
            serverSide: true,
            processing: true,
            listAction: {
                ajaxFunction: _productsService.getAll,
                inputFilter: function () {
                    return {
					filter: $('#ProductsTableFilter').val(),
					codeFilter: $('#CodeFilterId').val(),
					nameFilter: $('#NameFilterId').val(),
					chemCheckFilter: $('#ChemCheckFilterId').val(),
					minMultiPartyMeetingsFilter: $('#MinMultiPartyMeetingsFilterId').val(),
					maxMultiPartyMeetingsFilter: $('#MaxMultiPartyMeetingsFilterId').val(),
					midpointReviewFilter: $('#MidpointReviewFilterId').val(),
					finalReviewFilter: $('#FinalReviewFilterId').val(),
					progressReportsFilter: $('#ProgressReportsFilterId').val(),
					programTypeNameFilter: $('#ProgramTypeNameFilterId').val()
                };
              }
           },

Code being produced now:

var dataTable = _$productsTable.DataTable({
            paging: true,
            serverSide: true,
            processing: true,
            listAction: {
                ajaxFunction: _productsService.getAll,
                inputFilter: function () {
                    return {
					filter: $('#ProductsTableFilter').val(),
					{{Dp_Property_Name_Here}}Filter: $('#CodeFilterId').val(),
					{{Dp_Property_Name_Here}}Filter: $('#NameFilterId').val(),
					{{Dp_Property_Name_Here}}Filter: $('#ChemCheckFilterId').val(),
					minMultiPartyMeetingsFilter: $('#MinMultiPartyMeetingsFilterId').val(),
					maxMultiPartyMeetingsFilter: $('#MaxMultiPartyMeetingsFilterId').val(),
					{{Dp_Property_Name_Here}}Filter: $('#MidpointReviewFilterId').val(),
					{{Dp_Property_Name_Here}}Filter: $('#FinalReviewFilterId').val(),
					{{Dp_Property_Name_Here}}Filter: $('#ProgressReportsFilterId').val(),
					minConsultationsFilter: $('#MinConsultationsFilterId').val(),
					maxConsultationsFilter: $('#MaxConsultationsFilterId').val(),
					minHoursFilter: $('#MinHoursFilterId').val(),
					maxHoursFilter: $('#MaxHoursFilterId').val(),
					{{Dp_Property_Name_Here}}Filter: $('#MoodleAccessFilterId').val(),
					programTypeNameFilter: $('#ProgramTypeNameFilterId').val()
                    };
                }
            },

It seems the int data types have their filter names, but the string and bool data types have this {{Dp_Property_Name_Here}} placeholder instead.

It seems this is what causes npm run build to throw an error:

npm : [22:27:44] 'build' errored after 3.41 s At line:1 char:1 npm run build

  • CategoryInfo : NotSpecified: ([22:27:44...ed after 3.41 s:String) [], RemoteException
  • FullyQualifiedErrorId : NativeCommandError [22:27:44] SyntaxError in plugin "gulp-uglify-es" Message: Unexpected token: punc ({) Details: filename: Index.js line: 48 col: 5 pos: 1747 domainEmitter: [object Object] domain: [object Object] domainThrown: false

I can confirm that when I replace the {{Dp_Property_Name_Here}} with the appropriate filter name, I can then run npm run build.

So this is now a manual step I need to take any time I run the RAD tool. Any help to resolve it will be appreciated.

Any ideas how I can overcome this?

Wow! Cool.

Thanks so much. Just updated and tried it out, and everything works. Great job.

By the way, this RAD tool is the reason I purchased ASPNetZero instead of building on ABPBoilerplate. Both the RAD tool itself and also the other features in ASPNetZero are well worth the price, but it was the RAD tool that sold me.

I want to use this time-picker: http://vitalets.github.io/clockface/#

It works, except the layout of its elements gets mucked up due to something in css. I can't figure out what is causing the problem.

I'm expecting this:

I'm seeing this:

If I remove the clockface.css from my bundles I see this:

I am using it in a modal.

I have experimented with adding the css to different bundles in case it is conflicting with something. Unfortunately css is not my strong suit. I do notice that wwwroot\metronic\assets\global\css has a couple of .clockface entries, but I don't know what to do with that.

Any help will be appreciated.

Updating this...

When I copy/paste the clockface.css into the css for my dashboard widget, it displays correctly. This gets me going, but I'm looking for advice on how to do things more neatly - I don't want to copy/paste this .css to individual page style sheets.

Hi Maliming,

Thanks for replying. I don't know where "plugins" is...

But I went back and did some more experimenting. I have added the clockface.css to view-resources/Areas/App/Views/-Bundles/customizable-dashboard-libs.min.css, because that comes further down in the list of included bundles. That worked ok.

Now I can use the clockface in any of my widgets and their modals because they all load that bundle. That's good enough for me.

Thanks again.

Hi ismcagdas,

Thank you for following up.

I have had a chance to dig a bit deeper and I think I have found the issue.

In Core/DashboardCustomization/Definitions/DashboardConfiguration.cs this is the pattern provided in the default project:

var tenantWidgetsDefaultPermission = new List
{
AppPermissions\.Pages\_Tenant\_Dashboard
};

var dailySales = new WidgetDefinition(
    WebPortalDashboardCustomizationConsts.Widgets.Tenant.DailySales,
    "WidgetDailySales",
    side: MultiTenancySides.Tenant,
    usedWidgetFilters: new List<string> { dateRangeFilter.Id },
    permissions: tenantWidgetsDefaultPermission
);

var generalStats = new WidgetDefinition(
    WebPortalDashboardCustomizationConsts.Widgets.Tenant.GeneralStats,
    "WidgetGeneralStats",
    side: MultiTenancySides.Tenant,
    permissions: tenantWidgetsDefaultPermission
    );

generalStats.Permissions.Add(AppPermissions.Pages_Administration_AuditLogs);

... and so forth. I haven't yet removed all thses default widgets from my project so they are all still there.

What happens is that each new widget definition sets its "permissions" to be a pointer to the list called "tenantWidgetsDefaultPermission". The result is that all widgets end up with the same list, which includes any added permissions like the one listed on the last line here. This is why all my widget users required AuditLogs permission for every widget, when they should only require that permission for GeneralStats.

What I did to stop this behaviour is I added ".ToList()" when setting the widget "permissions" property, so that the permissions list would be a new object. This resolved the issue, like this:

var generalStats = new WidgetDefinition(
    WebPortalDashboardCustomizationConsts.Widgets.Tenant.GeneralStats,
    "WidgetGeneralStats",
    side: MultiTenancySides.Tenant,
    permissions: tenantWidgetsDefaultPermission.ToList()
    );

There might be nicer ways to do it, but this works for me for the moment.

I see the warning in my debug console about the upcoming change to Chrome. The message reads:

A cookie associated with a resource at http://uat.trevor-roberts.com.au/ was set with SameSite=None but without Secure. A future release of Chrome will only deliver cookies marked SameSite=None if they are also marked Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032

The latest advice is this will come into effect in a couple of weeks: https://www.chromium.org/updates/same-site

Please advise if we need to do anything to ensure features like "Login as user", etc. continue to work.

Hi @maliming,

Thank you for that document. I have been through it and tested Chrome by enabling "SameSite by default cookies" as it suggests. It appears to make no difference to how the app works. So maybe nothing is going to break in two weeks time. Is that right?

The only cookies that are SameSite and not Secure appear to be set by the ASPNETZero base code:

I really just need to know if the standard ASPNETZero platform (v8.0 CORE MVC) will stop working in two weeks or not. Please advise.

Thanks kindly!

When a modal window opens, if it is too long for the screen I can scroll vertically. All good.

But if the modal has a selector which launches another child modal (Like the RAD Tool controls for selecting child objects), I can't scroll after opening and closing the child modal.

This kind of selector makes the issue happen:

After opening the child modal and closing it, the vertical scroll is attached to the screen behind the modal, not the modal itself.

What can I do to reset the scroll? In Javascript I can detect the child modal closing if I need to, so I can trigger something. I just don't know what I would need to do. I imagine I would be setting a vertical-scroll styling property on the modal container element or something...?

Any help would be appreciated.

Showing 11 to 20 of 32 entries