Git Product home page Git Product logo

Comments (6)

whittaker007 avatar whittaker007 commented on July 3, 2024 1

Oh, I see that I can simply override the default theme using "themes/default" instead of "themes/myTheme"

    themeEntries: {
        "themes/default": path.join(__dirname, "themes", "myTheme", "theme.less"),
    },

I guess that's the simplest way to go about it, then I don't need to add anything to appConfig.js.

from mapstore2.

tdipisa avatar tdipisa commented on July 3, 2024

@whittaker007 thank you so much for contacting the MS community. That's something for which you should involve the dev mailing list before opening an issue. Let's keep the issue open for the moment for reference so that you can link that in your message to the ML. Thank you so much.

from mapstore2.

whittaker007 avatar whittaker007 commented on July 3, 2024

I have created issues in both the dev and user mailing lists but have not gotten a reply.

I assume my issue is that I have to install less and compile the less files? But I'm not sure what the destinations should be?

from mapstore2.

tdipisa avatar tdipisa commented on July 3, 2024

@whittaker007 thank you for replying to this. @allyoucanmap answered on the ML:
https://groups.google.com/g/mapstore-users/c/aBwXGgkfv6c/m/NaB-PuYFBAAJ?utm_medium=email&utm_source=footer

from mapstore2.

allyoucanmap avatar allyoucanmap commented on July 3, 2024

@whittaker007 here you can find the setup of the MapStore downstream project using the training process applying an override of the theme:

I'm reopening the issue because the documentation needs to be updated for the themeEntries property and a general review of the theme section

from mapstore2.

whittaker007 avatar whittaker007 commented on July 3, 2024

Hi, I've rebuilt my project following the training process document. I found that I can use that theme method to create a new theme, but in order to make it the default theme I have to add:

            theme: {
                selectedTheme: {
                    id: 'myTheme'
                }
            }

to MapStore2/web/client/product/appConfig.js

However the MapStore2 folder is the external Mapstore git repo which I cannot commit changes to.

If I understand correctly, the two solutions to this are to either make a patch for this file, and make a step in the release/update process to apply that patch, or to somehow get the app to use alternative configuration outside of the MapStore2 folder.

The second method is preferable. I notice that /js/app.jsx appears to include appConfig.js with the following line:

const appConfig = require('@mapstore/product/appConfig').default;

So I tried duplicating MapStore2/web/client/product/appConfig.js as a copy into /js/appConfig.js and changing the require line to:

const appConfig = require('appConfig').default;

but I get the error:

ERROR in ./js/app.jsx 43:18-46
Module not found: Error: Can't resolve 'appConfig' in 'js'

Which is odd because it definitely does exist, and has the same file permissions. I tried several variations of the pathing in the require argument, but with the same error.

Is this the correct way to go about it?

from mapstore2.

Related Issues (20)

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.