Tower: upload ks_dashboard_ninja 18.0.1.1.7 (was 18.0.1.1.7, via marketplace)

This commit is contained in:
2026-05-07 12:17:21 +00:00
parent e50acbac83
commit fd62a75b51
583 changed files with 54977 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/** @odoo-module **/
import { ActionContainer } from "@web/webclient/actions/action_container";
import { patch } from "@web/core/utils/patch";
import { onPatched } from "@odoo/owl";
patch(ActionContainer.prototype,{
setup(){
super.setup();
onPatched( () => {
if(this?.env.services.menu.getCurrentApp?.()?.xmlid === "ks_dashboard_ninja.board_menu_root" || this.info?.componentProps?.action?.tag === 'ks_dashboard_ninja'){
if(!$('body').hasClass('ks_body_class'))
$('body').addClass('ks_body_class');
}
else if(this?.env.services.menu.getCurrentApp?.()?.xmlid !== "ks_dashboard_ninja.board_menu_root" || this.info?.componentProps?.action?.tag !== 'ks_dashboard_ninja'){
if($('body').hasClass('ks_body_class'))
$('body').removeClass('ks_body_class');
}
});
},
});

View File

@@ -0,0 +1,24 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
import { onMounted } from "@odoo/owl";
import { renderToString } from "@web/core/utils/render";
import { WarningDialog } from "@web/core/errors/error_dialogs";
patch(ConfirmationDialog.prototype,{
setup(){
super.setup();
onMounted( () => {
let modalBody = this.modalRef?.el?.querySelector('.modal-body');
if(modalBody && (this.env.services.menu?.getCurrentApp()?.xmlid === "ks_dashboard_ninja.board_menu_root" ||
this.env.services.action?.currentController?.action?.tag === 'ks_dashboard_ninja')){
modalBody.innerHTML = renderToString('ks_dashboard_ninja.ksConfirmationDialogBody', {
body: this.props.body,
title: this.props.title,
});
}
});
}
});

View File

@@ -0,0 +1,38 @@
/** @odoo-module */
import { patch } from "@web/core/utils/patch";
import { FileUploader } from "@web/views/fields/file_handler";
import { onMounted, useEffect } from "@odoo/owl";
import { renderToString } from "@web/core/utils/render";
patch(FileUploader.prototype,{
setup() {
super.setup();
useEffect(
() => this.changeIcons()
);
},
changeIcons(){
let ks_upload_parent_field_el = this.fileInputRef?.el?.closest('.upload-file-btn');
if(ks_upload_parent_field_el){
let pencil_icon_btn = ks_upload_parent_field_el.querySelector('.fa-pencil');
let fileUploadIcon = ks_upload_parent_field_el.querySelector('.o_select_file_button.btn-primary');
let download_icon_btn = ks_upload_parent_field_el.querySelector('.fa-download');
let trash_icon_btn = ks_upload_parent_field_el.querySelector('.fa-trash');
if(pencil_icon_btn){
pencil_icon_btn.classList.remove('fa', 'fa-pencil');
pencil_icon_btn.innerHTML += renderToString("ks_dashboard_ninja.edit_svg", {})
}
if(download_icon_btn){
download_icon_btn.classList.remove('fa', 'fa-download')
download_icon_btn.innerHTML += renderToString("ks_dashboard_ninja.download_svg", {})
}
if(trash_icon_btn){
trash_icon_btn.classList.remove('fa', 'fa-trash')
trash_icon_btn.innerHTML += renderToString("ks_dashboard_ninja.trash_svg", {})
}
}
},
});

View File

@@ -0,0 +1,25 @@
import { patch } from "@web/core/utils/patch";
import { FormViewDialog } from '@web/views/view_dialogs/form_view_dialog';
import { onMounted } from "@odoo/owl";
patch(FormViewDialog.prototype,{
setup(){
super.setup();
onMounted(()=>{
if(this.props.is_expand_icon_visible){
let expand_icon = this.modalRef.el?.querySelector('.o_expand_button')
expand_icon?.remove?.()
}
});
},
async onExpand(){
if(this.props.is_expand_icon_visible) return;
super.onExpand();
}
});
FormViewDialog.props = {
...FormViewDialog.props,
is_expand_icon_visible : { type: Boolean, optional: true }
}

View File

