Skip to content

Commit

Permalink
Merge branch 'release/0.16.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Jan 12, 2022
2 parents 936d2e4 + db34b44 commit 933e02f
Show file tree
Hide file tree
Showing 16 changed files with 140 additions and 37 deletions.
7 changes: 7 additions & 0 deletions packages/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# druxt-blocks

## 0.14.5

### Patch Changes

- Updated dependencies [60ee4e8]
- [email protected]

## 0.14.4

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "druxt-blocks",
"version": "0.14.4",
"version": "0.14.5",
"description": "Drupal Block and Block Region Druxt components.",
"keywords": [
"block",
Expand Down Expand Up @@ -45,7 +45,7 @@
"axios": "^0.21.1",
"drupal-jsonapi-params": "^1.1.12",
"druxt": "^0.16.0",
"druxt-entity": "^0.22.0",
"druxt-entity": "^0.23.0",
"druxt-router": "^0.25.0"
},
"optionalDependencies": {
Expand Down
24 changes: 24 additions & 0 deletions packages/entity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# druxt-entity

## 0.23.0

### Minor Changes

- 87ec487: Updated DruxtRouterEntity to use Full view mode.

⚠ Potential breaking change

_**Note:** This may effect the rendered template if the Full view mode is configured in Drupal._

```diff
-components/DruxtEntityNodePageDefault.vue
+components/DruxtEntityNodePageFull.vue
-components/druxt/entity/node/page/Default.vue
+components/druxt/entity/node/page/Full.vue
```

- 60ee4e8: Added DruxtEntity[EntityType][viewmode][SchemaType] component options.

### Patch Changes

- Updated dependencies [87ec487]
- [email protected]

## 0.22.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/entity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "druxt-entity",
"version": "0.22.0",
"version": "0.23.0",
"description": "Drupal Display Mode powered Entity, Form and Field Druxt components.",
"keywords": [
"cms",
Expand Down Expand Up @@ -48,7 +48,7 @@
"drupal-jsonapi-params": "^1.2.2",
"druxt": "^0.16.0",
"druxt-router": "^0.25.0",
"druxt-schema": "^0.9.3"
"druxt-schema": "^0.10.0"
},
"publishConfig": {
"access": "public"
Expand Down
30 changes: 26 additions & 4 deletions packages/entity/src/components/DruxtEntity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
if (!schema) return false
const fields = {}
for (const field of schema.fields) {
for (const field of schema.fields || []) {
const relationship = !!((field.settings || {}).storage || {}).target_type || !!(model.relationships || {})[field.id]
const value = relationship ? ((model || {}).relationships || {})[field.id] : ((model || {}).attributes || {})[field.id]
Expand Down Expand Up @@ -248,8 +248,24 @@ export default {
* @returns {ComponentOptions}
*/
componentOptions: ({ mode, schema, schemaType, type }) => ([
[(schema || {}).resourceType || type, ((schema || {}).config || {}).mode || mode, ((schema || {}).config || {}).schemaType || schemaType || 'view'],
[((schema || {}).config || {}).mode || mode],
// DruxtEntity[ResourceType][ViewMode][SchemaType]
[
(schema || {}).resourceType || type,
((schema || {}).config || {}).mode || mode,
((schema || {}).config || {}).schemaType || schemaType || 'view'
],
// DruxtEntity[EntityType][ViewMode][SchemaType]
[
((schema || {}).resourceType || type).split('--').shift(),
((schema || {}).config || {}).mode || mode,
((schema || {}).config || {}).schemaType || schemaType || 'view'
],
// DruxtEntity[ViewMode]
[
((schema || {}).config || {}).mode || mode,
],
]),
/**
Expand Down Expand Up @@ -368,17 +384,23 @@ export default {
* @example @lang js
* [
* 'DruxtEntity[ResourceType][DisplayMode][SchemaType]',
* 'DruxtEntity[EntityType][DisplayMode][SchemaType]',
* 'DruxtEntity[ResourceType][DisplayMode]',
* 'DruxtEntity[EntityType][DisplayMode]',
* 'DruxtEntity[ResourceType]',
* 'DruxtEntity[EntityType]',
* 'DruxtEntity[DisplayMode]',
* ]
*
* @example <caption>Article Node (default)</caption> @lang js
* [
* 'DruxtEntityNodeArticleDefaultView',
* 'DruxtEntityNodeDefaultView',
* 'DruxtEntityNodeArticleDefault',
* 'DruxtEntityNodeArticle',
* 'DruxtEntityNodeDefault',
* 'DruxtEntityNodeArticle',
* 'DruxtEntityNode',
* 'DruxtEntityDefault',
* ]
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/entity/src/components/DruxtRouterEntity.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<DruxtEntity v-bind="route.props" />
<DruxtEntity
v-bind="route.props"
mode="full"
/>
</template>

<script>
Expand Down
7 changes: 1 addition & 6 deletions packages/entity/test/components/DruxtEntity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ describe('DruxtEntity', () => {
'entity', 'fields', 'schema', 'value'
])
expect(wrapper.vm.component.is).toBe('DruxtEntityNodePage')
expect(wrapper.vm.component.options).toStrictEqual([
'DruxtEntityNodePageDefaultView',
'DruxtEntityNodePageDefault',
'DruxtEntityNodePage',
'DruxtEntityDefault',
])
expect(wrapper.vm.component.options).toMatchSnapshot()
expect(wrapper.vm.component.props).toStrictEqual({})
expect(Object.keys(wrapper.vm.component.propsData)).toStrictEqual([
'entity', 'fields', 'schema', 'value',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DruxtEntity component defaults 1`] = `
Array [
"DruxtEntityNodePageDefaultView",
"DruxtEntityNodeDefaultView",
"DruxtEntityNodePageDefault",
"DruxtEntityNodeDefault",
"DruxtEntityNodePage",
"DruxtEntityNode",
"DruxtEntityDefault",
]
`;

exports[`DruxtEntity component defaults 2`] = `
"<div>
<druxtentitynodepage-stub entity=\\"[object Object]\\" fields=\\"[object Object]\\" schema=\\"[object Object]\\" value=\\"[object Object]\\"></druxtentitynodepage-stub>
</div>"
Expand All @@ -11,8 +23,11 @@ exports[`DruxtEntity missing schema 1`] = `
<div entity=\\"[object Object]\\" value=\\"[object Object]\\">
<druxtdebug-stub summary=\\"Missing schema for 'file--file--default'\\"><label>Component options:<ul>
<li>DruxtEntityFileFileDefaultView</li>
<li>DruxtEntityFileDefaultView</li>
<li>DruxtEntityFileFileDefault</li>
<li>DruxtEntityFileDefault</li>
<li>DruxtEntityFileFile</li>
<li>DruxtEntityFile</li>
<li>DruxtEntityDefault</li>
</ul></label><label>Entity:<pre>{
\\"type\\": \\"file--file\\",
Expand Down
6 changes: 6 additions & 0 deletions packages/schema/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# druxt-schema

## 0.10.0

### Minor Changes

- 87ec487: Add fallback to 'default' if schema view mode is missing.

## 0.9.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "druxt-schema",
"version": "0.9.3",
"version": "0.10.0",
"description": "Drupal Content Entity schema generator for Druxt with support for View and Form displays.",
"keywords": [
"cms",
Expand Down
15 changes: 14 additions & 1 deletion packages/schema/templates/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ const DruxtSchemaPlugin = {
* @example @lang js
* const schema = await this.$druxtSchema.import('node--page--default--view')
*/
import: async id => import(`./schemas/${id}.json`).then(m => m.default || m)
import: async id => {
return import(`./schemas/${id}.json`)
.then(m => m.default || m)
.catch(async (err) => {
const parts = id.split('--')

// Error if there's no default view mode.
if (parts[parts.length - 2] === 'default') throw err

// Fallback to the default view mode.
parts[parts.length - 2] = 'default'
return import(`./schemas/${parts.join('--')}.json`).then(m => m.default || m)
})
}
}

export default (context, inject) => {
Expand Down
10 changes: 10 additions & 0 deletions packages/site/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# druxt-site

## 0.10.5

### Patch Changes

- Updated dependencies [60ee4e8]
- [email protected]
- [email protected]
- [email protected]
- [email protected]

## 0.10.4

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "druxt-site",
"version": "0.10.4",
"version": "0.10.5",
"description": "Out of the box Decoupled Drupal sites with Druxt.",
"keywords": [
"cms",
Expand Down Expand Up @@ -44,13 +44,13 @@
"dependencies": {
"drupal-jsonapi-params": "^1.2.2",
"druxt": "^0.16.0",
"druxt-blocks": "^0.14.4",
"druxt-blocks": "^0.14.5",
"druxt-breadcrumb": "^0.13.4",
"druxt-entity": "^0.22.0",
"druxt-entity": "^0.23.0",
"druxt-menu": "^0.15.3",
"druxt-router": "^0.25.0",
"druxt-schema": "^0.9.3",
"druxt-views": "^0.17.1",
"druxt-schema": "^0.10.0",
"druxt-views": "^0.17.2",
"md5": "^2.2.1"
},
"optionalDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions packages/views/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# druxt-views

## 0.17.2

### Patch Changes

- Updated dependencies [60ee4e8]
- [email protected]
- [email protected]

## 0.17.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/views/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "druxt-views",
"version": "0.17.1",
"version": "0.17.2",
"description": "Drupal Views components for Druxt with support for filters, pagination and sorting.",
"keywords": [
"cms",
Expand Down Expand Up @@ -45,8 +45,8 @@
"deepmerge": "^4.2.2",
"drupal-jsonapi-params": "^1.1.12",
"druxt": "^0.16.0",
"druxt-blocks": "^0.14.4",
"druxt-entity": "^0.22.0",
"druxt-blocks": "^0.14.5",
"druxt-entity": "^0.23.0",
"druxt-router": "^0.25.0",
"md5": "^2.3.0"
},
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6305,14 +6305,14 @@ __metadata:
languageName: node
linkType: hard

"druxt-blocks@^0.14.4, druxt-blocks@workspace:packages/blocks":
"druxt-blocks@^0.14.4, druxt-blocks@^0.14.5, druxt-blocks@workspace:packages/blocks":
version: 0.0.0-use.local
resolution: "druxt-blocks@workspace:packages/blocks"
dependencies:
axios: ^0.21.1
drupal-jsonapi-params: ^1.1.12
druxt: ^0.16.0
druxt-entity: ^0.22.0
druxt-entity: ^0.23.0
druxt-router: ^0.25.0
vue: ^2.6.14
vuex: ^3.6.2
Expand Down Expand Up @@ -6359,15 +6359,15 @@ __metadata:
languageName: unknown
linkType: soft

"druxt-entity@^0.22.0, druxt-entity@workspace:packages/entity":
"druxt-entity@^0.23.0, druxt-entity@workspace:packages/entity":
version: 0.0.0-use.local
resolution: "druxt-entity@workspace:packages/entity"
dependencies:
deepmerge: ^4.2.2
drupal-jsonapi-params: ^1.2.2
druxt: ^0.16.0
druxt-router: ^0.25.0
druxt-schema: ^0.9.3
druxt-schema: ^0.10.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -6405,7 +6405,7 @@ __metadata:
languageName: unknown
linkType: soft

"druxt-schema@^0.9.3, druxt-schema@workspace:packages/schema":
"druxt-schema@^0.10.0, druxt-schema@workspace:packages/schema":
version: 0.0.0-use.local
resolution: "druxt-schema@workspace:packages/schema"
dependencies:
Expand All @@ -6428,13 +6428,13 @@ __metadata:
dependencies:
drupal-jsonapi-params: ^1.2.2
druxt: ^0.16.0
druxt-blocks: ^0.14.4
druxt-blocks: ^0.14.5
druxt-breadcrumb: ^0.13.4
druxt-entity: ^0.22.0
druxt-entity: ^0.23.0
druxt-menu: ^0.15.3
druxt-router: ^0.25.0
druxt-schema: ^0.9.3
druxt-views: ^0.17.1
druxt-schema: ^0.10.0
druxt-views: ^0.17.2
md5: ^2.2.1
vue: ^2.6.14
vuex: ^3.6.2
Expand All @@ -6457,16 +6457,16 @@ __metadata:
languageName: unknown
linkType: soft

"druxt-views@^0.17.1, druxt-views@workspace:packages/views":
"druxt-views@^0.17.2, druxt-views@workspace:packages/views":
version: 0.0.0-use.local
resolution: "druxt-views@workspace:packages/views"
dependencies:
axios: ^0.21.1
deepmerge: ^4.2.2
drupal-jsonapi-params: ^1.1.12
druxt: ^0.16.0
druxt-blocks: ^0.14.4
druxt-entity: ^0.22.0
druxt-blocks: ^0.14.5
druxt-entity: ^0.23.0
druxt-router: ^0.25.0
md5: ^2.3.0
vue: ^2.6.14
Expand Down

0 comments on commit 933e02f

Please sign in to comment.