@q42/q-cms-components
Advanced tools
Comparing version 10.2.2 to 10.3.0
{ | ||
"name": "@q42/q-cms-components", | ||
"version": "10.2.2", | ||
"version": "10.3.0", | ||
"description": "Front-end package that provides a UI on top of the QMS back-end.", | ||
@@ -25,8 +25,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@tiptap/extension-image": "^2.0.3", | ||
"@tiptap/extension-link": "^2.0.3", | ||
"@tiptap/extension-underline": "^2.0.3", | ||
"@tiptap/pm": "^2.0.3", | ||
"@tiptap/starter-kit": "^2.0.3", | ||
"@tiptap/vue-2": "^2.0.3", | ||
"@tiptap/extension-image": "^2.1.6", | ||
"@tiptap/extension-link": "^2.1.6", | ||
"@tiptap/extension-placeholder": "^2.1.6", | ||
"@tiptap/extension-underline": "^2.1.6", | ||
"@tiptap/pm": "^2.1.6", | ||
"@tiptap/starter-kit": "^2.1.6", | ||
"@tiptap/vue-2": "^2.1.6", | ||
"autosize": "5.0.x", | ||
@@ -33,0 +34,0 @@ "bootstrap": "4.6.x", |
@@ -76,10 +76,13 @@ import CrudHelpers from '../crud/crud-helpers'; | ||
export function getComponentTitle(store, component, schemaProperties) { | ||
// 1. first look if there is a property with isDisplayTitle | ||
for (const propName in schemaProperties) { | ||
const propSchema = schemaProperties[propName]; | ||
// 1. first look if there is a property with isDisplayTitle | ||
if (propSchema.isDisplayTitle) { | ||
return component[propName]; | ||
} | ||
} | ||
for (const propName in schemaProperties) { | ||
const propSchema = schemaProperties[propName]; | ||
// 2. secondly check if the component is of type 'RichTextBlock', return friendly title instead of rich text content. | ||
@@ -86,0 +89,0 @@ if (component.$type === 'Q.Cms.SampleCms.Domain.Components.Content.RichTextBlock, Q.Cms.SampleCms.Domain') { |
/* global describe, it, expect */ | ||
import { initialValue } from './schema-scripts'; | ||
import { getComponentTitle, initialValue } from './schema-scripts'; | ||
@@ -242,1 +242,47 @@ describe('intialValue', function () { | ||
}); | ||
describe('getComponentTitle', function () { | ||
it('should get a display title when it is present', function () { | ||
const store = {}; | ||
const component = { | ||
$type: 'Q.Cms.SampleCms.Domain.Items.OpeningPeriod, Q.Cms.SampleCms.Domain', | ||
bar: 'bar displaytitle', | ||
foo: 'foo title' | ||
}; | ||
const schemaProperties = { | ||
foo: { | ||
type: 'string', | ||
isDisplayTitle: false | ||
}, | ||
bar: { | ||
type: 'string', | ||
isDisplayTitle: true | ||
} | ||
}; | ||
const title = getComponentTitle(store, component, schemaProperties); | ||
expect(title).toEqual('bar displaytitle'); | ||
}); | ||
it('should get a display title when it is rich text', function () { | ||
const store = {}; | ||
const component = { | ||
$type: 'Q.Cms.SampleCms.Domain.Components.Content.RichTextBlock, Q.Cms.SampleCms.Domain', | ||
bar: 'bar displaytitle', | ||
foo: 'foo title' | ||
}; | ||
const schemaProperties = { | ||
foo: { | ||
type: 'string', | ||
isDisplayTitle: false | ||
}, | ||
bar: { | ||
type: 'string', | ||
isDisplayTitle: false | ||
} | ||
}; | ||
const title = getComponentTitle(store, component, schemaProperties); | ||
expect(title).toEqual('Rich text'); | ||
}); | ||
}); |
@@ -174,3 +174,7 @@ import { ActionTree, GetterTree, MutationTree } from 'vuex'; | ||
async fetchItems({ state, commit }, payload: SearchCrudItemPayload = state.searchState) { | ||
commit('isLoading', true); | ||
// To prevent the relation picker from triggering a reload of the current crud item page due to a change in isLoading, loading must be disabled. This situation occurs when the relation picker loads a crud item of the same type as the one currently displayed on the page. | ||
if (!payload.disableLoading) { | ||
commit('isLoading', true); | ||
} | ||
try { | ||
@@ -189,3 +193,5 @@ const result = await CrudApi.search(state.path, payload.query, payload.languageFilter, payload.page, payload.sort); | ||
} finally { | ||
commit('isLoading', false); | ||
if (!payload.disableLoading) { | ||
commit('isLoading', false); | ||
} | ||
} | ||
@@ -192,0 +198,0 @@ }, |
@@ -318,2 +318,3 @@ import type { CrudStoreItemsModel } from '../stores/types/CrudStoreModel'; | ||
sort?: string; | ||
disableLoading?: boolean; | ||
} | ||
@@ -320,0 +321,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2146281
9184
26
+ Added@babel/parser@7.26.7(transitive)
+ Added@babel/types@7.26.7(transitive)
+ Added@tiptap/extension-placeholder@2.11.5(transitive)
+ Addedprosemirror-tables@1.6.3(transitive)
+ Addedsass@1.83.4(transitive)
- Removed@babel/parser@7.26.8(transitive)
- Removed@babel/types@7.26.8(transitive)
- Removedprosemirror-tables@1.6.4(transitive)
- Removedsass@1.84.0(transitive)
Updated@tiptap/pm@^2.1.6
Updated@tiptap/starter-kit@^2.1.6
Updated@tiptap/vue-2@^2.1.6