-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ERM-2971: Back end changes to support storing location/dimensions of …
…widgets (#93) * feat: Dashboard display data Added a String field to house generic display data about the dashboard. Have not explicitly modelled as this is display only data and we should not particularly care refs ERM-2971, ERM-1795 * refactor: DashboardDisplayData Changed dashboard display data to its own domain class, so we can fetch it completely independently of dashboard. This _does_ mean that editing display data does not count as an update to the dashboard as far as GORM is concerned. However we should NOT be reflecting frontend ordering changes in any backend logic anyway, so this is fine--I think ERM-2971 * chore: Removed old displayData linked to dashboard object itself
- Loading branch information
1 parent
67feccf
commit 5916e47
Showing
8 changed files
with
114 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
service/grails-app/domain/org/olf/DashboardDisplayData.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.olf | ||
|
||
import grails.gorm.MultiTenant | ||
|
||
/* A domain class to hold all of the information about */ | ||
|
||
class DashboardDisplayData implements MultiTenant<DashboardDisplayData> { | ||
|
||
String id | ||
String dashId | ||
String layoutData | ||
|
||
static mapping = { | ||
id column:'ddd_id', generator: 'uuid2', length:36 | ||
version column: 'ddd_version' | ||
dashId column: 'ddd_dash_id' | ||
layoutData column: 'ddd_layout_data' | ||
} | ||
|
||
static constraints = { | ||
dashId (nullable:false, blank:false) | ||
layoutData (nullable: true, blank: false) | ||
} | ||
} |
21 changes: 18 additions & 3 deletions
21
service/grails-app/migrations/service-interaction-3-0.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
databaseChangeLog = { | ||
changeSet(author: "efreestone (manual)", id: "2023-08-16-0940-001") { | ||
addColumn (tableName: "dashboard" ) { | ||
column(name: "dshb_display_data", type: "text") | ||
changeSet(author: "efreestone (manual)", id: "2023-08-17-1207-001") { | ||
createTable (tableName: "dashboard_display_data" ) { | ||
column(name: "ddd_id", type: "VARCHAR(36)") { | ||
constraints(nullable: "false") | ||
} | ||
column(name: "ddd_version", type: "BIGINT") { | ||
constraints(nullable: "false") | ||
} | ||
column(name: "ddd_dash_id", type: "VARCHAR(36)") | ||
column(name: "ddd_layout_data", type: "text") | ||
} | ||
} | ||
|
||
changeSet(author: "efreestone (manual)", id: "2023-08-17-1207-002") { | ||
addUniqueConstraint( | ||
columnNames: "ddd_dash_id", | ||
constraintName: "dashboard_display_data_dash_id_unique", | ||
tableName: "dashboard_display_data" | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
service/grails-app/views/dashboardDisplayData/_dashboardDisplayData.gson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import org.olf.DashboardDisplayData | ||
|
||
import groovy.transform.* | ||
|
||
@Field | ||
DashboardDisplayData dashboardDisplayData | ||
|
||
json g.render (dashboardDisplayData) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters