Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
5a9815e
feat: updated library versions
flauc Jun 17, 2021
4bc7261
feat(web): connecting blog :construction:
flauc Jun 17, 2021
8f4136d
feat: extended common block
flauc Jun 18, 2021
aa2bd31
Merge branch 'flavor/mw' into flavor/mw-blog
Jun 18, 2021
5b1f1ad
feat: added automatic emails and sent emails
Jun 18, 2021
62f1ca5
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
flauc Jun 27, 2021
61fcd8f
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
flauc Jul 4, 2021
c60cdcc
feat: connected automatic emails and forms in page builder blocks
flauc Jul 4, 2021
faae6b8
chore(cms): starting on different port from website
flauc Jul 17, 2021
0cebaeb
feat: connected web workflow and build command
flauc Jul 17, 2021
5389d29
feat: added production checklist
flauc Jul 17, 2021
ad358b2
feat: added build:web to build script
Jul 20, 2021
ac598aa
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
Jul 20, 2021
da976ad
Merge branch 'flavor/mw' into flavor/mw-blog
Jul 20, 2021
626ad92
chore: removed need for DATABASE_URL secret
flauc Jul 20, 2021
51d52aa
fix: adjusted path for web build
flauc Jul 20, 2021
692b310
Merge branch 'flavor/mw' into flavor/mw-blog
flauc Jul 20, 2021
4b2aa43
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
flauc Jul 24, 2021
ff18608
ci: fixed indent on web
flauc Jul 24, 2021
177e591
ci: fixed indent on web
flauc Jul 24, 2021
17f3f37
chore: added empty meta tags
flauc Jul 24, 2021
8742776
ci: web build fix
flauc Jul 24, 2021
a979fb4
chore: build adjustments
flauc Jul 24, 2021
670e34f
fix(web): added missing live environment
Aug 2, 2021
ad20b25
fix(web): importing firebase from wrong project
Aug 2, 2021
87b38c4
feat: adaptations for decorator blocks
flauc Aug 3, 2021
efec47a
feat(web): connected app init for preloading page that is currently b…
flauc Aug 18, 2021
b21e8ba
fix(cms): missing common option defaults and translations
Aug 27, 2021
4c5ecd6
fix: update query params if changed in block-link
Aug 30, 2021
4d20f3b
feat: added ctrl support for block-link
Sep 10, 2021
45774c3
feat: simplified build.js
flauc Sep 20, 2021
832993e
feat: connected dynamic updating of static pages
Sep 20, 2021
4d58cec
fix: build.js issues
Sep 20, 2021
118f2b7
fix(functions): missing types for node-fetch
Sep 20, 2021
a22dea0
fix: build.js issues
Sep 20, 2021
ce804f9
fix(functions): node-fetch version downgrade from 3.0 it isn't working
Sep 20, 2021
a2ccb39
feat: added 404 to build
Sep 20, 2021
1ead73e
fix: ci dynamic-pages commit directory
Sep 20, 2021
46ae64a
fix(cms): proper path for form submissions
Sep 22, 2021
4922d8c
feat(web): connected transloco
Sep 22, 2021
1e4b845
Merge branch 'flavor/mw' into flavor/mw-blog
Sep 22, 2021
4c288e4
feat(web): added default rules for forms
Sep 22, 2021
3fc541b
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
flauc Sep 28, 2021
c6eb275
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
flauc Sep 28, 2021
895e036
fix(web): missing tel and number types in form
flauc Oct 10, 2021
30a8bf5
feat: working on sample emails :construction:
Oct 19, 2021
817aa0c
feat(cms): connected sample email sending :tada:
Oct 20, 2021
9891ab6
feat: automatic emails allowing for multiple recipients; processing c…
iGrubesic Oct 31, 2021
3f2f015
feat: don't attempt email sends without a token
flauc Nov 1, 2021
a8b63f2
Merge branch 'master' into flavor/mw
Nov 3, 2021
17d3a64
feat(client): connected form-ui-renderer
Nov 3, 2021
519d536
feat(web): connected loading
Nov 4, 2021
864f02e
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
Nov 8, 2021
6f27072
chore: added segment translation
makiJS Nov 11, 2021
0974881
feat: connected git pods
flauc Nov 20, 2021
54bb792
Merge remote-tracking branch 'origin/flavor/mw' into flavor/mw-blog
Jan 10, 2022
e3ad907
feat: updates from flavor/mw
Jan 10, 2022
8198839
chore: minor fixes for flavor/mw-blog
Jan 10, 2022
c2be2b9
fix(functions): typo
Jan 10, 2022
69d33dc
Merge branch 'main' into flavor/blog
flauc Jan 23, 2022
9ded3ed
feat: merged changes from main
flauc Jan 23, 2022
2e12a90
Merge branch 'main' into flavor/blog
flauc Jan 26, 2022
df8f223
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Feb 4, 2022
1af5775
fix(cms): missing additionalStyle property on common block
flauc Feb 4, 2022
db42e07
fix(web): migrating to new firestore
Feb 4, 2022
6051632
feat(web): connected new firebase v9
flauc Feb 4, 2022
41facb4
Merge branch 'main' into flavor/blog
flauc Feb 4, 2022
f6e783c
feat(web): rendering blocks in new page builder renderer
flauc Feb 4, 2022
845ca4b
feat(web): added layout by default
flauc Feb 5, 2022
5f55f26
fix: block-link applying query params when they are undefined
flauc Feb 5, 2022
b26edb9
Merge branch 'main' into flavor/blog
flauc Feb 5, 2022
8771c43
chore(setup): missing module imports on a few places
flauc Feb 5, 2022
8d4e2b0
Merge branch 'main' into flavor/blog
flauc Feb 6, 2022
16939cf
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Feb 6, 2022
f121d9b
Merge branch 'main' into flavor/blog
flauc Feb 6, 2022
449c28b
Merge branch 'main' into flavor/blog
flauc Feb 6, 2022
8666aca
feat: connected duplicate on pages
flauc Feb 6, 2022
21cd381
Merge branch 'main' into flavor/blog
flauc Feb 6, 2022
15f44d9
feat: connected links to site and active on pages
flauc Feb 6, 2022
97b4242
Merge branch 'main' into flavor/blog
flauc Feb 6, 2022
5ce8398
feat: updated web workflow for main branch
flauc Feb 6, 2022
966a03a
Merge branch 'main' into flavor/blog
Feb 8, 2022
6b0b1d7
Merge branch 'main' into flavor/blog
Feb 8, 2022
d0d09e0
Merge branch 'main' into flavor/blog
Feb 8, 2022
f9c82bd
feat(web): persisting global loader for initial page load
flauc Feb 10, 2022
8fd2496
Merge branch 'main' into flavor/blog
flauc Feb 10, 2022
e9ccba7
Merge branch 'main' into flavor/blog
flauc Feb 10, 2022
6de058a
Merge branch 'main' into flavor/blog
flauc Feb 13, 2022
d024c02
chore(web): removed not-found since it can be created through page bu…
flauc Feb 13, 2022
85236e2
chore: version updates and code cleanup
flauc Feb 13, 2022
2d06b47
Merge branch 'main' into flavor/blog
flauc Feb 13, 2022
2115560
fix: added missing hr translations
flauc Feb 13, 2022
5046c84
Merge branch 'main' into flavor/blog
flauc Feb 16, 2022
e761130
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Feb 22, 2022
e03139a
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Feb 22, 2022
7a58543
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Feb 22, 2022
7379999
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Feb 24, 2022
9b31a81
chore: merge conflicts
flauc Feb 24, 2022
67f5162
Merge branch 'main' into flavor/blog
AntonioStipic Feb 24, 2022
2aaccd2
chore(cms): merge main into current
AntonioStipic Feb 24, 2022
ab70ff4
fix(cms): preserveSymlinks for cms project in angular.json
AntonioStipic Feb 24, 2022
3ea7917
Merge branch 'main' into flavor/blog
flauc Feb 27, 2022
ec03b1c
fix: indent in dynamic-pages workflow
flauc Feb 28, 2022
882f2e3
fix: proper indent in dynamic-pages workflow
flauc Feb 28, 2022
791bf0a
chore(web): restore scroll position
flauc Mar 2, 2022
47abf95
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Mar 7, 2022
5bdfb8c
fix: missing 404 in build.js
flauc Mar 9, 2022
028b063
feat(definitions): added upload method for meta
flauc Mar 11, 2022
26d5da9
Merge branch 'main' into flavor/blog
flauc Apr 4, 2022
9fba769
fix(cms): FormSubmissionGuard properly calling next
flauc Apr 4, 2022
5aa76a9
chore(cms): removed unused imports in FormSubmissionGuard
flauc Apr 4, 2022
744242c
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc May 15, 2022
c75f0a1
chore: fixed inconsistency in build.js
flauc May 21, 2022
29020ac
Merge remote-tracking branch 'origin/main' into flavor/blog
flauc Aug 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"hosting": {
"cms": [
"jaspero-jms"
],
"web": [
"jaspero-jms-web"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cms.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- 'definitions/**/*'
- 'client/projects/cms/**/*'
- 'client/projects/shared/**/*'
- '.github/workflows/cms.workflow.yml'
jobs:
deploy:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/dynamic-pages.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Dynamic Pages
on:
workflow_dispatch:
inputs:
collection:
description: 'Collection to fetch'
required: true
doc:
description: 'ID of the document to fetch'
required: true
operation:
description: 'Type of operation to perform'
default: 'create'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Install Dependencies
run: |
cd build
npm ci
- name: Build
run: |
cd build
echo $SERVICE_ACCOUNT > account.json
node build.js ${{ github.event.inputs.collection }} ${{ github.event.inputs.doc }}
env:
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }}
- name: Deploy
run: |
npm install firebase-tools
npm run firebase -- use $FIREBASE_PROJECT --token $FIREBASE_TOKEN
npm run firebase -- deploy --only hosting:web -m "${{ github.run_id }}" --token $FIREBASE_TOKEN
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: 'jaspero-jms'
- name: Commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -f --all public/
git commit -m "BOT - Updated build branch for ${{ github.event.inputs.collection }} and ${{ github.event.inputs.doc }}, operation ${{ github.event.inputs.operation }}"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'build'
force: true
78 changes: 78 additions & 0 deletions .github/workflows/web.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Deploy Web
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'client/projects/web/**/*'
- 'client/projects/shared/**/*'
- '.github/workflows/web.workflow.yml'
jobs:
deploy:
env:
project: 'jaspero-jms'
# Release Branch
# Only when the workflow is being run on this branch
# will it create the build branch
release: 'main'
# Build Branch
# This is the branch that is created on deployment
build: 'build'
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token
fetch-depth: 0 # otherwise, it fails to push refs to dest repo
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install Dependencies
run: |
npm --prefix client ci
- name: Build
run: npm run build:web
- name: Build.js
if: contains(github.ref, env.release)
run: |
cd build
echo $SERVICE_ACCOUNT > account.json
npm ci
node build.js
cd ..
env:
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }}
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting:web
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: ${{ env.project }}
- name: Commit
if: contains(github.ref, env.release)
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -f --all public/
git commit -m "BOT - Connected build branch"
- name: Update current app version
if: contains(github.ref, env.release)
run: |
cd build
echo $SERVICE_ACCOUNT > account.json
node update-current-version.js
env:
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }}
- name: Push
if: contains(github.ref, env.release)
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.build }}
force: true

