@jorsek/content-portal-configs
v4.0.6
Published
This repository contains all of the tenant configurations. There is a github action that triggers off merges into to the `main` branch.
Downloads
117
Maintainers
Keywords
Readme
Tenant Configuration repo.
This repository contains all of the tenant configurations. There is a github action that triggers off merges into to the main
branch.
That action will compile the configurations into a JSON Object string and push those configurations into Firebase Remote-Config.
Setup
Clone the repo by using this command or cloning it using github Desktop.
git clone [email protected]:Jorsek/content-portal-configs.git
install node.js and yarn on MacOS
brew install node
npm install yarn -g
install node.js and yarn on Windows
Download & install the LTS version of node.js https://nodejs.org/en/download/
.
Then, open a command window and type:
npm install yarn -g
install project dependencies and run the project
cd $PROJECTPATH
yarn
Tenant config
The configuration for each tenant are located in the $PROJECTPATH/src/tenants
directory where folders named by tenant id such as "jorsek"
+-- package.json
+-- src
| +-- tenants
| +-- org-name
| +-- i18n <- translations
| +-- index.ts <- exports supported language customized strings
| +-- en-US.json <- a supported language custom string overrides.
| +-- index.ts <- the exported configuration
| +-- theme.ts <- the exported jss/material ui theme overrides.
| +-- jorsek
| +-- org-name1
| +-- org-name2
| +-- default.ts <- default configuration that the custom configurations all extend from.
| +-- index.ts <- exports and merges the configurations.
I18n translated strings
+-- i18n
| +-- index.ts <- exports the i18n translated strings for languages we support
| +-- en-US.json <- a supported language file that contains all the static application strings
| +-- pl-PL.json <- a supported language file that contains all the static application strings
Exporting a config
Run the following command to export a config
./src/ezd-config.ts {path-to-config} > {output-file}
Example:
./src/ezd-config.ts tenants/viewpoint/index.ts > viewpoint-8-4-21.json
Adding a new Tenant
You will need:
- A deployment ID. This can be obtained from the deployments page in the CMS.
- API key. This can be obtained from the Content API page in the CMS. Create a Simple API Key.
- Name of the tenant.
To add a tenant, a folder for the tenant is created within this repository, and that change is committed to the main branch in Github through a pull request. A few minutes after the change is merged, the tenant should be available. If the tenant is not available, it is possible the build had an error. Look at [Github Actions] (https://github.com/Jorsek/content-portal-config/actions) to determine the issue.
Steps to add a tenant:
- In this repository, copy the tenant_template/customer_name folder into the tenants/ folder.
- Rename the customer_name folder you just copied to the name of the tenant.
- Note: This is typically the org id, but can be anything. The value should be all lower case,
and may contain underscores. This value will determine the portal's URL.
For example, if the tenant's name is
my_example_tenant
, the portal's URL will bemy_example_tenant.portal.heretto.com
.
- Note: This is typically the org id, but can be anything. The value should be all lower case,
and may contain underscores. This value will determine the portal's URL.
For example, if the tenant's name is
- In the index.ts and i18n/en-us.json files, replace everything in square brackets:
- In index.ts:
- title: The title of site, typically something like {tenant-name} Help Site`.
- env.EZD_ORG: The org id used by the deploy API. Typically the same org ID from the CMS.
- env.EZD_HOSTNAME: The domain of the deploy API. For example,
content-dev2.easydita.com
- env.EZD_TOKEN: The deploy API API key. This is the token obtained from the Content API page in the CMS.
- env.EZD_DEPLOYMENT_ID: The deployment ID obtained from the Deployment page in the CMS.
- In i18n/en-us.json:
- label.tenant: Typically a label for the tenant. For example,
Heretto
.
- label.tenant: Typically a label for the tenant. For example,
- In index.ts:
- Commit changes and submit a PR.