@@ -0,0 +1,24 @@
import { patch } from "@web/core/utils/patch";
import { FormController } from "@web/views/form/form_controller";
import { eraseAllCookies } from '@ks_dashboard_ninja/js/ks_global_functions';
patch(FormController.prototype,{
async onRecordSaved(record, changes){
if(this.model?.config?.resModel === 'ks_dashboard_ninja.board' && this.model.config.resId){
let field_names = ['ks_dashboard_custom_filters_ids', 'ks_dashboard_defined_filters_ids', 'ks_date_filter_selection',
'ks_default_end_time', 'ks_dashboard_start_date', 'ks_dashboard_end_date']
let is_dn_cookie_related_field_changes = field_names.some(field_name => changes.hasOwnProperty(field_name));
if(is_dn_cookie_related_field_changes)
eraseAllCookies(this.model.config.resId,
['PFilter', 'PFilterDataObj', 'Filter', 'CFilter', 'FilterDateData', 'ChartFilter', 'FFilter']);
// TODO : Apply such functionlity that we donot have to give name of the name of the filter as string to erase cookies Also dont need to remove all cookies"
}
super.onRecordSaved(record, changes);
}
});

View File

@@ -0,0 +1,16 @@
import { patch } from "@web/core/utils/patch";
import { onMounted, useRef } from "@odoo/owl";
import { FormLabel } from "@web/views/form/form_label";
patch(FormLabel.prototype,{
setup(){
this.ksRootRef = useRef("ksRootRef");
onMounted(()=>{
let tooltip = this.ksRootRef.el?.querySelector('.text-info')
if(tooltip && (this.env.model?.config?.resModel.startsWith('ks_dashboard_ninja.' ||
this.env.services.action?.currentController?.action?.tag === 'ks_dashboard_ninja')))
tooltip.innerHTML = '<i class="fa fa-exclamation-circle" aria-hidden="true"></i>'
});
}
});

View File

