This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add auth-server cms-server graphql-server server-common
- Loading branch information
Showing
46 changed files
with
676 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/** @jsx builder */ | ||
|
||
import builder, {Default, Condition, Block, Row, Col} from 'canner-script'; | ||
import moment from 'moment-timezone'; | ||
|
||
const ceDesc = `All events that had been collected so far.`; | ||
|
||
export function renderDate(date, record, cannerProps) { | ||
if (!date) { | ||
return '-'; | ||
} else { | ||
let value = moment.tz(date, "Asia/Nicosia").format("YYYY/MM/DD HH:mm"); | ||
return value; | ||
} | ||
} | ||
|
||
export default () => ( | ||
<array keyName="events" title="Events" ui="table" description={ceDesc} | ||
uiParams={{ | ||
size: "small", | ||
columns: [{ | ||
title: 'Translated', | ||
dataIndex: 'translated' | ||
}, { | ||
title: 'Ready', | ||
dataIndex: 'ready' | ||
}, { | ||
title: 'Title', | ||
dataIndex: 'title' | ||
}, { | ||
title: 'Date Start', | ||
dataIndex: 'dateStart', | ||
render: renderDate | ||
}, { | ||
title: 'Date End', | ||
dataIndex: 'dateEnd', | ||
render: renderDate | ||
}, { | ||
title: 'City', | ||
dataIndex: 'city' | ||
}, { | ||
title: 'Tags', | ||
dataIndex: 'tags' | ||
}] | ||
}} | ||
> | ||
<toolbar> | ||
<pagination/> | ||
<actions> | ||
<filter /> | ||
<export /> | ||
</actions> | ||
<filter> | ||
<textFilter field="city" label="City" placeholder="Nicosia"/> | ||
<textFilter field="title" label="Title"/> | ||
<dateFilter field="dateStart" label="Date start"/> | ||
<selectFilter field="translated" label="Translated" defaultOptionIndex={0} alwaysDisplay options={[ | ||
{ text: "Not translated", condition: { translated: { eq: false } } }, | ||
{ text: "Translated", condition: { translated: { eq: true } } }, | ||
{ text: "All", condition: {} } | ||
]}/> | ||
<selectFilter field="ready" label="Ready" options={[ | ||
{ text: "Not ready", condition: { ready: { eq: false } }}, | ||
{ text: "Ready", condition: { ready: { eq: true } }}, | ||
{ text: "All", condition: {}}, | ||
]}/> | ||
<selectFilter field="old" label="Old" defaultOptionIndex={0} options={[ | ||
{ text: "Only new", condition: { old: { eq: false }} }, | ||
{ text: "Old", condition: { old: { eq: true } }}, | ||
{ text: "All", condition: {}}, | ||
]}/> | ||
</filter> | ||
<sorter defaultField="dateStart" options={[{label: 'Date Start', field: 'dateStart', defaultOrder: 'ASC'}]}/> | ||
</toolbar> | ||
<Row> | ||
<Col span={12}> | ||
<Block title="Original event"> | ||
<Row> | ||
<Col span={12}> | ||
<dateTime keyName="dateStart" ui="dateTime" uiParams={{format:"YYYY/MM/DD HH:mm", render:renderDate}} title="Date start"/> | ||
<dateTime keyName="dateEnd" ui="dateTime" uiParams={{format:"YYYY/MM/DD HH:mm", render:renderDate}} title="Date end"/> | ||
<string keyName="url" ui="link" title="URL" disabled={true}/> | ||
<string keyName="parentUrl" ui="link" title="Parent URL" disabled={true}/> | ||
</Col> | ||
<Col span={11} offset={1}> | ||
<image keyName="thumbnail" ui="image" title="Thumbnail" disabled={true}/> | ||
</Col> | ||
</Row> | ||
</Block> | ||
</Col> | ||
<Col span={11} offset={1}> | ||
<Block title="Common classification"> | ||
<array keyName="tags" ui="tag" title="Tags" uiParams={{ | ||
defaultOptions: [ | ||
'theater', 'movie', 'party', | ||
'festival', 'kids', 'concert', | ||
'play', 'masterclass', 'music', | ||
'tasting', 'exhibition', 'sport' | ||
]}}/> | ||
<string keyName="city" ui="select" title="City" uiParams={{options: [{text:"Nicosia", value: "Nicosia"}, {text:"Larnaca", value: "Larnaca"}, {text:"Paphos", value: "Paphos"}, {text:"Limassol", value: "Limassol"},]}}/> | ||
<string keyName="language" ui="input" title="Event language"/> | ||
</Block> | ||
</Col> | ||
</Row> | ||
<Row type="flex" style={{alignItems: 'center'}}> | ||
<Col span={12}> | ||
<string keyName="title" ui="input" title="Title" disabled={true}/> | ||
<Row> | ||
<Col span={8}><string keyName="location" ui="input" title="Location" disabled={true}/></Col> | ||
<Col span={15} offset={1}><string keyName="address" ui="input" title="Address" disabled={true}/></Col> | ||
</Row> | ||
<string keyName="description" ui="textarea" title="Description" disabled={true}/> | ||
</Col> | ||
<Col span={12}> | ||
<array keyName="translation" title="Translations" ui="tabTop" uiParams={{titleKey: "language", position: "right"}}> | ||
<string keyName="language" title="Language" ui="select" uiParams={{options: [{text: 'Russian', value: 'ru'}, {text: "English", value: 'en'}, {text: "Greek", value: 'el'}]}}/> | ||
<string keyName="title" title="Title" ui="input"/> | ||
<Row> | ||
<Col span={8}><string keyName="location" ui="input" title="Location"/></Col> | ||
<Col span={15} offset={1}><string keyName="address" ui="input" title="Address"/></Col> | ||
</Row> | ||
<string keyName="description" ui="textarea" title="Description"/> | ||
<string keyName="contact" ui="input" title="Contact and details"/> | ||
</array> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Block title="Event control"> | ||
<Row> | ||
<Col span={5}><boolean keyName="translated" ui="switch" title="Mark as translated"/></Col> | ||
<Col span={5}><boolean keyName="ready" ui="switch" title="Ready"/></Col> | ||
<Col span={5}><boolean keyName="loaded" ui="switch" title="Loaded"/></Col> | ||
<Col span={5}><boolean keyName="old" ui="switch" title="Old"/></Col> | ||
<Col span={5}><string keyName="source" ui="input" title="Event Source" disabled={true}/></Col> | ||
</Row> | ||
</Block> | ||
</Row> | ||
</array> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"name": "@canner/auth-server", | ||
"version": "0.0.0", | ||
"description": "The auth server", | ||
"author": "Canner", | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib/index.js", | ||
"typings": "./lib/index.d.ts", | ||
"scripts": { | ||
"lint": "tslint -c tslint.json src/**/*.ts", | ||
"test": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha --timeout 10000 --compilers ts:ts-node/register --recursive --exit \"test/**/*.spec.ts\"", | ||
"clean": "rimraf lib dist", | ||
"prebuild": "npm run clean", | ||
"build": "tsc -p ./tsconfig.release.json --pretty && copyfiles -u 4 \"src/web/server/views/**/*\" lib/web/server/views", | ||
"prepublishOnly": "npm run clean && npm run build" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@canner/server-common": "^0.0.0", | ||
"@gqlify/canner-schema-to-gqlify-model": "^1.1.2", | ||
"@gqlify/server": "^2.1.0", | ||
"apollo-server": "^2.3.1", | ||
"apollo-server-koa": "^2.3.1", | ||
"bluebird": "^3.5.3", | ||
"boom": "^7.3.0", | ||
"graphql": "^14.1.1", | ||
"graphql-iso-date": "^3.6.1", | ||
"graphql-middleware": "^3.0.1", | ||
"graphql-tools": "^4.0.4", | ||
"graphql-type-json": "^0.2.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"ignore-loader": "^0.1.2", | ||
"jsonwebtoken": "^8.4.0", | ||
"jwks-rsa": "^1.3.0", | ||
"koa": "^2.6.2", | ||
"koa-mount": "^4.0.0", | ||
"koa-router": "^7.4.0", | ||
"koa-send": "^5.0.0", | ||
"koa-static": "^5.0.0", | ||
"koa-views": "^6.1.5", | ||
"lodash": "^4.17.5", | ||
"lowdb": "^1.0.0", | ||
"minimist": "^1.2.0", | ||
"node-jose": "^1.1.0", | ||
"openid-client": "^2.4.5", | ||
"pluralize": "^7.0.0", | ||
"pug": "^2.0.3", | ||
"rimraf": "^2.5.4", | ||
"simple-oidc-server": "^1.2.3", | ||
"speed-measure-webpack-plugin": "^1.2.5", | ||
"tmp": "^0.0.33", | ||
"ts-node": "^5.0.1", | ||
"tslint": "^5.9.1", | ||
"typescript": "^2.7.2" | ||
}, | ||
"devDependencies": { | ||
"@types/bluebird": "^3.5.25", | ||
"@types/boom": "^7.2.1", | ||
"@types/jsonwebtoken": "^8.3.0", | ||
"@types/koa": "^2.0.48", | ||
"@types/koa-mount": "^3.0.1", | ||
"@types/koa-router": "^7.0.37", | ||
"@types/koa-send": "^4.1.1", | ||
"@types/koa-static": "^4.0.0", | ||
"@types/lodash": "^4.14.107", | ||
"@types/minimist": "^1.2.0", | ||
"@types/node": "^9.4.6", | ||
"@types/webpack": "^4.4.22", | ||
"@types/webpack-dev-server": "^3.1.1", | ||
"copyfiles": "^2.1.0", | ||
"tslint-react": "^3.6.0" | ||
}, | ||
"peerDependencies": { | ||
"graphql": "*", | ||
"graphql-iso-date": "*", | ||
"graphql-type-json": "*", | ||
"@canner/server-common": "*" | ||
}, | ||
"repository": "Canner/canner", | ||
"license": "MIT" | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/canner-server/src/auth/app.ts → packages/auth-server/src/app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/canner-server/src/auth/config.ts → packages/auth-server/src/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["*.ts", "**/*.ts"], | ||
"exclude": ["./node_modules"], | ||
"compilerOptions": { | ||
"composite": true | ||
}, | ||
"references": [ | ||
{ "path": "../server-common" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.release.json", | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["test/**/*.ts"], | ||
"module": "ESNext", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "lib", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"exclude": ["node_modules", "lib"], | ||
"extends": ["tslint:latest", "tslint-react"], | ||
"rules": { | ||
"ordered-imports": [ | ||
true, | ||
{ | ||
"import-sources-order": "any", | ||
"named-imports-order": "any" | ||
} | ||
], | ||
"quotemark": [true, "single"], | ||
"no-implicit-dependencies": [true, "dev"], | ||
"no-submodule-imports": false, | ||
"object-literal-sort-keys": false, | ||
"trailing-comma": false, | ||
"arrow-parens": [true, "ban-single-arg-parens"], | ||
"interface-name": [true, "never-prefix"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["*.ts", "**/*.ts"], | ||
"exclude": ["./node_modules"] | ||
"exclude": ["./node_modules"], | ||
"references": [ | ||
{ "path": "../server-common" }, | ||
{ "path": "../auth-server" }, | ||
{ "path": "../graphql-server" }, | ||
{ "path": "../cms-server" } | ||
] | ||
} |
Oops, something went wrong.