set up the bones for the whitelabel, just need to generate the icons from a logo once we get it
This commit is contained in:
parent
3d1c11646f
commit
89a83d04dd
4 changed files with 40 additions and 7 deletions
1
.env
1
.env
|
|
@ -14,6 +14,7 @@ VITE_AUTH0_ADAPTIVE_CONSTRUCTION_CLIENT_ID=32rABabJzXRvJiWivTmeKFgwFiqh4ok7
|
|||
VITE_AUTH0_AEROGROW_CLIENT_ID=KHl9ooUt1nia1RYw5n224dyggCXdbsSd
|
||||
VITE_AUTH0_MIVENT_CLIENT_ID=VNALE7RW6l3dY5uYcxgwElZV0lcT25Fg
|
||||
VITE_AUTH0_OMNIAIR_CLIENT_ID=IblmarD8wFafiD6doxTmOHQ6Bx3L9wWl
|
||||
VITE_AUTH0_INTELLIFARMS_CLIENT_ID=RYtuAyOcB4DSaaqJMLDMf3pV8SFY9PdY
|
||||
|
||||
#Branding (Default theme)
|
||||
VITE_APP_WEBSITE_TITLE="Adaptive Dashboard"
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -18,7 +18,10 @@ Steps to add a new white label
|
|||
- add a `CNAME` record pointing their custom subdomain (ex: dashboard.example.com) to brandxtech.ca
|
||||
- add a login button on their website point to `/login` of their custom subdomain (ex: dashboard.example.com/login)
|
||||
|
||||
It is recommended to start with the Auth0 stage once everything from the client has been recieved as things like the client ID will be needed in other stages
|
||||
|
||||
<!-- frontend steps -->
|
||||
Frontend Steps
|
||||
1. Create a PWA folder in `public` that is named after the client and generate PWA assets using [this](https://realfavicongenerator.net/) website (use the company logo but you might need to use a custom favicon depending on the result)
|
||||
|
||||
- https://maskable.app/ also create a maskable icon for PWA
|
||||
|
|
@ -29,22 +32,23 @@ Steps to add a new white label
|
|||
4. If there are any pages specific to the whitelabel be sure to update the side and bottom navigator
|
||||
|
||||
<!-- backend steps -->
|
||||
Backend Steps
|
||||
1. In `dynamic-config.prod.yml`, add a router entry for the new whitelabel
|
||||
2. In `pond/http/server.go`, add the sub-domain to the `allowedOrigins`
|
||||
3. In `pond/whitelabel.go`, add an entry for the new white label
|
||||
4. Enable the white-label sub-domain for CORS in the backend by adding it to the allowed origins http/server.go
|
||||
|
||||
<!-- Auth steps -->
|
||||
1. Create a new `Auth0` application for the client
|
||||
Auth0 Steps
|
||||
1. Create a new Single Page App on Auth0 using React as the tech
|
||||
2. Once you have the client ID add it to your .env file in the frontend
|
||||
3. Adjust settings accordingly in the new application
|
||||
- use a image bucket like [postimg](https://postimages.org/) to store their company logo and favicon
|
||||
- add a whitelabel logo
|
||||
- allow necessary `origins`, `callback URLs`, and `CORS domains` to the application settings (see the default application as a guideline)
|
||||
- allow necessary `origins`, `callback URLs`, and `CORS domains` to the application settings (see other applications/whitelabels as a guideline)
|
||||
- customize the Universal Login page to handle the new whitelabel
|
||||
- check if the client ID matches this client's Auth0 application
|
||||
- change the Universal Login theme using white-label colours and images stored in a bucket (ex: [postimg](https://postimages.org/))
|
||||
|
||||
- in [http.go](https://gitlab.com/brandx/backend/blob/master/pond/http.go), add the white-label sub-domain to the `AllowedOrigins` list
|
||||
|
||||
## Expanding the ESLint configuration
|
||||
|
||||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import {
|
|||
IsAdaptiveAgriculture,
|
||||
// hasTutorialPlaylist,
|
||||
IsAdCon,
|
||||
IsIntellifarms,
|
||||
IsMiPCA,
|
||||
// isBXT,
|
||||
IsMiVent,
|
||||
|
|
@ -165,7 +166,7 @@ export default function SideNavigator(props: Props) {
|
|||
|
||||
const authenticatedSideMenu = () => {
|
||||
const isMiVent = IsMiVent();
|
||||
const isAg = IsAdaptiveAgriculture()
|
||||
const isAg = IsAdaptiveAgriculture() || IsIntellifarms()
|
||||
const isStreamline = IsStreamline()
|
||||
const isOmni = IsOmniAir()
|
||||
const isMiPCA = IsMiPCA()
|
||||
|
|
|
|||
|
|
@ -180,6 +180,32 @@ export function IsAdaptiveAgriculture(): boolean {
|
|||
);
|
||||
}
|
||||
|
||||
const INTELLIFARMS_WHITE_LABEL: WhiteLabel = {
|
||||
name: "Intellifarms",
|
||||
primaryColour: "",
|
||||
secondaryColour: "",
|
||||
signatureColour: "",
|
||||
signatureAccentColour: "",
|
||||
auth0ClientId: import.meta.env.VITE_AUTH0_INTELLIFARMS_CLIENT_ID,
|
||||
redirectOnLogout: true,
|
||||
logoutRedirectTarget: "https://myintellifarms.com",
|
||||
darkLogo: "",
|
||||
lightLogo: "",
|
||||
transparentLogoBG: true,
|
||||
blacklist: [],
|
||||
docs: "Platform",
|
||||
protips: protips,
|
||||
homePage: "/bins"
|
||||
};
|
||||
|
||||
export function IsIntellifarms(): boolean {
|
||||
return (
|
||||
getName() === "Intellifarms"
|
||||
// window.location.origin.includes("staging") ||
|
||||
// window.location.origin.includes("localhost")
|
||||
);
|
||||
}
|
||||
|
||||
export function IsStreamline(): boolean {
|
||||
return (
|
||||
getName() === "Streamline"
|
||||
|
|
@ -324,7 +350,8 @@ const whitelabels = new Map<string, WhiteLabel>([
|
|||
["adaptiveconstruction", ADAPTIVE_CONSTRUCTION_WHITE_LABEL],
|
||||
["omniair", OMNIAIR_WHITE_LABEL],
|
||||
["mipca", MIPCA_WHITE_LABEL],
|
||||
["mionetech", MIPCA_WHITE_LABEL]
|
||||
["mionetech", MIPCA_WHITE_LABEL],
|
||||
["intellifarms", INTELLIFARMS_WHITE_LABEL]
|
||||
]);
|
||||
|
||||
export function getWhitelabel(): WhiteLabel {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue