Git Product home page Git Product logo

silverstripe-environmentindicator's Introduction

Scrutinizer Code Quality

Environment Indicator

The Environment Indicator Vendor Module reads the SS_ENVIRONMENT_TYPE variable in your .env file (dev, test or live) and loads the applicable javascript to insert a custom div above the menu header in the CMS Admin interface.

The EnvBarExtension also inserts a custom element into the HTML of all pages to provide an information bar detailing the environment and page version. If the logged-in user has access to pages in the CMS, the bar acts as a link to open the page in the CMS via a new browser tab.

The bar does not appear in live mode for unauthorised users.

Requirements

Installation

Composer:

    composer require signify-nz/silverstripe-environmentindicator

Documentation

No further configuration is required.

Customisation can be achieved by editing the EnvBar.ss template or the envbar- .js and .css files. Functional tests are available in the tests directory. These will need to be updated if you modify the template.

Usage

This module performs an informative function only. No special usage instructions are available.

Live Published Anonymous Live Published Editor Live Draft Editor Live CMS Page Live CMS Tree

Test Published Anonymous Test Published Editor Test Draft Editor Test CMS Page Test CMS Tree

Dev Published Anonymous Dev Published Editor Dev Draft Editor Dev CMS Page Dev CMS Tree

silverstripe-environmentindicator's People

Contributors

guysartorelli avatar lanifield avatar sig-lani avatar sig-owalker avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silverstripe-environmentindicator's Issues

Alternative embedding methods

Embedding the EnvBar as the first element in the body tag doesn't always work well for all sites.

What do you think of providing the EnvBar via a template variable, e.g. $EnvBar and providing a config option to disable the automatic embedding.

Environment ambiguity

Hey, I just noticed this module pop up and overlap with this SS3 module, and just wanted to share a thought on the meaning of environments in SilverStripe. From the docs of that module:

Note: SilverStripe has a concept of 'environment type' (SS_ENVIRONMENT_TYPE) which can be set to 'live', 'test' or 'dev'. This is more like a 'mode' than a type though, because there is nothing to stop you temporarily setting your production environment type to 'dev' to get some debugging information, or your development environment to 'live' to simulate production configuration locally. So you can't really rely on the environment type to know which server environment you're interacting with. SS_ENVIRONMENT_LABEL is intended to be a genuine constant, so you can have clarity about which environment you are working on.

In that other module I decided to introduce a SS_ENVIRONMENT_LABEL to account for that and also make the naming and number of environments more flexible.

Anyways feel free to delete this, just wanted to point that out :) Nice to see an SS4 solution for this problem in the wild.

Add "Disable" override setting

The admin user needs to be able to disable the bar from a setting in the cms in case there is an issue in production.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.