Activities of "learnabp"

Answer

I am trying to doenload source code from abp suite version 4.4.0 and i am getting the following error

'<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

infact when i try and download the source for any other module i get the above error

can you please help ?

I have tried again and i still have the following two issues

I am generating the Solution from abp suite

following is the input screen

Issues found

  • Open the solutions and you will find that the ABP License is missing in appsettings.jason and when you run the DB Migrator project you getting a License missing error.
  • When i run the public site i get the following error

I have figured this out can i get this question back?

The way i figured this out was by overwriting the files in /Pages/Identity/Users folder

introducing a variable in the index.js

and in the create.js

I have a requirement to logout a user which is created if they choose the "Primary Contact" role

it seems since it is a createModal i am not able to redirect to the logout page on saving the Primary Contact User

can you please help suggest a way i can achive this requirement?

i am able to display the below message, however when i hit save it will not redirect to the logout page

I am not trying to show you that error i am trying to show you the warnings i am getting

Unknown Parameter closeOnEsc and Unknown Paramter buttons

problem is with the way Confirm is implemented, i have tried to implement confirm see below

var abp = abp || {};

(function ($) {
    if (!sweetAlert || !$) {
        return;
    }

    /* DEFAULTS *************************************************/

    abp.libs = abp.libs || {};
    abp.libs.sweetAlert = {
        config: {
            'default': {

            },
            info: {
                icon: 'info'
            },
            success: {
                icon: 'success'
            },
            warn: {
                icon: 'warning'
            },
            error: {
                icon: 'error'
            },
            confirm: {
                icon: 'warning',
                title: 'Are you sure?',
                showCancelButton: true,
                confirmButtonText: "Yes",
                cancelButtonText: "Cancel",
                reverseButtons: true
                //buttons: ['Cancel', 'Yes']
            }
        }
    };

    /* MESSAGE **************************************************/

    var showMessage = function (type, message, title) {
        if (!title) {
            title = message;
            message = undefined;
        }

        var opts = $.extend(
            {},
            abp.libs.sweetAlert.config['default'],
            abp.libs.sweetAlert.config[type],
            {
                title: title,
                html: message
            }
        );

        return $.Deferred(function ($dfd) {
            Swal.fire(opts).then(function () {
                $dfd.resolve();
            });
        });
    };

    abp.message.info = function (message, title) {
        return showMessage('info', message, title);
    };

    abp.message.success = function (message, title) {
        return showMessage('success', message, title);
    };

    abp.message.warn = function (message, title) {
        return showMessage('warn', message, title);
    };

    abp.message.error = function (message, title) {
        return showMessage('error', message, title);
    };

    abp.message.confirm = function (message, titleOrCallback, callback) {

        var userOpts = {
            html: message
        };

        if ($.isFunction(titleOrCallback)) {
            //closeOnEsc = callback;
            callback = titleOrCallback;
        } else if (titleOrCallback) {
            userOpts.title = titleOrCallback;
        };

       // userOpts.closeOnEsc = closeOnEsc;

        var opts = $.extend(
            {},
            abp.libs.sweetAlert.config['default'],
            abp.libs.sweetAlert.config.confirm,
            userOpts
        );

        return $.Deferred(function ($dfd) {
            Swal.fire(opts).then(function (result) {
                callback && callback(result.isConfirmed);
                $dfd.resolve(result.isConfirmed);
            });
        });
    };

    abp.event.on('aburationInitialized', function () {
        var l = abp.localization.getResource('AbpUi');

        abp.libs.sweetAlert.config.confirm.title = l('AreYouSure');
        abp.libs.sweetAlert.config.confirm.buttons = [l('Cancel'), l('Yes')];
    });

})(jQuery);

lot of things break when using SweetAlert2

i am getting the folowing errors

i ran gulp and looks like its working

I am getting the following error and i dont see the sweetalert2.all.min.js in the folder /libs/sweetalert2/dist/sweetalert2.all.min.js

do i have to copy it in there manually?

AbpException: Could not find the bundle file '/libs/sweetalert2/dist/sweetalert2.all.min.js' for the bundle 'Lepton.Global'!

can you please let me know how i can do this ??

In our use case the users are not allowed to change their username so i have override the UpdatAsync to be as follows

(await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors();

The above line is what changes the SecurityStamp which forces the user out because we are using AbpSecurityStampValidator to ensure that the same user cant be signed in concurrently using the same username.

    public override async Task&lt;IdentityUserDto&gt; UpdateAsync(Guid id, IdentityUserUpdateDto input)
    {

        //ADDED BY VB: To check if all Roles avalible as per license have been consumed.
        if (CurrentUser.UserName != "dfo.admin")
        {
            await CheckCurrentTenantsLicenseConsumed(id, input);
        }

        await IdentityOptions.SetAsync();

        var user = await UserManager.GetByIdAsync(id);
        user.ConcurrencyStamp = input.ConcurrencyStamp;

        if (!string.Equals(user.UserName, input.UserName, StringComparison.InvariantCultureIgnoreCase))
        {
            if (await SettingProvider.IsTrueAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled))
            {
                (await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors();

            }
        }

        await UpdateUserByInput(user, input);
        input.MapExtraPropertiesTo(user);
        (await UserManager.UpdateAsync(user)).CheckErrors();
        await CurrentUnitOfWork.SaveChangesAsync();

        var userDto = ObjectMapper.Map&lt;Volo.Abp.Identity.IdentityUser, IdentityUserDto&gt;(user);

        //ADDED BY VB: To send an email to the user notifying their prifile has changed 
        var ppmUser = await GetUserByEmail(input.Email);
        await _subscriptionEmailer.SendPpmUserUpdatedEmailAsync(ppmUser, "MVC");

        return userDto;
    }

Thanks for you help @liangshiwei

Showing 51 to 60 of 134 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35