Coder Social home page Coder Social logo

hipster-labs / generator-jhipster-bootswatch Goto Github PK

View Code? Open in Web Editor NEW
14.0 17.0 7.0 27 KB

A jhipster module to enable bootswatch theme switcher to generated application

License: Other

JavaScript 78.13% Shell 21.87%
jhipster bootswatch theme-switcher jhipster-application

generator-jhipster-bootswatch's People

Contributors

cyrilchev avatar deepu105 avatar idnord avatar mfoates avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-jhipster-bootswatch's Issues

Unknown Provider: BootswatchInterceptorProvider

Tried adding this to an AngularJS 1.x app built by JHipster, and all looked to be fine from the sanity checks standpoint. When trying to run the application, the Maven build shows successful, but there is an error with the app itself:

Uncaught Error: [$injector:unpr] Unknown provider: BootswatchInterceptorProvider <- BootswatchInterceptor <- $http <- $templateFactory <- $view <- $state
http://errors.angularjs.org/1.5.8/$injector/unpr?p0=BootswatchInterceptorProvider%20%3C-%20BootswatchInterceptor%20%3C-%20%24http%20%3C-%20%24templateFactory%20%3C-%20%24view%20%3C-%20%24state
    at angular.js:68
    at angular.js:4511
    at Object.getService [as get] (angular.js:4664)
    at angular.js:4516
    at Object.getService [as get] (angular.js:4664)
    at angular.js:10889
    at forEach (angular.js:321)
    at $HttpProvider.$get (angular.js:10887)
    at Object.invoke (angular.js:4718)
    at angular.js:4517

My assumption is that this is a conflict with either the latest version of JHipster or with AngularJS 1.x. If so, can you please make sure to list supported/compatible versions?

TypeError: this[method] is not a function

Hi deepu105, I followed the same route as i did for generator-jhipster-entity-audit/ jhipster/generator-jhipster-entity-audit#2.

But i am facing the below issue

vagrant@vagrant-ubuntu-trusty-64:~/git/rsidapp$ yo jhipster-bootswatch
(!) require('yeoman-generator').generators.Base is deprecated. Use require('yeoman-generator').Base directly
Composing JHipster configuration with module entity-audit
Welcome to the JHipster Bootswatch Module! v0.2.1

? Would you like to enable Bootswatch themes? Yes
Reading the JHipster project configuration for your module
events.js:141
throw er; // Unhandled 'error' event
^

TypeError: this[method] is not a function
at Object. (/home/vagrant/git/genJHipster/generator-jhipster/script-base.js:227:25)
at Array.forEach (native)
at Object.Generator.addTranslationKeyToAllLanguages (/home/vagrant/git/genJHipster/generator-jhipster/script-base.js:226:41)
at module.exports.yeoman.generators.Base.extend.writing.updateClientSideFiles (/home/vagrant/git/genJHipster/generator-jhipster-bootswatch/generators/app/index.js:86:20)
at Object. (/home/vagrant/git/genJHipster/generator-jhipster-bootswatch/node_modules/yeoman-generator/lib/base.js:436:25)
at /home/vagrant/git/genJHipster/generator-jhipster-bootswatch/node_modules/yeoman-generator/node_modules/run-async/index.js:33:25
at /home/vagrant/git/genJHipster/generator-jhipster-bootswatch/node_modules/yeoman-generator/lib/base.js:446:8
at processImmediate as _immediateCallback

This doesn't work with angular 2

Fails with below error

Unable to find src/main/webapp/app/blocks/config/http.config.js or missing required jhipster-needle. Interceptor not added to JHipster app.

Unable to find src/main/webapp//index.html or missing required needle. File rewrite failed.

identical src/main/webapp/app/components/bootswatch/bootswatch.service.js
identical src/main/webapp/app/components/bootswatch/bootswatch.directive.js
identical src/main/webapp/app/components/bootswatch/bootswatch.controller.js
identical src/main/webapp/app/components/interceptor/bootswatch.interceptor.js
identical src/main/webapp/i18n/en/global.json
identical src/main/webapp/i18n/hi/global.json
identical src/main/webapp/index.html

