feat: update tool-chain to latest (#7975)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Shivam Mishra
2023-09-27 14:02:34 +05:30
committed by GitHub
parent e8b7e791a5
commit a88d155dd7
162 changed files with 3566 additions and 2884 deletions

View File

@@ -10,6 +10,7 @@ export const getAudioContext = () => {
return audioCtx;
};
// eslint-disable-next-line default-param-last
export const getAlertAudio = async (baseUrl = '', requestContext) => {
const audioCtx = getAudioContext();
const playSound = audioBuffer => {
@@ -33,6 +34,7 @@ export const getAlertAudio = async (baseUrl = '', requestContext) => {
.then(response => response.arrayBuffer())
.then(buffer => {
audioCtx.decodeAudioData(buffer).then(playSound);
// eslint-disable-next-line no-promise-executor-return
return new Promise(res => res());
})
.catch(() => {

View File

@@ -72,8 +72,10 @@ class BaseActionCableConnector {
}, RECONNECT_INTERVAL);
};
// eslint-disable-next-line class-methods-use-this
onReconnect = () => {};
// eslint-disable-next-line class-methods-use-this
onDisconnected = () => {};
disconnect() {

View File

@@ -7,7 +7,7 @@ export const formatBytes = (bytes, decimals = 2) => {
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
return parseFloat((bytes / k ** i).toFixed(dm)) + ' ' + sizes[i];
};
export const fileSizeInMegaBytes = bytes => {

View File

@@ -89,38 +89,38 @@ describe('groupHeatmapByDay', () => {
expect(groupHeatmapByDay(heatmapData)).toMatchInlineSnapshot(`
Map {
"2021-02-25T00:00:00.000Z" => Array [
Object {
"2021-02-25T00:00:00.000Z" => [
{
"date": 2021-02-25T15:00:00.000Z,
"hour": 15,
"timestamp": 1614265200,
"value": 10,
},
],
"2021-02-26T00:00:00.000Z" => Array [
Object {
"2021-02-26T00:00:00.000Z" => [
{
"date": 2021-02-26T03:00:00.000Z,
"hour": 3,
"timestamp": 1614308400,
"value": 20,
},
],
"2021-02-27T00:00:00.000Z" => Array [
Object {
"2021-02-27T00:00:00.000Z" => [
{
"date": 2021-02-27T01:00:00.000Z,
"hour": 1,
"timestamp": 1614387600,
"value": 30,
},
Object {
{
"date": 2021-02-27T13:00:00.000Z,
"hour": 13,
"timestamp": 1614430800,
"value": 40,
},
],
"2021-02-28T00:00:00.000Z" => Array [
Object {
"2021-02-28T00:00:00.000Z" => [
{
"date": 2021-02-28T08:00:00.000Z,
"hour": 8,
"timestamp": 1614499200,
@@ -145,14 +145,14 @@ describe('groupHeatmapByDay', () => {
expect(groupHeatmapByDay(heatmapData)).toMatchInlineSnapshot(`
Map {
"2021-02-25T00:00:00.000Z" => Array [
Object {
"2021-02-25T00:00:00.000Z" => [
{
"date": 2021-02-25T15:00:00.000Z,
"hour": 15,
"timestamp": 1614265200,
"value": 10,
},
Object {
{
"date": 2021-02-25T15:00:00.000Z,
"hour": 15,
"timestamp": 1614265200,