Skip to content

Commit

Permalink
Merge branch 'master' into minor
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Aug 23, 2023
2 parents a9953a1 + 738fe68 commit 10034bd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Let's say you have a plugin which adds a new entity to the database called `Prod
The detail component itself is an Angular component which extends the [BaseDetailComponent]({{< relref "base-detail-component" >}}) or [TypedBaseDetailComponent]({{< relref "typed-base-detail-component" >}}) class.

```TypeScript
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { TypedBaseDetailComponent, LanguageCode } from '@vendure/admin-ui/core';
import { gql } from 'apollo-angular';
Expand Down Expand Up @@ -47,7 +47,7 @@ export const GET_REVIEW_DETAIL = gql`
styleUrls: ['./review-detail.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ReviewDetailComponent extends TypedBaseDetailComponent<typeof GetReviewDetailDocument> implements OnInit, OnDestroy {
export class ReviewDetailComponent extends TypedBaseDetailComponent<typeof GetReviewDetailDocument, 'review'> implements OnInit, OnDestroy {
detailForm = this.formBuilder.group({
title: [''],
rating: [1],
Expand Down Expand Up @@ -207,7 +207,7 @@ import { GetReviewDocument, GetReviewDetailQuery } from './generated-types';
const review$ = inject(DataService)
.query(GetReviewDocument, { id: route.paramMap.get('id') })
.mapStream(data => data.review);
return of({ detail: { entity: review$ } });
return of({ entity: review$ });
},
},
data: {
Expand All @@ -220,7 +220,7 @@ import { GetReviewDocument, GetReviewDetailQuery } from './generated-types';
link: ['/extensions', 'reviews'],
},
{
label: `${entity.title}`,
label: `${entity?.title ?? 'New Review'}`,
link: [],
},
]),
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './finite-state-machine/finite-state-machine';
export * from './finite-state-machine/types';
export * from './async-queue';
export * from './calculated-decorator';
export * from './error/errors';
export * from './error/error-result';
export * from './error/generated-graphql-admin-errors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type CachedSession = {
* }
* const loggerCtx = 'RedisSessionCacheStrategy';
* const DEFAULT_NAMESPACE = 'vendure-session-cache';
* const DEFAULT_TTL = 86400;
*
* export class RedisSessionCacheStrategy implements SessionCacheStrategy {
* private client: Redis;
Expand Down Expand Up @@ -100,7 +101,7 @@ export type CachedSession = {
*
* async set(session: CachedSession) {
* try {
* await this.client.set(this.namespace(session.token), JSON.stringify(session));
* await this.client.set(this.namespace(session.token), JSON.stringify(session), 'EX', DEFAULT_TTL);
* } catch (e: any) {
* Logger.error(`Could not set cached session: ${e.message}`, loggerCtx);
* }
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/entity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export * from './product/product.entity';
export * from './promotion/promotion.entity';
export * from './refund/refund.entity';
export * from './role/role.entity';
export * from './seller/seller.entity';
export * from './session/anonymous-session.entity';
export * from './session/authenticated-session.entity';
export * from './session/session.entity';
Expand Down

0 comments on commit 10034bd

Please sign in to comment.