Skip to content

Commit

Permalink
[CORL 133] API Review (coralproject#2197)
Browse files Browse the repository at this point in the history
* refactor: removed unused subscription code

* refactor: removed management api's

* refactor: cleanup of connections

* refactor: refactored comments edge

* refactor: simplified connection resolving

* feat: added story connection edge

* fix: added story index

* feat: added user pagination and user edge

* fix: added filter to comment query

* fix: removed unused resolvers

* fix: creating a comment reply should require auth

* refactor: cleanup of graph files

* feat: removed display name, made username non-unique

* fix: fixed tests

* fix: fixed tests

* fix: added more api docs

* fix: fixed bug with installer

* refactor: fixes and updates

* fix: added linting for graphql, fixed schema

* feat: added docker build tests

* fix: upped output timeout

* fix: fixed stacktraces in production builds

* fix: removed `git add`

- `git add` was causing issues with
    partial staged changs on files

* feat: improved error messaging for auth

* refactor: cleaned up queue names

* fix: merge error
  • Loading branch information
wyattjoh authored and cvle committed Mar 12, 2019
1 parent 37959f9 commit d37333b
Show file tree
Hide file tree
Showing 125 changed files with 1,256 additions and 1,523 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ jobs:
root: .
paths: dist

# docker_tests will test that the docker build process completes.
docker_tests:
<<: *job_defaults
steps:
- checkout
- setup_remote_docker
- run:
name: Build
command: docker build -t coralproject/talk:next --build-arg REVISION_HASH=${CIRCLE_SHA1} .
no_output_timeout: 20m

# release_docker will build and push the Docker image.
release_docker:
<<: *job_defaults
Expand All @@ -132,6 +143,12 @@ workflows:
version: 2
build-and-test:
jobs:
# Run the docker build test on all branches except for next as we'll
# already be releasing via docker with that route.
- docker_tests:
filters:
branches:
ignore: next
- npm_dependencies
- lint:
requires:
Expand Down
5 changes: 1 addition & 4 deletions .graphqlconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"projects": {
"tenant": {
"schemaPath": "src/core/server/graph/tenant/schema/schema.graphql"
},
"management": {
"schemaPath": "src/core/server/graph/management/schema/schema.graphql"
}
}
}
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:10-alpine

# Install build dependancies.
RUN apk --no-cache add git
RUN apk --no-cache add git python

# Create app directory.
RUN mkdir -p /usr/src/app
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The following environment variables can be set to configure the Talk Server:
(Default `false`)
- `LOCALE` - Specify the default locale to use for all requests without a locale
specified. (Default `en-US`)
- `ENABLE_GRAPHIQL` - When `true`, it will enable the `/tenant/graphiql` even in
- `ENABLE_GRAPHIQL` - When `true`, it will enable the `/graphiql` even in
production, use with care. (Default `false`)
- `CONCURRENCY` - The number of worker nodes to spawn to handle web traffic,
this should be tied to the number of CPU's available. (Default
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ gulp.task("server:scripts", () =>
],
})
)
.pipe(sourcemaps.write("."))
.pipe(sourcemaps.write(".", { sourceRoot: "../src" }))
.pipe(gulp.dest(resolveDistFolder()))
);

Expand Down
107 changes: 97 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lint:server": "tslint --project ./src/tsconfig.json",
"lint:client": "tslint --project ./src/core/client/tsconfig.json",
"lint:scripts": "tslint --project ./tsconfig.json",
"lint:graphql": "graphql-schema-linter src/core/server/graph/tenant/schema/schema.graphql",
"lint-fix": "npm run lint:server -- --fix && npm run lint:client -- --fix && npm run lint:scripts -- --fix",
"test": "node scripts/test.js --env=jsdom",
"tscheck": "npm-run-all --parallel tscheck:*",
Expand Down Expand Up @@ -73,7 +74,6 @@
"graphql-extensions": "^0.2.1",
"graphql-fields": "^1.1.0",
"graphql-playground-html": "^1.6.0",
"graphql-redis-subscriptions": "^1.5.0",
"graphql-tools": "^3.0.5",
"html-minifier": "^3.5.21",
"html-to-text": "^4.0.0",
Expand Down Expand Up @@ -109,7 +109,6 @@
"source-map-support": "^0.5.10",
"stack-utils": "^1.0.2",
"striptags": "^3.1.1",
"subscriptions-transport-ws": "^0.9.12",
"throng": "^4.0.0",
"tlds": "^1.203.1",
"uuid": "^3.3.2",
Expand Down Expand Up @@ -226,6 +225,7 @@
"fluent-intl-polyfill": "^0.1.0",
"fluent-langneg": "^0.1.0",
"fluent-react": "^0.8.3",
"graphql-schema-linter": "^0.2.0",
"graphql-schema-typescript": "^1.2.1",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
Expand Down Expand Up @@ -316,14 +316,21 @@
},
"lint-staged": {
"*.{j,t}s{,x}": [
"tslint --fix",
"git add"
"tslint"
],
"src/core/server/graph/tenant/schema/schema.graphql": [
"graphql-schema-linter"
]
},
"bundlesize": [
{
"path": "./dist/static/assets/js/embed.js",
"maxSize": "15 kB"
}
]
],
"graphql-schema-linter": {
"rules": [
"types-are-capitalized"
]
}
}
11 changes: 0 additions & 11 deletions scripts/generateSchemaTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ async function main() {
customScalarType: { Cursor: "Cursor", Time: "Date" },
},
},
{
name: "management",
fileName: getFileName("management"),
config: {
contextType: "ManagementContext",
importStatements: [
'import ManagementContext from "talk-server/graph/management/context";',
],
customScalarType: { Time: "Date" },
},
},
];

for (const file of files) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/admin/helpers/getQueueConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function getQueueConnection(
const root = store.getRoot();
if (queue === "rejected") {
return ConnectionHandler.getConnection(root, "RejectedQueue_comments", {
filter: { status: "REJECTED" },
status: "REJECTED",
});
}
const queuesRecord = root.getLinkedRecord("moderationQueues")!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import React, { StatelessComponent } from "react";
import { PropTypesOf } from "talk-framework/types";
import { HorizontalGutter } from "talk-ui/components";

import DisplayNamesConfigContainer from "../containers/DisplayNamesConfigContainer";
import AuthIntegrationsConfig from "./AuthIntegrationsConfig";

interface Props {
disabled?: boolean;
auth: PropTypesOf<typeof AuthIntegrationsConfig>["auth"] &
PropTypesOf<typeof DisplayNamesConfigContainer>["auth"];
auth: PropTypesOf<typeof AuthIntegrationsConfig>["auth"];
onInitValues: (values: any) => void;
}

Expand All @@ -19,11 +17,6 @@ const AuthConfig: StatelessComponent<Props> = ({
onInitValues,
}) => (
<HorizontalGutter size="double" data-testid="configure-authContainer">
<DisplayNamesConfigContainer
disabled={disabled}
auth={auth}
onInitValues={onInitValues}
/>
<AuthIntegrationsConfig
disabled={disabled}
auth={auth}
Expand Down
Loading

0 comments on commit d37333b

Please sign in to comment.