Announcement

Collapse
No announcement yet.

Override js files for view - like login

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Override js files for view - like login

    Hey guys..
    I tried for quite some time now but could not find how to override something like the /client/src/views/login.js
    I have to override that, as I want to show a modal before logging in (something like 2F Auth).

    Currently I have copied (and modified) it to client/custom/src/views/login.js
    I also tried changing the tpl in here: client/custom/res/templates/login.tpl

    I have read, that one usually creates a clientDef in /custom/Espo/Custom/Resources.. but there's no clientDef for login afaik..

    only other reference to views/login seems to be in /client/src/controllers/base.js but changing that to "custom:views/login" does not seem to help either..

    Do you have any clue how to override this, without breaking updatability?

    Thanks!
    Joachim

  • #2
    Hello
    "in /client/src/controllers/base.js but changing that to "custom:views/login" "
    you do everything right. Seems it is cached. Clear local cache

    Comment


    • #3
      And.. Is there any way that avoids changing any system files that might be overritten by an update?

      Comment


      • #4
        Sorry, but no

        Comment


        • #5
          Hey,
          thanks so far!

          I feel a bit dumb.. I'm usually no webdev - so I guess it's okay to ask that

          I disabled caching by adding "'useCache' => false," to config.php - so caching should not be an issue..
          But anyways only the espo.min.js is being fetched from the browser.. so I have to rebuild that, right?
          To achieve that: do I have to run the instructions noted as build instructions? https://github.com/espocrm/espocrm/b...d#how-to-build
          Or should it be sufficient to run rebuild in the administration backend?

          I'd like to rebuild that espo.min.js on the server, so it would be awesome if I don't have to have that locally as well...
          Is there any documentation of this process?

          Thanks for your help again!
          Greetings

          Edit: I guess I found out what to do - I had to clone the repo, change the base.js accordingly run npm install and grunt to rebuild the espo.min.js - I just copied that on the server - and now I can work with the login.js, that's on the server as it is dynamically fetched, by espo.min.js (so you won't find it in the inspector of your browser as a source).
          Thanks again
          Last edited by fodinabor; 03-15-2018, 05:51 PM. Reason: Solved

          Comment

          Working...
          X