6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -895,17 +895,15 @@

## [4.4.3](https://github.com/jaspero/jms/compare/v4.4.2...v4.4.3) (2021-07-24)


### Bug Fixes

* **client:** missing translation on name instance overview ([cea707d](https://github.com/jaspero/jms/commit/cea707d6adf6b4bd041a2dad7d124635ea60f41f))
- **client:** missing translation on name instance overview ([cea707d](https://github.com/jaspero/jms/commit/cea707d6adf6b4bd041a2dad7d124635ea60f41f))

## [4.4.2](https://github.com/jaspero/jms/compare/v4.4.1...v4.4.2) (2021-07-20)


### Bug Fixes

* translation missmatch for user-invites ([17c4254](https://github.com/jaspero/jms/commit/17c4254003aee3452adca8a2dea93c47a23fc8df))
- translation missmatch for user-invites ([17c4254](https://github.com/jaspero/jms/commit/17c4254003aee3452adca8a2dea93c47a23fc8df))

## [4.4.1](https://github.com/jaspero/jms/compare/v4.4.0...v4.4.1) (2021-07-20)

Expand Down
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
![Release](https://github.com/Jaspero/jms/workflows/Release/badge.svg)
![Deploy CMS](https://github.com/Jaspero/jms/workflows/Deploy%20CMS/badge.svg)
![Deploy Functions](https://github.com/Jaspero/jms/workflows/Deploy%20Functions/badge.svg)
![Deploy Firestore Indexes](https://github.com/Jaspero/jms/workflows/Deploy%20Firestore%20Indexes/badge.svg)
![Deploy Storage Rules](https://github.com/Jaspero/jms/workflows/Deploy%20Storage%20Rules/badge.svg)
![Deploy Rules](https://github.com/Jaspero/jms/workflows/Deploy%20Rules/badge.svg)
![Lighthouse CI](https://github.com/Jaspero/jms/workflows/Lighthouse%20CI/badge.svg)
# JMS flavor/blog

# JMS
This flavor of JMS comes with everything preconfigured for a simple blog.
It consists of two angular projects CMS and Web.

JMS is a CMS based on Angular that is fully configurable through JSON schema-s. JMS is very
opinionated especially when it comes to things like templating engines and email services, even though this should be easily interchangeable.
## Checklist

Currently it only supports [firestore](https://firebase.google.com/docs/firestore) as its
back-end but other implementations are planed and instructions for writing your own integration can
be found in the [wiki](https://github.com/Jaspero/jms/wiki/Custom-Integrations).
Before going live make sure you've marked all of the following:

A live example can be found [here](https://jaspero-jms.web.app/).

For more information consult our [wiki](https://github.com/Jaspero/jms/wiki).

**Note:** JMS is in active development and shouldn't be used in a production environment. Progress
towards our production ready goal can be tracked [here](https://github.com/Jaspero/jms/projects/1).
- [ ] `storage.rules` have rules configured for all of the modules
- [ ] You adjusted the constants in `build/build.js` to fit your projects requirements and added any static or dynamic pages to the `PAGES` array.
- [ ] `client/projects/cms/src/environment/static-config.ts` has been adjusted to your projects requirements.
- [ ] You added `FIREBASE_TOKEN` and `SERVICE_ACCOUNT` to your secrets in github.
- [ ] You adjusted `client/projects/web/scr/app/consts/base-title.const.ts` to your projects title.
- [ ] You changed "jaspero-jms" in `.github/workflows/web.workflow.yml` and `.github/workflows/cms.workflow.yml` to your project id
- [ ] You updated `.firebaserc` with your projects data
- [ ] You changed the meta tags in `client/projects/web/src/index.html`
2 changes: 2 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
account.json
113 changes: 113 additions & 0 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
const {join} = require('path');
const {readFileSync} = require('fs');
const admin = require('firebase-admin');
const renderDocument = require('./src/render-document');
const renderMeta = require('./src/render-meta');
const siteMap = require('./src/site-map');
const URL = 'https://jaspero-jms.web.app/';
const BASE_PATH = join(__dirname, '..', 'public/web');
const BASE_TITLE = 'JMS';
const DELIMITER = '-';
const BASE_URL = 'https://firebasestorage.googleapis.com/v0/b/jaspero-jms.appspot.com/o/';
const PAGES = [
{
url: '',
collection: 'pages',
id: doc => doc.id,
title: item => item.meta?.title || item.title,
meta: item => ({
description: item.meta?.description || ''
}),
metaProperties: async item => {

if (!item.meta) {
return {};
}

const thumb = item.meta.image ? `${BASE_URL}generated%2Fthumb_m_${item.meta.image.split(BASE_URL)[1]}` : `${URL}/assets/img/logo.png`;
const description = item.meta.description;
return {
['og:type']: 'article',
['og:url']: `${URL}/${item.id}`,
['og:title']: item.meta.title,
['og:description']: description,
['og:image']: thumb,
['twitter:card']: 'summary_large_image',
['twitter:url']: `${URL}/${item.id}`,
['twitter:title']: item.meta.title,
['twitter:description']: description,
['twitter:image']: thumb
}
}
},
{
url: '404',
title: '404',
meta: {
description: '',
keywords: ''
},
metaProperties: {
['og:title']: '',
['og:description']: '',
['twitter:title']: '',
['twitter:description']: '',
}
}
];

async function createPages(collection, id) {

const index = readFileSync(join(BASE_PATH, 'index.html')).toString();
admin.initializeApp({
credential: admin.credential.cert(require('./account.json'))
});

const fStore = admin.firestore();

if (collection && id) {
const pg = PAGES.find(p => p.collection === collection);
const doc = await fStore.collection(pg.collection).doc(id).get();
await renderDocument(DELIMITER, BASE_TITLE, BASE_PATH, index, pg, doc);
return;
}

const sitemapPages = [];

await Promise.all(
PAGES.map(async pg => {
if (pg.collection) {
const docs = await (pg.criteria ? pg.criteria(fStore.collection(pg.collection)) : fStore.collection(pg.collection)).get();

await Promise.all(
docs.docs.map(async doc => {
sitemapPages.push({
url: `${URL}${pg.url.replace(/^\//, '')}/${pg.id(doc)}`
});
await renderDocument(DELIMITER, BASE_TITLE, BASE_PATH, index, pg, doc);
})
)
} else {
sitemapPages.push({
url: `${URL}${pg.url.replace(/^\//, '')}`
});
await renderMeta(
DELIMITER,
BASE_TITLE,
index,
pg,
join(BASE_PATH, pg.url + '.html')
)
}
})
);

await siteMap(BASE_PATH, sitemapPages);
}

createPages(process.argv[3] || '', process.argv[4] || '')
.then(() => process.exit())
.catch(e => {
console.error(e);
process.exit(1)
});
Loading