@@ -0,0 +1,36 @@
.ks_body_class .o_spinner {
padding: 50px;
position: relative;
text-align: center;
img{
display : none;
}
}
.ks_body_class .o_spinner:before {
content: "";
height: 105px;
width: 105px;
margin: -38px auto auto -23px;
position: absolute;
top: 50%;
left: 50%;
border-radius: 100%;
animation: rotation .9s infinite linear;
background: conic-gradient(from 180deg at 50% 50%, #E84A5F 0deg, rgba(232, 74, 95, 0) 360deg);
mask: radial-gradient(circle, transparent 50%, black 51%);
-webkit-mask: radial-gradient(circle, transparent 50%, black 51%);
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
.ks_body_class .o_blockUI {
z-index: 1055 !important;
}

View File

@@ -0,0 +1,80 @@
/** @odoo-module **/
import { LoadingIndicator } from "@web/webclient/loading_indicator/loading_indicator";
import { patch } from "@web/core/utils/patch";
import { browser } from "@web/core/browser/browser";
import { useService } from "@web/core/utils/hooks";
import { BlockUI } from "@web/core/ui/block_ui";
import { useEffect, useRef, xml } from "@odoo/owl";
patch(LoadingIndicator.prototype, {
setup() {
super.setup();
this.shouldBlock = false;
},
requestCall({ detail }) {
if (detail.settings.silent) {
return;
}
if (this.state.count === 0) {
browser.clearTimeout(this.startShowTimer);
this.startShowTimer = browser.setTimeout(() => {
if (this.state.count) {
this.state.show = true;
let ks_active_el = this.env.services.ui.activeElement.querySelector('.chat-ai-box')?.length
if((!ks_active_el) &&( this.env.services.menu?.getCurrentApp()?.xmlid === "ks_dashboard_ninja.board_menu_root" ||
this.env.services.action.currentController?.action?.tag === 'ks_dashboard_ninja' )){
this.blockUITimer = browser.setTimeout(() => {
this.env.services.ui.block();
this.shouldBlock = true;
}, 3000);
}
}
}, 250);
}
this.rpcIds.add(detail.data.id);
this.state.count++;
},
responseCall({ detail }) {
if(this.blockUITimer){
clearTimeout(this.blockUITimer)
if(this.shouldBlock){
this.env.services.ui.unblock();
this.shouldBlock = false;
}
}
if (detail.settings.silent) {
return;
}
this.rpcIds.delete(detail.data.id);
this.state.count = this.rpcIds.size;
if (this.state.count === 0) {
browser.clearTimeout(this.startShowTimer);
this.state.show = false;
}
}
});
//patch(BlockUI.prototype, {
// setup(){
// super.setup();
// this.menuService = useService('menu');
//
// useEffect( () => {
// let spinnerImg = document.querySelector('.o_blockUI .o_spinner img');
// if(spinnerImg && spinnerImg.src){
// spinnerImg.src = "/web/static/img/spin.svg"
// }
// let currentApp = this.menuService?.getCurrentApp();
// if (currentApp && currentApp.xmlid === "ks_dashboard_ninja.board_menu_root"){
// if(spinnerImg && spinnerImg.src){
// spinnerImg.src = "/ks_dashboard_ninja/static/images/loader.gif"
// }
// }
// });
// }
//});

View File

@@ -0,0 +1,25 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { NavBar } from "@web/webclient/navbar/navbar";
patch(NavBar.prototype,{
async adapt(){
if(this.currentApp?.xmlid === "ks_dashboard_ninja.board_menu_root" || this.actionService?.currentController?.action.tag === 'ks_dashboard_ninja'){
if(!$('body').hasClass('ks_body_class'))
$('body').addClass('ks_body_class');
}
else{
if($('body').hasClass('ks_body_class'))
$('body').removeClass('ks_body_class');
}
return super.adapt();
},
});

View File

@@ -0,0 +1,94 @@
.ks_body_class .o_notification_manager {
position: fixed !important;
left: 0 !important;
right: 0 !important;
margin: 0 auto !important;
width: 50% !important;
top: 30px !important;
.o_notification_title {
font-size: $font-18 !important;
font-weight: $f-w-600 !important;
line-height: 25.2px;
text-align: left;
padding: 0 8px !important;
align-self: end;
}
.o_notification_body {
padding: 0 8px !important;
margin-top: 4px !important;
grid-column: 2 / 3;
}
.o_notification_close {
top: 50% !important;
left: auto;
bottom: auto;
right: 20px !important;
transform: translateY(-50%);
border: 1px solid $color-black !important;
border-radius: 50% !important;
height: 29px !important;
width: 29px !important;
display: flex !important;
justify-content: center !important;
align-items: center !important;
margin: 0 !important;
}
.border {
border: none !important;
}
.o_notification_content {
font-size: $font-16 !important;
font-weight: $f-w-400 !important;
line-height: 22.4px;
text-align: left;
color: $color-4B5563 !important;
padding-right: 20px;
ul {
padding-left: 0px !important;
display: flex;
align-items: center;
margin-bottom: 0;
flex-wrap: wrap;
li {
list-style: none !important;
&::after {
content: ",\00a0";
}
&:last-child::after {
content: "";
}
}
}
}
.o_notification {
border-radius: 10px !important;
padding: 20px !important;
background-color: $color-white !important;
border: none !important;
border: 3px solid $color-E5E7EB !important;
min-height: 107px;
// display: flex;
// flex-direction: column;
justify-content: center;
display: grid;
width: 100%;
grid-template-columns: 1.4fr 8fr;
grid-template-rows: 1fr;
align-items: center;
svg {
grid-row: 1 / 3;
}
}
}

View File

@@ -0,0 +1,42 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { onMounted, useRef, onWillUnmount } from "@odoo/owl";
import { Notification } from "@web/core/notifications/notification";
import { renderToElement } from "@web/core/utils/render";
patch(Notification.prototype,{
setup(){
super.setup();
this.notificationRef = useRef('notificationRef');
onMounted( () => {
let notificationContainer = this.notificationRef.el ? [this.notificationRef.el] : document.querySelectorAll('.o-main-components-container .o_notification');
if( (this.props.ks_dn_flag && notificationContainer) || (notificationContainer && (this.env.services.menu?.getCurrentApp()?.xmlid === "ks_dashboard_ninja.board_menu_root" ||
this.env.services.action?.currentController?.action?.tag === 'ks_dashboard_ninja'))){
let image = renderToElement('ks_dashboard_ninja.ksNotificationImage', {
type: this.props.type ,
});
notificationContainer.forEach((notification) => {
notification.parentElement.classList.add('ks-dn-website-notification');
notification.prepend(image);
})
}
});
onWillUnmount(() => {
let notificationContainer = this.notificationRef.el ? [this.notificationRef.el] : document.querySelectorAll('.o-main-components-container .o_notification');
if(notificationContainer){
notificationContainer.forEach((notification) => {
notification.parentElement.classList.remove('ks-dn-website-notification');
})
}
});
}
});
Notification.props = {
...Notification.props,
ks_dn_flag: { type: Boolean, optional: true },
};

View File

@@ -0,0 +1,24 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
import { onMounted } from "@odoo/owl";
import { renderToString } from "@web/core/utils/render";
import { WarningDialog } from "@web/core/errors/error_dialogs";
patch(WarningDialog.prototype,{
setup(){
super.setup();
onMounted( () => {
let modalBody = this.env.services.ui.activeElement?.querySelector('.modal-body');
this.env.services.ui.activeElement?.querySelector('.modal-content')?.classList?.add('error-modal-ks');
if(modalBody && (this.env.services.menu?.getCurrentApp()?.xmlid === "ks_dashboard_ninja.board_menu_root" ||
this.env.services.action?.currentController?.action?.tag === 'ks_dashboard_ninja')){
modalBody.innerHTML = renderToString('ks_dashboard_ninja.ksAccessErrorDialog', {
message: this.message ,
});
}
});
}
});