Skip to content

Commit

Permalink
silence some console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Nov 16, 2023
1 parent bf98945 commit 034d4a1
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 61 deletions.
2 changes: 0 additions & 2 deletions app/frontend/components/content_renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { post } from '@rails/request.js'

export default class Controller extends BaseController {
initialize() {
console.log('ajajajaja')
this.sendData()
}

Expand All @@ -24,7 +23,6 @@ export default class Controller extends BaseController {
if (response.ok) {
const body = await response.html
this.element.closest('.definition-renderer').outerHTML = body
console.log('response!')
}
}
}
1 change: 0 additions & 1 deletion app/frontend/components/conversation_part/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default class Controller extends BaseController {
: themeDark
: theme*/

console.log("MADAFAKASS")
/*render(
<ThemeProvider theme={messageForTheme}>
<EditorContainerMessageBubble>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EditorContainerMessageBubble = styled(EditorContainer)`

export default class Controller extends BaseController {
connect() {
console.log("AAAAA")
console.log("ASK OPTION")
}
disconnect() {
console.log("disconnected ask option")
Expand Down
10 changes: 1 addition & 9 deletions app/frontend/components/definition_renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ export default class Controller extends BaseController {
disconnect() {}

onSubmit(e) {
console.log('PReventinf default on definition form submit')
// console.log('PReventinf default on definition form submit')
e.preventDefault()
}


// from buttons
async sendForm(e) {
console.log('SEND FORM', e)
e.preventDefault()

let formData = serialize(this.formTarget, { hash: true, empty: true })
Expand Down Expand Up @@ -60,14 +59,12 @@ export default class Controller extends BaseController {
const bodyHtml = await response.html
// custom event que será leido por modal controller
this.element.outerHTML = bodyHtml
console.log('response!')
}
}
}

openUrl(e){
const data = JSON.parse(e.currentTarget.dataset.fieldJson)
console.log("URL", data.action.url)
const url = data?.action?.url
if(!url) return
window.open(url, '_blank')
Expand Down Expand Up @@ -122,19 +119,14 @@ export default class Controller extends BaseController {
const kk = this.formTarget.dataset.kind || field.action.type
data.url = data.ctx?.field?.action?.url

console.log("VISIT FRAME", kk, data)

if(this.chatMessengerController){
console.log("MESSENGER CONTRIKER", this.chatMessengerController)
this.chatMessengerController.goToAppPackageFrame(data)
}
}

openContent(e){
e.preventDefault()
const json = JSON.parse(e.currentTarget.dataset.fieldJson)
console.log("OPEN CONTENT", json)

this.sendForm(e)

}
Expand Down
11 changes: 6 additions & 5 deletions app/frontend/components/frame_renderer/component.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

<div class="frame-wrapper">
<iframe
id="package-frame"
allow="autoplay; camera; microphone; fullscreen; speaker; display-capture"
src=<%= @url %>
></iframe>
<% # Time.now %>
<iframe
id="package-frame"
allow="autoplay; camera; microphone; fullscreen; speaker; display-capture"
src=<%= @url %>
></iframe>
</div>


23 changes: 3 additions & 20 deletions app/javascript/controllers/chat_editor_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,21 @@ export default class extends Controller {
];

handleAppFunc() {
console.log('open app moadl');
const url = this.element.dataset.capabilities;
this.sendPost(url, {}, 'get');
}

handleBotFunc() {
console.log('open bot moadl');
const url = this.element.dataset.botTasks;
this.sendPost(url, {}, 'get');
}

handleQuickRepliesFunc() {
console.log('open quick moadl');
const url = this.element.dataset.quickReplies;
this.sendPost(url, {}, 'get');
}

insertResource(data) {
console.log('INSERT HERE THE THING', data);
document.querySelector('#modal').innerHTML = '';

switch (data.type) {
Expand Down Expand Up @@ -168,7 +164,7 @@ export default class extends Controller {
}

if (response.ok) {
console.log('HEY HET HEY');
console.log('ok saved');
}
}

Expand All @@ -187,8 +183,6 @@ export default class extends Controller {
}

typingNotifier() {
console.log('NOTIFY TYPING');

clearTimeout(this.delayTimer);
this.delayTimer = setTimeout(() => {
this.notifyTyping();
Expand Down Expand Up @@ -219,7 +213,6 @@ export default class extends Controller {
this.actionPath = this.element.dataset.editorActionPath;
this.messageMode = 'public';

console.log('INIT EDITOR FOR', this.actionPath);
const root = createRoot(this.wrapperTarget);

root.render(
Expand All @@ -234,15 +227,13 @@ export default class extends Controller {
notifyValue={(val, editorRef) => {
this.valueNotified = val;
this.editorRef = editorRef;
console.log(this.valueNotified);
this.typingNotifier();
}}
handleReturn={(e, isEmptyDraft, value) => {
console.log(e);
try {
console.log(
/*console.log(
e.currentTarget.pmViewDesc.node.content.content[0].attrs.blockKind
);
);*/
const blockKind =
e.currentTarget.pmViewDesc?.node?.content?.content[0]?.attrs
?.blockKind?.name;
Expand Down Expand Up @@ -445,8 +436,6 @@ function EditorComponent({
options: {
upload_handler: (file, ctx) => {
upload(file, (blob) => {
console.log(blob);
console.log(ctx);
ctx.updateAttributes({
url: blob.service_url,
});
Expand Down Expand Up @@ -540,11 +529,7 @@ function EditorComponent({
),
options: {
upload_handler: (file, ctx) => {
console.log('UPLOADED VIDEO FILE!!!!', file);

upload(file, (blob) => {
console.log(blob);
console.log(ctx);
ctx.updateAttributes({
url: blob.service_url,
});
Expand Down Expand Up @@ -598,7 +583,6 @@ function EditorComponent({
}, []);

function manageReturn(event) {
console.log('handle return');
console.log(valRef.current);
return handleReturn(event, false, valRef.current);
}
Expand Down Expand Up @@ -652,7 +636,6 @@ function EditorComponent({
}}
onUpdate={(editor) => {
editorRef.current = editor;
console.log('AAAAAA SE SALVOOOOO');
setValue({
serialized: editor.getJSON(),
html: editor.view.dom.innerText,
Expand Down
1 change: 0 additions & 1 deletion app/javascript/controllers/color_picker_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default class extends Controller {
}

colorHandler(e) {
console.log('HANDLED', e);
this.inputTarget.value = e;

this.resolveSrc();
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/controllers/conversation_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export default class extends Controller {
}

toggleSidebar() {
console.log('TOGGLE!!!!');

const sidebar = document.getElementById('conversation-sidebar');
//sidebar.classList.toggle('hidden')
sidebar.classList.toggle('sm:block');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
static targets = ['content'];

connect() {
console.log('inserter loaded!!');
}

insert(e) {
e.preventDefault();
let editorElement = document.querySelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class extends Controller {
initialize() {
const dataset = this.element.dataset;
// console.log(new Date().toUTCString());
console.log('Listening for notifications', this.element.dataset);
// console.log('Listening for notifications', this.element.dataset);
//this.pling = new Audio('/sounds/BLIB.wav');

if (dataset.read !== 'true') {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/controllers/dante_editor_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class extends Controller {
theme = this.element.dataset.theme;
}

console.log(serializedContent);
// console.log(serializedContent);

const root = createRoot(this.containerTarget);

Expand Down
15 changes: 5 additions & 10 deletions app/javascript/new_embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ window.Chaskiq = window.Chaskiq || {
this.ping();
this.addStyle();
this.setup((data) => {
console.log(data);
this.userData = data;
this.banner = null;
this.inline_conversations = data.inline_conversations;
Expand Down Expand Up @@ -596,7 +595,7 @@ window.Chaskiq = window.Chaskiq || {
this.tabId = Math.random() + '';
},
storeTabIdToLocalStorage: function () {
console.log('STORING TAB', this.tabId);
// console.log('STORING TAB', this.tabId);
window.localStorage.setItem('chaskiqTabId', this.tabId);
},

Expand All @@ -606,10 +605,10 @@ window.Chaskiq = window.Chaskiq || {
const onVisibilityChange = () => {
this.isVisible = getIsDocumentHidden();
if (this.isVisible) {
console.log('STORED TAB', this.isVisible);
// console.log('STORED TAB', this.isVisible);
this.storeTabIdToLocalStorage();
}
console.log('VISIBILITY CHANGED', this.isVisible);
// console.log('VISIBILITY CHANGED', this.isVisible);
};

this.visibilityChange = getBrowserVisibilityProp();
Expand Down Expand Up @@ -678,7 +677,7 @@ window.Chaskiq = window.Chaskiq || {
break;
default:
if (event.data.tourManagerEnabled) {
console.log('TOUR MANAGER INIT EVENT!', event);
// console.log('TOUR MANAGER INIT EVENT!', event);
this.deployTourManager(() => {
this.tourManager = new TourManager({ ...event.data, ev: event });
});
Expand All @@ -687,7 +686,6 @@ window.Chaskiq = window.Chaskiq || {
}
};

console.log('LISTENING EVENTS ON FRAME EVENTS');
window.addEventListener('message', this.frameEvents.bind(this));
},

Expand All @@ -710,7 +708,7 @@ window.Chaskiq = window.Chaskiq || {
},

handleTourEditor: function (data) {
console.log('RECIVED EVENT FROM TOUR EDITOR, SENDING TO TOURMANAGER', data);
// console.log('RECIVED EVENT FROM TOUR EDITOR, SENDING TO TOURMANAGER', data);
this.tourManager.pushEvent(data);
},

Expand Down Expand Up @@ -762,10 +760,8 @@ window.Chaskiq = window.Chaskiq || {
},

handleFrameEvents: function (data) {
console.log(data);
switch (data.type) {
case 'conversations:unreads':
console.log('COUNTER RECEIVED', data.data.value);
this.updateCounters(data.data.value);
break;
case 'messenger:toggle':
Expand Down Expand Up @@ -833,7 +829,6 @@ window.Chaskiq = window.Chaskiq || {
os_version: results.os.version,
os: results.os.name,
};
console.log('PUSH EVENT HERE', data);
this.pushEvent('messenger:register_visit', data);
},

Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
<!-- Add CodeMirror script from CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.4/codemirror.min.js" data-turbo-track="reload"></script>
<meta name="turbo-refresh-method" content="morph">
<meta name="turbo-refresh-scroll" content="preserve">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@emotion/styled": "^11.10.6",
"@headlessui/react": "^1.5.0",
"@hotwired/stimulus": "^3.2.1",
"@hotwired/turbo": "git+https://github.com/michelson/turbo.git#build",
"@hotwired/turbo": "git+https://github.com/michelson/turbo.git#build4",
"@hotwired/turbo-rails": "^7.3.0",
"@medv/finder": "^2.1.0",
"@nivo/calendar": "^0.79.0",
Expand Down Expand Up @@ -164,7 +164,7 @@
"path": "path-browserify"
},
"resolutions": {
"@hotwired/turbo": "git+https://github.com/michelson/turbo.git#build"
"@hotwired/turbo": "git+https://github.com/michelson/turbo.git#build4"
},
"scripts": {
"format:js": "npx eslint --silent --fix ./app/javascript",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1690,9 +1690,9 @@
"@hotwired/turbo" "^7.3.0"
"@rails/actioncable" "^7.0"

"@hotwired/turbo@^7.3.0", "@hotwired/turbo@git+https://github.com/michelson/turbo.git#build":
"@hotwired/turbo@^7.3.0", "@hotwired/turbo@git+https://github.com/michelson/turbo.git#build4":
version "7.3.0"
resolved "git+https://github.com/michelson/turbo.git#ba7d99766bfd7bbcd29c2b5d429bce7dd286827a"
resolved "git+https://github.com/michelson/turbo.git#f25b133c147141aea9848879c7317850a7fc2a36"

"@humanwhocodes/config-array@^0.5.0":
version "0.5.0"
Expand Down

0 comments on commit 034d4a1

Please sign in to comment.