Giter Site home page Giter Site logo

Comments (9)

GSGBen avatar GSGBen commented on August 22, 2024 2

Sweet, thanks. That got the close working. I might put all the changes into a pull request later but not sure how you want to handle bootstrap 4/5 compatibility for older projects. For any other users coming across this, the fixes so far are:

  • Find+replace the following in all code:
find replace
data-toggle data-bs-toggle
data-target data-bs-target
data-dismiss data-bs-dismiss
  • At the bottom of Users.cshtml and Roles.cshtml are two large inline scripts that define some table actions. At the top of that script block in Users.cshtml add
var userModal = new bootstrap.Modal(document.getElementById('userModal'));
var editModal = new bootstrap.Modal(document.getElementById('editModal'));
var pwdModal = new bootstrap.Modal(document.getElementById('pwdModal'));
  • Search down for references to .modal(). Replace them with either .show() or .hide() on the objects you just created above. E.g. userModal.show(); in the New button
  • Repeat in Roles.cshtml for the two modal types there

The only remaining issue seems to be that claims are showing as undefined in the edit dialogue (e.g. the initial Name claim), but show fine in the table.

from identitymanagerui.

GSGBen avatar GSGBen commented on August 22, 2024 2

Someone asked to see the changes fully apply so I've extracted out an example template here: https://github.com/GSGBen/IdentityManagerUI-NetCore6-Template.

from identitymanagerui.

GSGBen avatar GSGBen commented on August 22, 2024 1

And the fix for that is changing value.Key to value.key and value.Value to value.value in Users.cshtml.

from identitymanagerui.

t1fra avatar t1fra commented on August 22, 2024 1

Just in case somebody prefers this one over your new Blazor Project. The Undefined issue happens as well on Role Claims. Same solution as for User Claims.

Changing value.Key to value.key and value.Value to value.value in Roles.cshtml.

from identitymanagerui.

mguinness avatar mguinness commented on August 22, 2024

It might be related to Bootstrap version, the new web template is probably using Bootstrap 5 versus Bootstrap 4 in this project.

Update: It looks like the attributes data-toggle & data-target need to be changed to data-bs-toggle & data-bs-target.

from identitymanagerui.

GSGBen avatar GSGBen commented on August 22, 2024

Still no luck after that unfortunately. Testing further it seems that $('#userModal').modal({ backdrop: 'static' }); works to show the modal in asp .net core 5 (Bootstrap 4) but doesn't work in asp.net core 6 (bootstrap 5).

from identitymanagerui.

GSGBen avatar GSGBen commented on August 22, 2024

Looks like I can get it to show with

var userModal = new bootstrap.Modal(document.getElementById('userModal'));
userModal.toggle();

The submit button works to submit, but neither it or the X button close the modal.

from identitymanagerui.

mguinness avatar mguinness commented on August 22, 2024

Yeah, looks like you need data-bs-dismiss instead of data-dismiss, see Migrating to v5 for required changes.

from identitymanagerui.

mguinness avatar mguinness commented on August 22, 2024

Thanks for outlining these changes, I've linked to this issue in README.

from identitymanagerui.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.