Skip to content

Commit

Permalink
[CHG] perform search when using enter key + prevent refresh when clic…
Browse files Browse the repository at this point in the history
…king on the dropdown button inside the cmis table + deleted console.log call
  • Loading branch information
benwillig committed May 28, 2024
1 parent 47c3c5e commit ed6d2bd
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ export class CmisDocumentSearch extends CmisSessionComponent {
this.performSearch();
}

onSearchInputKeydown(ev) {
if (ev.keyCode === 13) {
return this.onClickSearch(ev);
}
}

async performSearch() {
var self = this;
const cmisQuery = self.getCmisQuery();
Expand Down Expand Up @@ -119,7 +125,6 @@ export class CmisDocumentSearch extends CmisSessionComponent {
}

onClickRow(cmisObject) {
console.log(cmisObject);
if (this.props.onClickRow) {
this.props.onClickRow(cmisObject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<input
class="ml-1 form-control search-input"
t-ref="existingCmisObjectId"
t-on-keydown="onSearchInputKeydown"
type="text"
/>
<div class="input-group-append">
Expand Down
3 changes: 0 additions & 3 deletions cmis_web/static/src/cmis_object_wrapper_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {sortBy} from "@web/core/utils/arrays";

export class CmisObjectWrapper {
constructor(cmisObject, cmisSession, params) {
console.log(cmisObject);
this.setup(cmisObject, cmisSession, params);
}

Expand Down Expand Up @@ -182,8 +181,6 @@ export class CmisObjectCollection {
(cmisObject) =>
new CmisObjectWrapper(cmisObject.object, cmisSession, params)
);
console.log("CmisObjectCollection");
console.log(this.cmisObjects);
this.orderBy = [];
this.sortBy("name");
}
Expand Down
10 changes: 9 additions & 1 deletion cmis_web/static/src/cmis_table/cmis_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const {Component, useState} = owl;
export class CmisTable extends Component {
setup() {
this.displayActions = this.props.displayActions;
console.log(this.displayActions);
if (this.displayActions === undefined) {
this.displayActions = true;
}
Expand Down Expand Up @@ -221,6 +220,15 @@ export class CmisTable extends Component {
return props;
}

get cmisTableDropdownDynamicProps() {
return {
beforeOpen: () => {
// prevent to refresh the view when clicking on the button
return false;
}
}
}

get nbCols() {
let nbCols = this.state.columns.length;
// Column selector
Expand Down
1 change: 1 addition & 0 deletions cmis_web/static/src/cmis_table/cmis_table.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
class="'o_optional_columns_dropdown text-center border-top-0'"
togglerClass="'btn p-0'"
skipTogglerTabbing="true"
t-props="cmisTableDropdownDynamicProps"
position="'bottom-end'"
>
<t t-set-slot="toggler">
Expand Down
1 change: 0 additions & 1 deletion cmis_web/static/src/cmis_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class CmisSessionComponent extends Component {

async setCmisSessionDefaultRepository() {
const self = this;
console.log("setCmisSessionDefaultRepository");
return new Promise(function (resolve, reject) {
if (self.cmisSession.repositories) {
resolve();
Expand Down
2 changes: 0 additions & 2 deletions cmis_web_proxy/static/src/cmis_folder/cmis_folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import {CmisFolderField} from "@cmis_web/cmis_folder/cmis_folder";
import {patch} from "@web/core/utils/patch";

console.log("patch cmis folder componenet");

patch(CmisFolderField.prototype, "open_with_proxy", {
genCmisSessionToken() {
return JSON.stringify({
Expand Down

0 comments on commit ed6d2bd

Please sign in to comment.