Skip to content

Commit

Permalink
#22045 Filter contentlets in suggestions (#22347)
Browse files Browse the repository at this point in the history
* allow search in any string

* fix types in extensions

* update output of block-editor-field.js

* optimization flag

* update output of block-editor-field.js

Co-authored-by: Arcadio Quintero <[email protected]>
  • Loading branch information
hmoreras and oidacra authored Jun 3, 2022
1 parent 3038c6b commit 6dd3c60
Show file tree
Hide file tree
Showing 7 changed files with 47,961 additions and 1,984 deletions.
45,705 changes: 45,704 additions & 1 deletion dotCMS/src/main/webapp/html/dotcms-block-editor.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const DragHandler = (viewContainerRef: ViewContainerRef) => {
});
return false;
},
mousemove(view, event) {
mousemove(view, event: MouseEvent) {
const coords = {
left: event.clientX + HANDLER_GAP,
top: event.clientY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const ImageUpload = (injector: Injector, viewContainerRef: ViewContainerR
key: new PluginKey('imageUpload'),
props: {
handleDOMEvents: {
paste(view, event) {
paste(view, event: ClipboardEvent) {
if (areImageFiles(event)) {
if (event.clipboardData.files.length !== 1) {
alert('Can paste just one image at a time');
Expand All @@ -123,7 +123,7 @@ export const ImageUpload = (injector: Injector, viewContainerRef: ViewContainerR
return false;
},

drop(view, event) {
drop(view, event: DragEvent) {
if (areImageFiles(event)) {
event.preventDefault();
if (event.dataTransfer.files.length !== 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SuggestionsService {
}: ContentletFilters): Observable<DotCMSContentlet[]> {
return this.http
.post('/api/content/_search', {
query: `+contentType:${contentType} +languageId:${currentLanguage} +deleted:false +working:true +catchall:${filter}* title:'${filter}'^15`,
query: `+contentType:${contentType} +languageId:${currentLanguage} +deleted:false +working:true +catchall:*${filter}* `,
sort: 'modDate desc',
offset: 0,
limit: 40
Expand Down
3 changes: 2 additions & 1 deletion ui/libs/block-editor/src/lib/plugins/placeholder.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export const PlaceholderPlugin = new Plugin({
// See if the transaction adds or removes any placeholders
const action = tr.getMeta(this);
if (action && action.add) {
const id = action.add.id;
const deco = Decoration.widget(action.add.pos, action.add.element, {
id: action.add.id
key: id
});
set = set.add(tr.doc, [deco]);
} else if (action && action.remove) {
Expand Down
4,227 changes: 2,250 additions & 1,977 deletions ui/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"publish:docs": "gh-pages --dist ./docs --dest ./",
"build:dev": "nx build dotcms-webcomponents --with-deps;nx build dotcms-ui",
"build:prod": "nx build dotcms-webcomponents --with-deps;nx build dotcms-ui --configuration production",
"build:dotcms-block-editor": "ng build dotcms-block-editor --configuration production --output-hashing=none && cat dist/apps/dotcms-block-editor/{generator-runtime,runtime,polyfills,main}.js > dotcms-block-editor.js",
"build:dotcms-block-editor": "ng build dotcms-block-editor --configuration production --optimization --output-hashing=none && cat dist/apps/dotcms-block-editor/{generator-runtime,runtime,polyfills,main}.js > ../dotCMS/src/main/webapp/html/dotcms-block-editor.js",
"docker:test": "npm run docker:build;IMAGE_BASE_NAME=core-web docker-compose -f docker-compose-running-test.yml up",
"docker:build": "docker build -t core-web .",
"analyze": "ng build --stats-json;webpack-bundle-analyzer dist/stats.json",
Expand Down

0 comments on commit 6dd3c60

Please sign in to comment.