Permalink
Browse files

Merge branch 'master' of github.com:robfletcher/grails-angular-scaffo…

…lding

Conflicts:
	application.properties
	test/apps/grails-ng/application.properties
  • Loading branch information...
2 parents 7af0ab3 + 3a4941e commit c74677ed79f035c9e44ab7f89252a85cd62c165a Rob Fletcher committed Apr 15, 2013
Showing with 1,591 additions and 7,975 deletions.
  1. +1 −1 grails-app/conf/AngularScaffoldingResources.groovy
  2. +8 −0 readme.md
  3. +7 −3 test/apps/grails-ng/grails-app/conf/ApplicationResources.groovy
  4. +3 −0 test/apps/grails-ng/grails-app/conf/Config.groovy
  5. +3 −3 test/apps/grails-ng/grails-app/conf/DataSource.groovy
  6. +50 −0 test/apps/grails-ng/grails-app/migrations/base-changelog.groovy
  7. +3 −31 test/apps/grails-ng/grails-app/migrations/changelog.groovy
  8. +25 −0 test/apps/grails-ng/grails-app/migrations/field-types.groovy
  9. +1 −0 test/apps/grails-ng/grails-app/views/layouts/home.gsp
  10. +9 −0 test/apps/grails-ng/web-app/bootstrap/css/bootstrap-responsive.min.css
  11. +0 −5,386 test/apps/grails-ng/web-app/bootstrap/css/bootstrap.css
  12. +2 −692 test/apps/grails-ng/web-app/bootstrap/css/bootstrap.min.css
  13. +427 −178 test/apps/grails-ng/web-app/bootstrap/js/bootstrap.js
  14. +1 −1 test/apps/grails-ng/web-app/bootstrap/js/bootstrap.min.js
  15. +10 −12 test/apps/grails-ng/web-app/css/ui-common.css
  16. +0 −645 test/apps/grails-ng/web-app/font-awesome/css/font-awesome-ie7.css
  17. +0 −303 test/apps/grails-ng/web-app/font-awesome/css/font-awesome.css
  18. +33 −0 test/apps/grails-ng/web-app/font-awesome/css/font-awesome.min.css
  19. BIN test/apps/grails-ng/web-app/font-awesome/font/fontawesome-webfont.eot
  20. +277 −248 test/apps/grails-ng/web-app/font-awesome/font/fontawesome-webfont.svg
  21. BIN test/apps/grails-ng/web-app/font-awesome/font/fontawesome-webfont.ttf
  22. BIN test/apps/grails-ng/web-app/font-awesome/font/fontawesome-webfont.woff
  23. +5 −0 test/apps/grails-ng/web-app/prefixfree/prefixfree.min.js
  24. +0 −159 web-app/js/angular/angular-1.0.3.min.js
  25. +476 −247 web-app/js/angular/{angular-1.0.3.js → angular-1.0.6.js}
  26. +162 −0 web-app/js/angular/angular-1.0.6.min.js
  27. +0 −10 web-app/js/angular/angular-resource-1.0.3.min.js
  28. +78 −56 web-app/js/angular/{angular-resource-1.0.3.js → angular-resource-1.0.6.js}
  29. +10 −0 web-app/js/angular/angular-resource-1.0.6.min.js
