Skip to content
This repository has been archived by the owner on Feb 8, 2025. It is now read-only.

feat: add demo mode to instance #897

Merged
merged 7 commits into from
May 25, 2021
Merged

feat: add demo mode to instance #897

merged 7 commits into from
May 25, 2021

Conversation

djaiss
Copy link
Member

@djaiss djaiss commented May 24, 2021

This PR adds a demo mode to OfficeLife.

The demo mode is made for an instance that is supposed to showcase how OfficeLife behaves with real data.

To enable the demo mode, we need to edit a new .env variable called DEMO_MODE. By default, the demo mode is set to false.

Once the demo mode is enabled:

  • a new banner will be added to the header of the application, indicating that the instance runs on the demo mode,

image

  • some features are deactivated: importing users, adding new users, deleting the account and deleting employees. For those features, we display the following message:

image

  • we also add a new .env variable ENABLE_SIGNUPS that activates or deactivates the Signup form on the instance.
  • when we are in the demo mode, we also indicate the email and the password that we need to use in order to authenticate to the demo instance.

image

@djaiss djaiss requested a review from a team as a code owner May 24, 2021 02:41
@djaiss djaiss requested review from asbiin and removed request for a team May 24, 2021 02:41
@djaiss
Copy link
Member Author

djaiss commented May 24, 2021

@asbiin could you review?

@djaiss djaiss marked this pull request as draft May 24, 2021 02:45
@djaiss
Copy link
Member Author

djaiss commented May 24, 2021

@asbiin wait, don't review now. Still have changes to do.

@djaiss
Copy link
Member Author

djaiss commented May 24, 2021

@asbiin that should be good.

@djaiss djaiss marked this pull request as ready for review May 25, 2021 12:25
Copy link
Contributor

@asbiin asbiin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature!
You deactivated some actions for demo mode at View level. But you also have to check it in the Controller, or someone would be able to forge a request and run it!

Co-authored-by: Alexis Saettler <alexis@saettler.org>
@djaiss
Copy link
Member Author

djaiss commented May 25, 2021

You deactivated some actions for demo mode at View level. But you also have to check it in the Controller, or someone would be able to forge a request and run it!

You are right. I'll add those changes.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@djaiss djaiss merged commit 70b6fa2 into main May 25, 2021
@djaiss djaiss deleted the 2021-05-23-demo-mode branch May 25, 2021 22:24
@github-actions
Copy link
Contributor

🎉 This PR is included in version 0.1.0-alpha.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants