Skip to content

Commit

Permalink
BUG fix Gruntfile, bower, AnyplaceAssets, Viewer, anyplace-core-js
Browse files Browse the repository at this point in the history
  • Loading branch information
nneof committed Jul 13, 2021
1 parent 064317b commit faf1e65
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 1,256 deletions.
10 changes: 10 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions server/.idea/play2_project_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions server/.idea/play2_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/app/Anyplace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import utils.LPLogger
import scala.concurrent.Future

@Singleton
class Anyplace @Inject() (conf: Configuration, mdb: MongodbDatasource) (appLifecycle: ApplicationLifecycle) {
class Anyplace @Inject() (conf: Configuration) (appLifecycle: ApplicationLifecycle) {
// ON APPLICATION START (ctor):
//ifxDB.getStaticInstance(conf)
CouchbaseDatasource.getStaticInstance(conf)
CouchbaseDatasource.initialize(conf)
MongodbDatasource.initialize(conf)
logAnalyticsInstallation()

Expand Down
34 changes: 19 additions & 15 deletions server/app/controllers/AnyplaceAssets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,29 @@
*/
package controllers

import datasources.SCHEMA
import javax.inject.{Inject, Singleton}
import play.api.mvc._

@Singleton
class AnyplaceAssets @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
class AnyplaceAssets @Inject()(cc: ControllerComponents,
assets: Assets) extends AbstractController(cc) {

//def at(path: String, file: String): Action[AnyContent] = Action {
// implicit request =>
// // Assets.at(path+"/anyplace_viewer_campus", file)
// val uri = request.headers.get("referer").getOrElse("")
// var viewerDir = "/anyplace_viewer/"
// val campus = !uri.contains(SCHEMA.fCampusCuid)
// if (campus) {
// viewerDir = "/anyplace_viewer/"
// } else {
// viewerDir = "/anyplace_viewer_campus/"
// }
//
//
//}
def at(path: String, file: String): Action[AnyContent] = Action.async {
implicit request =>
// Assets.at(path+"/anyplace_viewer_campus", file)
val uri = request.headers.get("referer").getOrElse("")
var viewerDir = "/anyplace_viewer/"
val campus = !uri.contains(SCHEMA.fCampusCuid)
if (campus) {
viewerDir = "/anyplace_viewer/"
} else {
viewerDir = "/anyplace_viewer_campus/"
}
// assets.a
//play.api.controllers.AnyplaceAssets.super.at
assets.at(path + viewerDir, file).apply(request)
//.apply(request)
}

}
3 changes: 2 additions & 1 deletion server/app/controllers/ApplicationAnyplace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import javax.inject.{Inject, Singleton}
import play.api.Configuration
import play.api.libs.json.{JsValue, Json}
import play.api.mvc.{AbstractController, ControllerComponents}
import utils.AnyResponseHelper

@Singleton
class ApplicationAnyplace @Inject()(cc: ControllerComponents,
Expand All @@ -55,6 +54,7 @@ class ApplicationAnyplace @Inject()(cc: ControllerComponents,
val address = conf.get[String]("server.address")
val port = conf.get[String]("server.port")


var variant=""
if (address.contains("dev")) {
variant = "beta"
Expand All @@ -65,6 +65,7 @@ class ApplicationAnyplace @Inject()(cc: ControllerComponents,

val res: JsValue = Json.obj(
"version" -> version,
"address" -> address,
"port"-> port,
"variant" -> variant)

Expand Down
2 changes: 1 addition & 1 deletion server/app/datasources/CouchbaseDatasource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object CouchbaseDatasource {
private var sInstance: CouchbaseDatasource = null
private val sLockInstance: AnyRef = new AnyRef()

def getStaticInstance(conf: Configuration): CouchbaseDatasource = {
def initialize(conf: Configuration): CouchbaseDatasource = {
sLockInstance.synchronized {
if (sInstance == null) {
// It either users clusterNodes or hostname
Expand Down
4 changes: 2 additions & 2 deletions server/app/datasources/ProxyDataSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class ProxyDataSource @Inject() (conf: Configuration) extends IDatasource {

def getIDatasource: IDatasource = getInstance()

private def initCouchbase() : Unit = {
this.mCouchbase = CouchbaseDatasource.getStaticInstance(conf)
private def initCouchbase(): Unit = {
this.mCouchbase = CouchbaseDatasource.initialize(conf)
}

private def initMongodb(): Unit = {
Expand Down
4 changes: 2 additions & 2 deletions server/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// TODO:PM
//import com.typesafe.config._
//val conf = ConfigFactory.parseFile(new File("conf/reference.conf")).resolve()
//name := conf.getString("application.name")
//version := conf.getString("application.version")
//name := conf.get[String]("application.name")
//version := conf.get[String]("application.version")

lazy val root = (project in file("."))
.enablePlugins(PlayScala)
Expand Down
2 changes: 1 addition & 1 deletion server/conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ GET /architect

# VIEWER:
GET /viewer/index.html controllers.WebAppController.serveViewer(file="index.html")
#GET /viewer/*file controllers.AnyplaceAssets.at(path="/public", file)
GET /viewer/*file controllers.AnyplaceAssets.at(path="/public", file)
GET /viewer/ controllers.WebAppController.serveViewer(file="index.html")
GET /viewer controllers.WebAppController.AddTrailingSlash()

Expand Down
4 changes: 2 additions & 2 deletions server/public/anyplace_architect/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = function (grunt) {
concat: {
js: {
src: [
'app.js',
'../shared/js/*.js',
'../shared/js/*.js', // FIRST
'app.js', // SECOND
'../shared/js/anyplace-core-js/*.js',
'scripts/*.js',
'controllers/*.js'
Expand Down
4 changes: 2 additions & 2 deletions server/public/anyplace_viewer/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module.exports = function (grunt) {
concat: {
js: {
src: [
'../shared/js/*.js',
'../shared/js/*.js', // FIRST
'app.js', // SECOND
'../shared/js/anyplace-core-js/*.js',
'app.js',
'scripts/*.js',
'controllers/*.js'
],
Expand Down
6 changes: 2 additions & 4 deletions server/public/anyplace_viewer/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@
"fontawesome": "~4.3.0",
"jqueryui-touch-punch": "*",
"select2": "~3.5.2",
"angular-aria": "1.7.2",
"angular-aria": "1.5.8",
"angular-animate": "1.5.8",
"angular-material": "^1.1.4"
},
"resolutions": {
"angular": "~1.3.20",
"angular-animate": "1.5.8",
"angular-aria": "1.5.8"
"angular": "~1.3.20"
}
}
4 changes: 2 additions & 2 deletions server/public/anyplace_viewer_campus/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = function (grunt) {
concat: {
js: {
src: [
'app.js',
'../shared/js/*.js',
'../shared/js/*.js', // FIRST
'app.js', // SECOND
'../shared/js/anyplace-core-js/*.js',
'scripts/*.js',
'controllers/*.js'
Expand Down
2 changes: 1 addition & 1 deletion server/public/anyplace_viewer_campus/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"fontawesome": "~4.3.0",
"jqueryui-touch-punch": "*",
"select2": "~3.5.2",
"angular-aria": "1.7.2",
"angular-aria": "1.5.8",
"angular-animate": "1.7.2",
"angular-material": "^1.1.4"
},
Expand Down
Loading

0 comments on commit faf1e65

Please sign in to comment.