Overhaul docs (#3951)

* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

Co-authored-by: Ben Haynes <ben@rngr.org>
This commit is contained in:
Rijk van Zanten
2021-02-05 18:51:54 -05:00
committed by GitHub
parent 4fe04539bb
commit 817ccf3620
148 changed files with 10078 additions and 3049 deletions

View File

@@ -107,7 +107,6 @@ router.post(
if (req.is('multipart/form-data')) {
keys = res.locals.savedFiles;
} else {
// @TODO is this ever used in real life? Wouldn't you always upload a file on create?
keys = await service.create(req.body);
}

View File

@@ -59,21 +59,26 @@ router.get(
router.get(
'/me',
asyncHandler(async (req, res, next) => {
if (!req.accountability?.user) {
throw new InvalidCredentialsException();
}
const service = new PermissionsService({ schema: req.schema });
const query = clone(req.sanitizedQuery || {});
query.filter = {
...(query.filter || {}),
role: {
_eq: req.accountability.role,
},
};
if (req.accountability?.role) {
query.filter = {
...(query.filter || {}),
role: {
_eq: req.accountability.role,
},
};
} else {
query.filter = {
...(query.filter || {}),
role: {
_null: true,
},
};
}
const items = await service.readByQuery(req.sanitizedQuery);
const items = await service.readByQuery(query);
res.locals.payload = { data: items || null };
return next();

View File

@@ -64,7 +64,7 @@ export class GraphQLService {
args = {
sort: {
type: GraphQLString,
type: new GraphQLList(GraphQLString),
},
limit: {
type: GraphQLInt,

View File

@@ -72,19 +72,6 @@ export class PayloadService {
return value;
},
async 'file-links'({ action, value, payload }) {
if (action === 'read' && payload && payload.storage && payload.filename_disk) {
const publicKey = `STORAGE_${payload.storage.toUpperCase()}_PUBLIC_URL`;
return {
asset_url: new URL(`/assets/${payload.id}`, env.PUBLIC_URL),
public_url: new URL(payload.filename_disk, env[publicKey]),
};
}
// This is an non-existing column, so there isn't any data to save
return undefined;
},
async boolean({ action, value }) {
if (action === 'read') {
return value === true || value === 1 || value === '1';