Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #21 from jonyw4/vendure-0.16
Browse files Browse the repository at this point in the history
Update to Vendure 0.16
  • Loading branch information
jonyw4 authored Oct 20, 2020
2 parents 6c96b94 + 93f8bb1 commit 771a7d7
Show file tree
Hide file tree
Showing 29 changed files with 7,392 additions and 7,335 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "Vendure Reviews Plugin",
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "dev",
"workspaceFolder": "/workspace",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"christian-kohler.path-intellisense",
"christian-kohler.npm-intellisense",
"github.vscode-pull-request-github",
"mhutchie.git-graph",
"dbaeumer.vscode-eslint",
"joelday.docthis",
"naumovs.color-highlight",
"esbenp.prettier-vscode",
"mikehanson.auto-barrel",
"streetsidesoftware.code-spell-checker",
"steoates.autoimport"
],
"forwardPorts": [3000, 3306],
"postCreateCommand": "yarn install",
// "remoteUser": "node"
}
12 changes: 5 additions & 7 deletions dev-server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import {
} from '@vendure/core';
import { ReviewsStorePlugin, ReviewsProductPlugin } from '../src';

const PORT = Number(process.env.PORT) || 3000;

export const config: VendureConfig = {
apiOptions: {
hostname: '0.0.0.0',
port: PORT,
port: 3000,
adminApiPath: 'admin-api',
adminApiPlayground: {
settings: {
Expand All @@ -35,11 +33,11 @@ export const config: VendureConfig = {
dbConnectionOptions: {
type: 'mysql',
synchronize: true,
host: 'localhost',
host: 'host.docker.internal',
port: 3306,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
username: 'root',
password: '',
database: 'vendure',
logging: false
},
paymentOptions: {
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3"
services:
database:
image: mysql:5.7
ports:
- "3306:3306"
volumes:
- /var/lib/mysql
environment:
MYSQL_DATABASE: vendure
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
dev:
image: mcr.microsoft.com/vscode/devcontainers/typescript-node:0-12
command: /bin/sh -c "while sleep 1000; do :; done"
ports:
- "3000:3000"
volumes:
- .:/workspace:cached
- node_modules:/workspace/node_modules
depends_on:
- database
volumes:
node_modules:
2 changes: 1 addition & 1 deletion e2e/config/inject-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class E2EInjectOrderPlugin implements OnVendureBootstrap {
const completeOrder = await this.connection.getRepository(Order).save(
new Order({
code: 'T_2',
state: 'Fulfilled',
state: 'Delivered',
active: false,
customer: customers[1],
lines: [],
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"dev-server:run:worker": "node -r ts-node/register dev-server/index-worker.ts"
},
"dependencies": {
"@vendure/ui-devkit": "0.15.0"
"@vendure/ui-devkit": "0.16.1"
},
"peerDependencies": {
"@vendure/core": ">=0.15.0"
"@vendure/core": ">=0.16.1"
},
"devDependencies": {
"@commitlint/config-conventional": "9.1.1",
Expand All @@ -43,9 +43,9 @@
"@types/jest": "26.0.4",
"@typescript-eslint/eslint-plugin": "3.6.1",
"@typescript-eslint/parser": "3.6.1",
"@vendure/core": "0.15.0",
"@vendure/create": "0.15.0",
"@vendure/testing": "0.15.0",
"@vendure/core": "0.16.1",
"@vendure/create": "0.16.1",
"@vendure/testing": "0.16.1",
"codecov": "^3.7.2",
"commitlint": "9.1.0",
"concurrently": "5.3.0",
Expand All @@ -61,7 +61,7 @@
"semantic-release": "17.1.1",
"ts-jest": "26.1.3",
"ts-node": "8.10.2",
"typescript": "3.8.3"
"typescript": "4.0.3"
},
"husky": {
"hooks": {
Expand Down
91 changes: 0 additions & 91 deletions src/api/resolvers/admin/review-product.resolver.spec.ts

This file was deleted.

9 changes: 6 additions & 3 deletions src/api/resolvers/admin/review-product.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ export class ReviewProductAdminResolver {

@Query()
@Allow(Permission.ReadOrder)
async reviewProduct(@Args() { id }: QueryReviewProductArgs) {
return this.reviewProductService.findById(id);
async reviewProduct(
@Ctx() ctx: RequestContext,
@Args() { id }: QueryReviewProductArgs
) {
return this.reviewProductService.findById(ctx, id);
}

@Query()
Expand All @@ -60,7 +63,7 @@ export class ReviewProductAdminResolver {
@Ctx() ctx: RequestContext,
@Args() args: MutationTransitionReviewProductToStateArgs
) {
const review = await this.reviewProductService.findById(args.id);
const review = await this.reviewProductService.findById(ctx, args.id);
return this.reviewProductService.transitionToState(
ctx,
review,
Expand Down
77 changes: 0 additions & 77 deletions src/api/resolvers/admin/review-store.resolver.spec.ts

This file was deleted.

9 changes: 6 additions & 3 deletions src/api/resolvers/admin/review-store.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ export class ReviewStoreAdminResolver {

@Query()
@Allow(Permission.ReadOrder)
async reviewStore(@Args() { id }: QueryReviewStoreArgs) {
return this.reviewStoreService.findById(id);
async reviewStore(
@Ctx() ctx: RequestContext,
@Args() { id }: QueryReviewStoreArgs
) {
return this.reviewStoreService.findById(ctx, id);
}

@Query()
Expand All @@ -48,7 +51,7 @@ export class ReviewStoreAdminResolver {
@Ctx() ctx: RequestContext,
@Args() args: MutationTransitionReviewStoreToStateArgs
) {
const review = await this.reviewStoreService.findById(args.id);
const review = await this.reviewStoreService.findById(ctx, args.id);
return this.reviewStoreService.transitionToState(
ctx,
review,
Expand Down

This file was deleted.

Loading

0 comments on commit 771a7d7

Please sign in to comment.