Running gulp Inject to add javascript to index

events.js:182
throw er; // Unhandled 'error' event
^

Error: spawn gulp ENOENT
at exports._errnoException (util.js:1016:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)

Generation problem with jwt security

Hi,

I've used JHipster v3.3.0 to generate a monolithic project with JWT security. Then I used JHipster Bootswatch generator to add bootswatch support.

I've got a first problem when I start the client side:

angular.js:4576 Uncaught Error: [$injector:unpr] Unknown provider: localStorageServiceProvider <- localStorageService <- BootswatchInterceptor <- $http <- $translatePartialLoader
The problem is in BootswatchInterceptor, so I changed the declaration of the interceptor from this :

.factory('BootswatchInterceptor', function ($rootScope, $q, $location, localStorageService) {

to this :

.factory('BootswatchInterceptor', ['$rootScope', '$q', '$location', '$localStorage', '$sessionStorage', function ($rootScope, $q, $location, $localStorage, $sessionStorage) {

The problem was solved, but then I got another error with an invalid http status code 405 for bootswatch request :

XMLHttpRequest cannot load http://bootswatch.com/api/3.json?cacheBuster=1464258215905. Response for preflight has invalid HTTP status code 405

When I looked to the code inside BootswatchInterceptor, the condition for testing bootswatch url does nothing. So I changed the code like this :

                if(config.url.indexOf('bootswatch.com/api') !== -1){
                    delete config.headers.Authorization;                   
                }

And then everything works perfectly.

I'm not an angularjs or a jhipster guru so I'm very prudent with this, but I think the generator should be adapted to reflect these changes.

Thank you.

Jhipster image in the homepage disappears after changing the theme

Hi Deepu105, Jhipster image in the homepage disappears after changing the theme.
css class .hipster in main.css that gets affected after theme change
.hipster {
display: inline-block;
width: 347px;
height: 497px;
background: url("../images/hipster.png") no-repeat center top;
background-size: contain;
}

Error when running with react based gateway application

Reading the JHipster project configuration for your module
? Would you like to enable Bootswatch themes? Yes

Unable to find src/main/webapp/app/blocks/config/http.config.js or missing required jhipster-needle. Interceptor not added to JHipster app.

Error while using module

Hi Deepu,
I am getting error while using module.

Repo is here.
https://github.com/manishgoyaler/jhipster_sample.git

(!) require('yeoman-generator').generators.Base is deprecated. Use require('yeoman-generator').Base directly
Composing JHipster configuration with module entity-audit
Welcome to the JHipster Bootswatch Module! v0.2.1

? Would you like to enable Bootswatch themes? Yes
Reading the JHipster project configuration for your module
events.js:141
throw er; // Unhandled 'error' event
^

TypeError: jhipsterFunc.copyTemplate is not a function
at null. (/usr/local/lib/node_modules/generator-jhipster-bootswatch/generators/app/index.js:60:24)
at Array.forEach (native)
at copyFiles (/usr/local/lib/node_modules/generator-jhipster-bootswatch/generators/app/index.js:59:15)
at module.exports.yeoman.generators.Base.extend.writing.writeClientSideFiles (/usr/local/lib/node_modules/generator-jhipster-bootswatch/generators/app/index.js:75:12)
at Object. (/usr/local/lib/node_modules/generator-jhipster-bootswatch/node_modules/yeoman-generator/lib/base.js:436:25)
at /usr/local/lib/node_modules/generator-jhipster-bootswatch/node_modules/yeoman-generator/node_modules/run-async/index.js:33:25
at /usr/local/lib/node_modules/generator-jhipster-bootswatch/node_modules/yeoman-generator/lib/base.js:446:8
at processImmediate as _immediateCallback

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.