Skip to content

Commit fa92243

Browse files
ndg63276Mark Williams
andauthored
LIMS-1974: Indicate dev DB in header bar (#1012)
* LIMS-1974: Indicate dev DB in header bar * LIMS-1974: Revert changes to config * LIMS-1974: Use a phase banner --------- Co-authored-by: Mark Williams <[email protected]>
1 parent f2e46fa commit fa92243

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

api/config_sample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$mode = 'dev';
1111

1212
# Database credentials, db = hostname/database
13-
$isb = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb');
13+
$isb = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb');
1414
$dbtype = 'mysql';
1515

1616
# Encoded JWT key, used to sign and check validaty of jwt tokens

api/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function setupApplication($mode): Slim
6767
});
6868

6969
$app->get('/options', function () use ($app) {
70-
global $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description,
70+
global $mode, $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description,
7171
$facility_courier_countries, $facility_courier_countries_nde, $facility_courier_countries_link, $icat_base_url,
7272
$visit_persist_storage_dir_segment, $dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
7373
$valid_components, $enabled_container_types, $synchweb_version, $redirects,
@@ -78,6 +78,7 @@ function setupApplication($mode): Slim
7878
$app->contentType('application/json');
7979
$options = $app->container['options'];
8080
$app->response()->body(json_encode(array(
81+
'mode' => $mode == 'production' ? 'production' : 'development',
8182
'motd' => $options->get('motd', $motd),
8283
'authentication_type' => $authentication_type,
8384
'cas_url' => $cas_url,

client/src/js/app/components/breadcrumbs.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ export default {
3737
<style scoped>
3838
3939
#breadcrumbs {
40-
/* background: #474747;
41-
color: #dbdbdb;
42-
font-size: 10px;
43-
list-style-type: none;
44-
padding: 5px 5px;
45-
clear: both */
4640
@apply tw-bg-header-bc-background;
4741
@apply tw-text-header-bc-color;
4842
@apply tw-p-1;
@@ -72,4 +66,4 @@ export default {
7266
#breadcrumbs li:before {
7367
content: '\00BB '
7468
}
75-
</style>
69+
</style>

client/src/js/app/components/header.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<template>
2+
<div>
3+
<div
4+
v-if="isDevMode"
5+
class="tw-flex tw-h-10 tw-items-center tw-bg-content-active"
6+
>
7+
<span class="fa fa-2x fa-exclamation-circle tw-mx-1"></span>
8+
This application is running in development mode. Data will not be persisted.
9+
</div>
210
<div
311
id="vue-header"
412
class="tw-flex tw-justify-between tw-items-center tw-h-10 tw-bg-header-background"
@@ -72,6 +80,7 @@
7280
</router-link>
7381
</div>
7482
</div>
83+
</div>
7584
</template>
7685

7786
<script>
@@ -109,7 +118,10 @@ export default {
109118
else return (this.$store.getters['user/hasPermission'](item.permission))
110119
}, this)
111120
return menus
112-
}
121+
},
122+
isDevMode() {
123+
return this.$store.state.mode === 'development'
124+
},
113125
},
114126
methods: {
115127
logout: function () {

client/src/js/app/store/store.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const store = new Vuex.Store({
4343

4444
isLoading: false,
4545
motd: '',
46+
mode: '',
4647
synchwebVersion: '',
4748
help: false, // Global help flag used to denote if we should display inline help on pages
4849
skipHomePage: config.skipHome || false,
@@ -66,6 +67,7 @@ const store = new Vuex.Store({
6667
state.appOptions = options.toJSON()
6768

6869
state.motd = options.get('motd') || state.motd
70+
state.mode = options.get('mode') || 'production'
6971

7072
state.synchwebVersion = options.get('synchweb_version') || state.synchwebVersion
7173

client/tailwind.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ module.exports = {
9494
'sidebar-mobile-active-background': 'rgb(115,115,115)',
9595
'sidebar-mobile-hover-background': 'rgb(105,105,105)',
9696
// Header
97-
'header-background': '#2c2c2c',
97+
'header-background': '#112e4d',
9898
'header-color': '#aaaaaa',
9999
'header-hover-color': '#ffffff',
100100
// Header Menu
101101
'header-menu-color': '#dddddd',
102102
'header-menu-hover': '#ffffff',
103103
// Header Breadcrumbs
104-
'header-bc-background': '#474747',
104+
'header-bc-background': '#112e4d',
105105
'header-bc-color': '#dbdbdb',
106106
'header-bc-hover': '#ffffff',
107107
// Footer

0 commit comments

Comments
 (0)