@@ -1,6 +1,6 @@
import grails.util.GrailsUtil
-def fileVersion = GrailsUtil.isDevelopmentEnv() ? '1.0.3' : '1.0.3.min'
+def fileVersion = GrailsUtil.isDevelopmentEnv() ? '1.0.6' : '1.0.6.min'
modules = {
angular {
View
@@ -32,6 +32,14 @@ The HTML templates need to be generated individually for each domain class as th
## Customizing
+### Enable optimistic locking check
+
+By default, the JSON converter does not send the object's "version" field generated by Hibernate. Because of that, the controller does not check when concurrent modifications occur.
+To enable optimistic locking check, simply add the following in your Config.groovy:
+
+grails.converters.json.domain.include.version = true
+
+
### Using Grails RESTful URL mappings
By default Grails uses a non-RESTful URL scheme where the controller action representing the verb is part of the URL. In the Grails documentation there is a section on [configuring RESTful URL mappings](http://grails.org/doc/latest/guide/theWebLayer.html#mappingHTTP). If you want to use such a URL scheme with this plugin you will need to override the `web-app/js/grails-default.js` file that configures an Angular _$resource_ service that maps to your Grails controllers.
@@ -1,11 +1,15 @@
modules = {
bootstrap {
dependsOn 'jquery'
- resource url: 'bootstrap/css/bootstrap.min.css'
- resource url: 'bootstrap/js/bootstrap.min.js'
+ resource url: 'bootstrap/css/bootstrap.min.css', exclude: 'minify'
+ resource url: 'bootstrap/css/bootstrap-responsive.min.css', exclude: 'minify'
+ resource url: 'bootstrap/js/bootstrap.min.js', exclude: 'minify'
}
'font-awesome' {
- resource url: 'font-awesome/css/font-awesome.css'
+ resource url: 'font-awesome/css/font-awesome.min.css', exclude: 'minify'
+ }
+ prefixfree {
+ resource url: 'prefixfree/prefixfree.min.js', disposition: 'head', exclude: 'minify'
}
'ui-common' {
dependsOn 'bootstrap', 'font-awesome'
@@ -62,6 +62,9 @@ grails.exceptionresolver.params.exclude = ['password']
// enable query caching by default
grails.hibernate.cache.queries = true
+grails.plugin.databasemigration.updateOnStart = true
+grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.groovy']
+
// set per-environment serverURL stem for creating absolute links
environments {
development {
@@ -13,19 +13,19 @@ hibernate {
environments {
development {
dataSource {
- dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
+ dbCreate = "" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
test {
dataSource {
- dbCreate = "update"
+ dbCreate = ""
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
production {
dataSource {
- dbCreate = "update"
+ dbCreate = ""
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
pooled = true
properties {
@@ -0,0 +1,50 @@
+databaseChangeLog = {
+
+ changeSet(author: "rob (generated)", id: "1358405807992-1") {
+
+ preConditions(onFail: 'MARK_RAN') {
+ not {
+ tableExists tableName: 'album'
+ }
+ }
+
+ createTable(tableName: "album") {
+ column(autoIncrement: "true", name: "id", type: "bigint") {
+ constraints(nullable: "false", primaryKey: "true", primaryKeyName: "albumPK")
+ }
+
+ column(name: "version", type: "bigint") {
+ constraints(nullable: "false")
+ }
+
+ column(name: "artist", type: "varchar(255)") {
+ constraints(nullable: "false")
+ }
+
+ column(name: "title", type: "varchar(255)") {
+ constraints(nullable: "false")
+ }
+
+ column(name: "year", type: "varchar(255)") {
+ constraints(nullable: "false")
+ }
+ }
+
+ }
+
+ changeSet(author: "rob (generated)", id: "1358405807992-2") {
+
+ preConditions(onFail: 'MARK_RAN') {
+ not {
+ indexExists indexName: 'unique_title'
+ }
+ }
+
+ createIndex(indexName: "unique_title", tableName: "album", unique: "true") {
+ column(name: "artist")
+
+ column(name: "title")
+ }
+
+ }
+}
@@ -1,34 +1,6 @@
databaseChangeLog = {
- changeSet(author: "rob (generated)", id: "1358405807992-1") {
- createTable(tableName: "album") {
- column(autoIncrement: "true", name: "id", type: "bigint") {
- constraints(nullable: "false", primaryKey: "true", primaryKeyName: "albumPK")
- }
+ include file: 'base-changelog.groovy'
+ include file: 'field-types.groovy'
- column(name: "version", type: "bigint") {
- constraints(nullable: "false")
- }
-
- column(name: "artist", type: "varchar(255)") {
- constraints(nullable: "false")
- }
-
- column(name: "title", type: "varchar(255)") {
- constraints(nullable: "false")
- }
-
- column(name: "year", type: "varchar(255)") {
- constraints(nullable: "false")
- }
- }
- }
-
- changeSet(author: "rob (generated)", id: "1358405807992-2") {
- createIndex(indexName: "unique_title", tableName: "album", unique: "true") {
- column(name: "artist")
-
- column(name: "title")
- }
- }
-}
+}
@@ -1,23 +1,48 @@
databaseChangeLog = {
changeSet(author: "rob (generated)", id: "1358406936189-1") {
+
+ preConditions(onFail: 'MARK_RAN') {
+ not {
+ columnExists tableName: 'album', columnName: 'compilation'
+ }
+ }
+
addColumn(tableName: "album") {
column(name: "compilation", type: "boolean") {
constraints(nullable: "false")
}
}
+
}
changeSet(author: "rob (generated)", id: "1358406936189-2") {
+
+ preConditions(onFail: 'MARK_RAN') {
+ not {
+ columnExists tableName: 'album', columnName: 'review_rating'
+ }
+ }
+
addColumn(tableName: "album") {
column(name: "review_rating", type: "integer")
}
+
}
changeSet(author: "rob (generated)", id: "1358406936189-3") {
+
+
+ preConditions(onFail: 'MARK_RAN') {
+ not {
+ columnExists tableName: 'album', columnName: 'review_text'
+ }
+ }
+
addColumn(tableName: "album") {
column(name: "review_text", type: "varchar(255)")
}
+
}
}
@@ -12,6 +12,7 @@
<link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">
<r:require module="ui-common"/>
+ <r:require module="prefixfree"/>
<style>
body {
padding-bottom: 40px;
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit c74677e

Please sign in to comment.