Configuration File: chaise-config.js
Chaise uses a set of default configuration parameters. You can overwrite them through the chaise-config.js
file and/or the search parameters in the URL.
A Chaise deployment includes a sample config file (chaise-config-sample.js) at the root directory that you can edit and then rename to chaise-config.js
.
Each chaise config property below can be defined in each place that we allow for a chaise configuration with a few exceptions noted below. Chaise config uses a set order for determining which chaise configuration’s properties will be used. The order that the properties will be checked and then applied are as follows:
Default values defined in chaise configuration document.
Any properties defined at the root of the object returned from chaise-config.js.
Any matching
configRules
in the order they appear in theconfigRules
array. Properties in the last matching rule will take precedenceAny properties defined at the root of the object returned from the “tag:isrd.isi.edu,2019:chaise-config” annotation.
Step 3 from above, but with the
configRules
from the “tag:isrd.isi.edu,2019:chaise-config” annotation.
Notes: as the configRules
are checked, properties set in step 2 will be overridden by properties defined in step 3 that have the same name. This allows the server wide configuration to be a base configuration for the chaise apps and allows for further configuration based on a combination of hostname and catalog id. This applies for step 4 and 5 as well when reading the values from the catalog annotation.
If a property appears in the same configuration twice, the property defined later will be used.
Table of Contents:
General Configuration:
ermrestLocation
The location of the ERMrest service.
:warning: This property is only allowed in
chaise-config.js
file. Defining this on the catalog annotation has no effect.
Type: String - URL
Default value:
window.location.protocol + // + window.location.host + /ermrest
Sample syntax:
ermrestLocation: "www.isrd.isi.edu/ermrest"
defaultCatalog
Use this parameter to specify which catalog Chaise shows by default.
:warning: This property is only allowed in
chaise-config.js
file. Defining this on the catalog annotation has no effect.
It is strongly recommended defining this in your chaise-config.js
file. This property is used to fetch the catalog annotation information for pages that rely on chaise-config.js
but don’t have a catalog id in the path. For example, the navbar on static pages uses this property to try to fetch a catalog annotation for configuring the navbar.
When a user navigates to “/chaise/recordset” and omits the rest of the path, the defaultCatalog
paired with defaultTable
are used to generate a valid recordset link for the user.
Type: String - Catalog ID
Sample syntax:
defaultCatalog: "1"
defaultTable
Use this parameter to specify which table Chaise shows by default for the current catalog.
Type: Object
General syntax:
defaultTable: { schema: <schema name>, table: <table name> }
Sample syntax:
defaultTable: { schema: "isa", table: "dataset" }
Login Configuration:
logoutURL
The URL to the logout page, root if not defined.
Type: String - URL
Default behavior: assumed that the logout page is at the root
Sample syntax:
logoutURL: "/"
dataBrowser
The URL to continue after a logout. Also used when an error is thrown and we don’t know where to redirect the user.
Type: String - URL
Default behavior: navigate the user to the root of the server (homepage) on logout
Sample syntax:
dataBrowser: "/"
signUpURL
Use this parameter to specify what the “Sign Up” link in the navbar should link to. If signUpURL
is unspecified, the navbar will not display a “Sign Up” link.
Type: String - URL
Default behavior: no signup link will be shown
Sample syntax:
signUpURL: "<your-url>"
termsAndConditionsConfig
Use this property to enforce joining a globus group before continuing use of the application as a logged in user. This config property defaults to null
when undefined. If the property is not an object containing all of the above 3 properties, this will be set to null
.
Type: Object
Default behavior: group inclusion check won’t be enforced to continue login
General syntax:
termsAndConditionsConfig: { groupId: <url>, joinUrl: <url>, groupName: <group displayname> }
termsAndConditionsConfig
attributesgroupId
: String - the identifier to the group (looks like a URL for globus groups, see example below)joinUrl
: String - URL to the join the required groupgroupName
: String - the name of the group as it appears in globus
Sample syntax:
termsAndConditionsConfig: { groupId: "https://auth.globus.org/962d5add-ff9a-11eb-8932-d71f8cc57c67", joinUrl: "https://app.globus.org/groups/962d5add-ff9a-11eb-8932-d71f8cc57c67/join", groupName: "Josh test group" }
Display Configuration:
customCSS
The URL for a style sheet file to be applied to the application header (<head>
tag). This is typically a relative URL to a dedicated stylesheet in the CSS folder of the related static site repo (For example, in RBK, it’s /assets/css/chaise.css
in the rbk-www repo). More information can be found here.
Type: String - URL
Sample syntax:
customCSS: "/assets/css/chaise.css"
maxRecordsetRowHeight
Set this property to false
if you don’t want content to be clipped in tables else set it to a number which represents the maximum row height when not expanded.
Type: Boolean || Number
Default behavior: 160 will be used if no value is supplied
Sample syntax:
maxRecordsetRowHeight: 200
confirmDelete
If false
, the user will not be prompted by a modal when deleting an item
Type: Boolean
Default behavior: user will be prompted with a dialog to confirm they want to delete
Sample syntax:
confirmDelete: false
editRecord
If present and equal to false
, the chaise pages will hide all the edit and create buttons regardless of user ACLs. Chaise will also disallow users from accessing recordedit app in this case.
Type: Boolean
Default behavior: Allows for inserting and editing records through the recordedit page if the user has proper ACLs.
Sample syntax:
editRecord: false
deleteRecord
If present and equal to false
, the chaise pages will hide all the delete buttons regardless of user ACLs. Otherwise chaise will consult the user ACL for conditonally hiding or showing delete buttons.
Type: Boolean
Default behavior: Chaise pages display delete buttons based on user ACLs.
Sample syntax:
deleteRecord: false
allowErrorDismissal
Set this property to true
if you want to allow dismissable error message dialogs. This property when defined as true
will cause a degraded UX experience that will prevent future errors from being thrown and other functionality might not behave as expected. This should ONLY be used in development environments.
Type: Boolean
Default behavior: All terminal error message display an error message dialog that is not dismissable
Sample syntax:
allowErrorDismissal: true
hideTableOfContents
If true, hides the table of contents panel on the record app.
Type: Boolean
Default behavior: table of contents will be visible
Sample syntax:
hideTableOfContents: true
disableExternalLinkModal
Set this to true to disable the external link notification.
Type: Boolean
Default behavior: a notification that you are navigating to an external page in 5 seconds will show
Sample syntax:
disableExternalLinkModal: true
hideGoToRID
Use this property to hide the RID search box in the navbar. The RID search box is present in the navbar when resolverImplicitCatalog !== null
(meaning the resolver is in use) and hideGoToRID !== true
Type: Boolean
Default behavior: the RID search box will show in the navbar to the left of the login button or the logged in user information
Sample syntax:
hideGoToRID: true
facetPanelDisplay
Use this property to change the settings related to the facet panel.
Type: Object
Default behavior: The facet panel will be displayed for all tables. It will be opened in the
compact
context (recordset app) and closed in all other subcontexts.General syntax:
facetPanelDisplay: { open: [_context_], closed: [_context_], maxFacetDepth: number }
Attributes:
open
: An array of contexts that the facet panel should be open for on page load. Since facet panels are displayed on context and subcontexts associated withcompact
, only these annotations would be appropriate here.*
may be used but will be treated the same ascompact
. If a context is present in both open and closed, open will take priority. If the current context is not mentioned in eitheropen
orclosed
, it will try to inherit its value from a parent context. Defining only one array,open
orclosed
, will assume the other property is equal to[]
.closed
: An array of contexts that the facet panel should be closed for on page load.maxFacetDepth
: A number indicating how many levels of facets we should allow. The following are the acceptable values:0: disable the faceting feature.
1: The default behavior. Facet panel is displayed on the initial recordset page or recordset popups. But it’s not offered on the facet popups.
2: Facet panel is displayed on the initial recordset page or recordset popups. It’s also displayed on the facet popups.
2+: Not allowed for now, as we think allowing more facets would confuse the users. When we encounter this value, we will use the maximum we support (2).
Sample syntax:
facetPanelDisplay: { open: ["compact/select/association"], maxFacetDepth: 2 }
templating
Use this property to change the settings related to templating environment throughout chaise and ermrestjs.
Type: Object
Default behavior:
mustache
will be used as the default template engine.General syntax:
templating: { engine: 'handlebars' or 'mustache', site_var: <any object> }
Attributes:
engine
: The default template engine,"handlebars"
or"mustache"
.site_var
: Allows injecting values into the environment. The defined object can have any attribute that you would like. In all templating environments, you may refer to the values inside this object using the$site_var
namespace. For example, with the following definition:{ "templating": { "site_var": { "repository_name": "Chaise", "acl_groups": { "group1": "http://group-1-globus-id", "group2": "http://group-2-globus-id", } } } }
You may use the following templates:
current repository: {{{ $site_var.repository_name }}} {{#if (isUserInAcl $site_var.acl_groups.group1 )}}allowed{{else}}not_allowed{{/if}}
Sample syntax:
templating: { engine: 'handlebars' }
hideRecordeditLeaveAlert
Use this property to avoid recordedit app from showing an alert when users are trying to navigate away.
Type: Boolean
Default behavior: Recordedit app will warn users when they are about to navigate away from recordedit to preserve the editted content.
Sample syntax:
hideRecordeditLeaveAlert: true
Data Entry Configuration:
asciiTextValidation
Use this proprety to ensure users can only use ASCII characters while entering text values in the recordedit app.
:warning: This is just a client-side validation and only affects the inputs in the recordedit app.
Type: Boolean
Default behavior: Users can use any characters while entering values in the recordedit app.
Sample syntax:
asciiTextValidation: true
Export Configuration:
disableDefaultExport
When the export annotation is missing from table and schema, ermrestjs will use the heuristics to generate a default export template. Set this attribute to true
to avoid using the heuristics.
Type: Boolean
Default behavior: ermrestjs will use the heuristics to generate a default export template
Sample syntax:
disableDefaultExport: true
exportServicePath
You can use this variable to switch between different export services that might be available in the deployment.
Type: String
Default behavior: “/deriva/export/” will be used as the defailt path
Sample syntax:
exportServicePath: "/deriva/export/"
System Columns Configuration:
systemColumnsDisplayCompact
If set to true
, apply the system columns heuristics when no visible columns list is defined. This will put the RID system column as the first self referencing key column. ‘RCB’, ‘RMB’, ‘RCT’, ‘RMT’ will be placed at the very end of the list respectively. If set to an array, only system columns in the array will be displayed in the order mentioned earlier. Defining this property as []
will hide all system columns. Setting to false
will fall back to the default behavior. This applies to compact and all subcontexts.
Type: Boolean || Array
Default behavior: system columns will be displayed based on how ermrest returns the set of all columns
Sample syntax:
systemColumnsDisplayCompact: ["RMB", "RMT"]
systemColumnsDisplayDetailed
See above description for systemColumnsDisplayCompact
. This property behaves the same way except only for the detailed context.
Type: Boolean || Array
Default behavior: system columns will be displayed based on how ermrest returns the set of all columns
Sample syntax:
systemColumnsDisplayDetailed: true
systemColumnsDisplayEntry
See above description for systemColumnsDisplayCompact
. This property behaves the same way except only for the entry contexts.
Type: Boolean || Array
Default behavior: system columns will be displayed based on how ermrest returns the set of all columns
Sample syntax:
systemColumnsDisplayEntry: ["RMT", "RCT"]
System Configuration:
internalHosts
If external link notification is enabled, Chaise will use this array to determine whether the current host is external. List any hostnames that should be considered internal. If defined, <current hostname>
will not be automatically added to the list.
Type: Array
Default behavior: the current hostname will be treated as an internal host
Sample syntax:
internaleHosts: ["dev.rebuildingakidney.org", "dev.gudmap.org"]
includeCanonicalTag
This variable can be used to force chaise to include a tag in the tag that defines the canonical link for each of the entities and other resource pages.
Type: Boolean
Default behavior: canonical tag will not be included
Sample syntax:
includeCanonicalTag: true
logClientActions
Set this to false
to disable the logging of client side actions which occurs when users interact with the app in ways that don’t generate a request to the database.
Type: Boolean
Default behavior: client actions that don’t normally interact with the database will be logged
Sample syntax:
logClientActions: false
configRules
Allows for host specific configuration rules. Each object in the array contains 2 properties, host
and config
. host
is expected to be in the format of a single string value or an array of string values. host
is being matched against the hostname for the current browser location. config
mimics the chaise-config properties. All chaise config properties can be defined in this block except this property (configRules
).
Type: Array
General syntax:
configRules: [ { host: <host url> || [<host url>, <host url>], config: {} }, { ... }, ... ]
Sample syntax:
configRules: [ { host: ["www.rebuildingakidney.org", "staging.rebuildingakidney.org", "dev.rebuildingakidney.org"], config: { headTitle: "RBK", navbarBrand: "/resources/" } }, { host: ["www.gudmap.org", "staging.gudmap.org", "dev.gudmap.org"], config: { headTitle: "GUDMAP", navbarBrand: "/" } } ]
savedQueryConfig
Use this property to define the path to the saved query table for the saved query feature. The storageTable
is required to be an object with 4 properties, catalog
, schema
, table
, and columnNameMapping
. This config property defaults to null when undefined. If savedQueryConfig
is not an object with an object containing all of the above 3 properties, this will be set to null
. The defaultName
object has 3 properties that can be defined to change when a simplified default name syntax is applied.
Type: Object
Default behavior: the saved query feature will be turned off
General syntax:
savedQueryConfig: { storageTable: { catalog: <catalog id>, schema: <schema name>, table: <table name>, columnNameMapping: { catalog: <string>, schemaName: <string>, tableName: <string>, userId: <string>, queryId: <string>, queryName: <string>, description: <string>, facets: <string>, encodedFacets: <string>, lastExecutionTime: <string> } }, defaultName: { facetChoiceLimit: <int>, facetTextLimit: <int>, totalTextLimit: <int>, }, }
storageTable
attributescatalog
: String - catalog id where the saved query table isschema
: String - schema name in above catalog where below table is storedtable
: String - table name for saving queries tocolumnNameMapping
: Object - all attributes are required for saved query functionality to work properly. These are the column names in the model that the data will be stored to. The columns require specific types:description
aslongtext | markdown
,facets
asjsonb
,encodedFacets
aslongtext
,lastExecutionTime
astimestamp[tz]
, and all others are typetext
defaultName
attributesfacetChoiceLimit
: Set this value to define when to show a compressed facet syntax based on how many choices are selected. By default this value is 5. Set this to 0 to always show the compressed syntax.facetTextLimit
: Set this value to define when to show a compressed facet syntax based on the total string length of the facet choices when appended together. By default this value is 60. Set this to 0 to always show the compressed syntax.totalTextLimit
: Set this value to define when to show a shortened facet syntax based on the total string length of all facets text when appended together. By default this value is 200. Set this to 0 to always show the further shortened syntax.
Sample syntax:
savedQueryConfig: { storageTable: { catalog: "73448", schema: "faceting", table: "saved_query", columnNameMapping: { queryId: "query_id", catalog: "catalog", schemaName: "schema_name", tableName: "table_name", userId: "user_id", queryName: "name", description: "description", facets: "facets", encodedFacets: "encoded_facets", lastExecutionTime: "last_execution_time" } }, defaultName: { facetChoiceLimit: 2, facetTextLimit: 40, totalTextLimit: 150, } }
Other Configuration:
assetDownloadPolicyURL
Set this property to the url that points to the download policy for when an asset is fetched but the user is unauthorized to fetch that asset.
Type: String - URL
Default behavior: no asset policy link will be shown in the error modal
Sample syntax:
assetDownloadPolicyURL: "<your url>"