mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Add copy to clipboard for debug text and some bug fixes
This commit is contained in:
parent
94525a4d3d
commit
49214747cd
4 changed files with 45 additions and 9 deletions
|
@ -46,11 +46,19 @@ template(name="globalSearch")
|
|||
h1 Debug
|
||||
if debug.get.showSelector
|
||||
h2 Selector
|
||||
pre
|
||||
button.js-copy-debug-selector
|
||||
= 'Copy'
|
||||
pre(
|
||||
id="debug-selector"
|
||||
)
|
||||
= sessionData.selector
|
||||
if debug.get.showProjection
|
||||
h2 Projection
|
||||
pre
|
||||
button.js-copy-debug-projection
|
||||
= 'Copy'
|
||||
pre(
|
||||
id="debug-projection"
|
||||
)
|
||||
= sessionData.projection
|
||||
if searching.get
|
||||
+spinner
|
||||
|
|
|
@ -222,6 +222,30 @@ class GlobalSearchComponent extends CardSearchPagedComponent {
|
|||
);
|
||||
document.getElementById('global-search-input').focus();
|
||||
},
|
||||
'click .js-copy-debug-selector'(evt) {
|
||||
/* Get the text field */
|
||||
const selector = document.getElementById("debug-selector");
|
||||
|
||||
try {
|
||||
navigator.clipboard.writeText(selector.textContent);
|
||||
alert("Selector copied to clipboard");
|
||||
} catch(err) {
|
||||
alert("Error copying text: " + err);
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-copy-debug-projection'(evt) {
|
||||
/* Get the text field */
|
||||
const projection = document.getElementById("debug-projection");
|
||||
|
||||
try {
|
||||
navigator.clipboard.writeText(projection.textContent);
|
||||
alert("Projection copied to clipboard");
|
||||
} catch(err) {
|
||||
alert("Error copying text: " + err);
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-board-title'(evt) {
|
||||
evt.preventDefault();
|
||||
const input = document.getElementById('global-search-input');
|
||||
|
|
|
@ -114,11 +114,14 @@ export class QueryParams {
|
|||
}
|
||||
|
||||
getPredicate(operator) {
|
||||
if (typeof this.params[operator] === 'object') {
|
||||
return this.params[operator][0];
|
||||
} else {
|
||||
return this.params[operator];
|
||||
if (this.hasOperator(operator)){
|
||||
if (typeof this.params[operator] === 'object') {
|
||||
return this.params[operator][0];
|
||||
} else {
|
||||
return this.params[operator];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
getPredicates(operator) {
|
||||
|
|
|
@ -16,7 +16,8 @@ import {
|
|||
OPERATOR_BOARD,
|
||||
OPERATOR_COMMENT,
|
||||
OPERATOR_CREATED_AT,
|
||||
OPERATOR_CREATOR, OPERATOR_DEBUG,
|
||||
OPERATOR_CREATOR,
|
||||
OPERATOR_DEBUG,
|
||||
OPERATOR_DUE,
|
||||
OPERATOR_HAS,
|
||||
OPERATOR_LABEL,
|
||||
|
@ -446,8 +447,8 @@ function buildSelector(queryParams) {
|
|||
{ _id: { $in: attachments.map(attach => attach.cardId) } },
|
||||
{ _id: { $in: comments.map(com => com.cardId) } },
|
||||
];
|
||||
if (queryParams.text == "false" || queryParams.text == "true") {
|
||||
cardsSelector.push({ customFields: { $elemMatch: { value: queryParams.text == "true" ? true : false } } } );
|
||||
if (queryParams.text === "false" || queryParams.text === "true") {
|
||||
cardsSelector.push({ customFields: { $elemMatch: { value: queryParams.text === "true" } } } );
|
||||
}
|
||||
selector.$and.push({ $or: cardsSelector });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue