Why the sort method not working in the parent component?

This is the first project for me in VueJS.
I have a product list and want to sort it by price. I built two components and tried to pass a sort method to the parent from the child component (dropdown button) by emitting an event. but after a lot of attempts, I can’t find the wrong with my code, any help!

This Child Component:

<template>
  <div class="dropdown">
    <button
      @click="toggleShow(); $emit('sortPrice')"
      class="dropbtn"
    >
      {{ title }}
      <span class="material-icons-outlined"> {{ icon }} </span>
    </button>

    <div v-if="showMenu" class="menu">
      <div class="menu-item" v-for="(item, index) in this.items" :key="index">
        {{ item }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Dropdown-menu",

  props: {
    title: String,
    icon: String,
    items: {
      type: Object,
      required: true,
    },
  },

  data() {
    return {
      showMenu: false
    };
  },

  methods: {
    toggleShow: function () {
      this.showMenu = !this.showMenu;
    },

    sortPrice: function () {
      this.$emit("sort", this.sortPrice);
    },
  },
};
</script>

This Parent Component:

<template>
    <dropdown
          :title="sortedBy"
          :items="arrangements"
          :icon="material_icons"
          @sort="sortByPrice"
    ></dropdown>
</template>

<script>
import Dropdown from "@/components/Dropdown.vue";

export default {
  components: {
    Dropdown,
  },

  data() {
    return {
      sortedBy: "Featured",
      arrangements: ["Featured", "Lowest", "Highest"],
      material_icons: "expand_more",
      productData: require("@/data/store-data.json"),
    };
  },
  methods: {
    sortByPrice: function () {
      let realProducts = this.productData.products;
      let sortedProducts = realProducts.sort((a, b) => {
        if (this.sortedBy === "Highest") {
          return b.price - a.price;
        } else if (this.sortedBy === "Lowest") {
          return a.price - b.price;
        }
      });
      return sortedProducts;
    },
  },
};
</script>

headless mode playwright not working as inteded

hi I have a problem with my code, when I start my scraping code with playwright on headless mode: true when I reach a waitfornavitagion for a log in the program stops working and I don’t know why cause when I start it in headless mode: false; I reach my final destination without errors.
here is my code:

function ashScraping() {
  (async () => {
    const browser = await chromium.launch({
      headless: false,
      slowmo: 300,
      timeout: 70000,
      acceptDownloads: true,
    });
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto('https://www.thePageImUsing.com/login');
    await page.locator('input[name="txtUserID"]').click();
    await page.locator('input[name="txtUserID"]').fill(`${user}`);
    await page.locator('input[name="txtPassword"]').click();
    await page.locator('input[name="txtPassword"]').fill(`${cont}`);
    await Promise.all([
      page.waitForNavigation(/*{ url: 'https://home.thePageImUsing.com' }*/),
      page.locator('text=login').click()
    ]);
    const [page1] = await Promise.all([
      page.waitForEvent('popup'),
      page.locator('something..something').click()
    ]);
    await page1.locator('input[name="txtShpno"]').click();
    await page1.locator('input[name="txtShpno"]').fill(`${bodega}`);
    await page1.locator('input:has-text("Buscar")').click();
    await Promise.all([
      page.waitForNavigation(/*{ url: 'home.thePageImUsing.com' }*/),
    ]);
    await page.locator('text=Artículos').click();
    await page.locator('text=Artículos').click();
    await page.locator('text=Artículos').click();
    await page.locator('text=Programa de clientes').click();
    await page.locator('#rdoWarehouse_0').check();
    await page.locator('#rdoAvailability_2').check();
    const [download] = await Promise.all([
      page.waitForEvent('download'),
      page.on('dialog', dialog => dialog.accept()),
      await page.locator('#cmdExport').click(),
    ]);
    const path = download.suggestedFilename();
    await download.saveAs(path);
    await context.close();
    await browser.close();
  })();
};

ashScraping();

so I modified some parts of the code for privacy reasons, but the context it’s the same. I would welcome any answers that could point me to the error.

right now when I start the software in headless mode: true this is the error:

line 23: waitfornavigation: timeout.

React native Jest- navigation.setOptions

I’m not able to test a react-native screen that should render a headerRight icon on navigation setOptions is being called in the constructor
I have a react native code for which I have

this.props.navigation.setOptions({
      title: this.props.t("Team"),
      headerRight: () => {
        console.log("header right>>")
        return(
        <View style={{ flex: 1, flexDirection: "row", paddingRight: 10 }}>
          <HeaderIcon
            testID= {"search-icon"}
            onPress={() => {
              this.setState({
                showSearch: true,
              });
            }}
            iconName={"search"}
          />
          <HeaderIcon
            onPress={() => {
              props.navigation.navigate("AccessManagerNewUser");
            }}
            iconName={"person-add"}
          />
        </View>
      )},
    });

My class-based component is setting headerRight with this navigation function. My Jest test has the below as navigation props.

 navigation: {
    addListener: jest.fn(),
    setOptions: () => {},
    navigate: jest.fn(),
  },

This is never calling the headerRight method when I’m running my tests

how can i make this page scale up and down or responsive

how can I just make the whole website smaller and bigger depending on the screen size, don’t need to remove any div or anything just like scale up and down. Also I don’t need mobile support, only on laptop/desktop.

Btw I couldn’t post the code in stack because its to big, and not asking for you to do it just asking some tips on how I could do it.

I am making a ping pong command and i am getting a error code

Im making a bot and im getting a error code heres the code

const { Client, Intents } = require('discord.js');
const settings = require('./settings.json');

const client = new Client({
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES
    ]
});

Client.on('message', msg => { // Message function
   if (msg.author.bot) return; // Ignore all bots
   if (msg.content.startsWith(settings.prefix)) return; // It always has to starts with the prefix which is '!'

   if (msg.content.startsWith(settings.prefix + "ping")) { // When a player does '!ping'
     msg.reply("Pong!") // The bot will say @Author, Pong!
   }
});

Client.login(token);

This is the output

 ```throw new ERR_INVALID_ARG_TYPE('emitter', 'EventEmitter', emitter);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "emitter" argument must be an instance of EventEmitter. Received type string ('message')
    at new NodeError (node:internal/errors:372:5)
    at eventTargetAgnosticAddListener (node:events:1008:11)
    at Function.on (node:events:1095:3)
    at Object.<anonymous> (C:UsersyybrodiscordBotdex.js:11:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_INVALID_ARG_TYPE' ```

Can i get some help please it would be helpful thanks and i am new this is my first time doing this

TypeError in backend application

I am trying to configure a database for my flask react application
I have this code in my backend side:

api = Api(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://' +os.getenv("MYSQL_DATABASE_USE R") + ':' + os.getenv("MYSQL_DATABASE_PASSWORD") + '@' + os.getenv("MYSQL_DATABASE_HOST") + '/' + os.getenv("MYSQL_DATABASE_DB")
db = SQLAlchemy(app)

I am getting this error: TypeError: can only concatenate str (not “NoneType”) to str
I cant figure out how to fix it .
I appreciate any help

How to fix pagination first page load all data but onclick rest button load correctly in react

First part

const Inventory = () => {
  const [products, setProducts] = useState([]);
  const [pageCount,setPageCount] = useState(0);
  //console.log(pageCount);
  const [page,setPage] = useState(0);
  const navigate = useNavigate();



  useEffect(() => {
    fetch(`http://localhost:3000/products?page=${page}`)
      .then((res) => res.json())
      .then((data) => setProducts(data));
  }, [products,page]);

  useEffect(()=>{
    axios.get('http://localhost:3000/product-count')
   .then((res) => {
      const productCount = res?.data?.count;
     //console.log("count product",count);
     const pages = Math.ceil(productCount/6);
     setPageCount(pages);
   })
     
 },[page])

Return section
this code will return pagination

 <div className="pagination">
                {
                    [...Array(pageCount).keys()]
                    .map(number => <button key={number} className={page===number? 'selected': 'pagination'}
                      onClick={()=> setPage(number)}
                    >
                      {number+1}
                    </button>)
                  }
                  
         </div>

And this is server-side code

app.get("/products",async(req,res)=>{
        const page = parseInt(req.query.page);
        //console.log(page);
        const q = {};
        const cursor = productCollection.find(q);
        
        let result;
            if(page){
                 result = await cursor.skip(page * 6).limit(6).toArray();
            }
            else{
                result = await cursor.toArray();
            }
            res.send(result);
    })
// get product count
    app.get("/product-count",async(req,res)=>{
        const query = {};
        const count = await productCollection.countDocuments(query);
        res.json({count});
    })

I want to load 6 data on the first load. but when data loads it displays all data .but when I click the pagination button it works fine accept 1st button.

.Net 6 – Different session for each browser tab – diff images in each

I been having some major issues with this, I feel like this shouldn’t be so hard but..
I am trying to be able to open a link which brings pictures to the browser to display them. I have this working.
What I am trying to do is when someone opens another link itll open a new tab and they will have those new pictures in that tab and the previous pictures in the other tab. I tried to do this with Sessions but it overwrites the session, and both tabs show the same pics. I now coded it up so I have a different session guid for each tab and I go to try to view the pics but the same thing happens. The tab is over written.
My new idea is to save this huge text file in a hidden variable on the page and read from that. But when I do this my tempdata var says the page cannot be found but if I remove the tempdata var the page works…
I rewrote a bunch of methods some multiple times.
Any ways to make this work would be greatly appreciated

         public async Task<ActionResult> PopulateFileCache(string folderPath)
        {
            if (!string.IsNullOrEmpty(folderPath))
            {                
                using var client = _httpClient.CreateClient("MesserAPI");
                try
                {
                    using var response = await client.GetAsync($"/api/File/GetFolderFiles?folderPath={folderPath}");
                    if (response.IsSuccessStatusCode)
                    {
                        var lstFiles = await response.Content.ReadAsStringAsync();
                        ViewData["lstParts"] = lstFiles;

                        TempData["SlideTotal"] = 0;

                        if (_contextAccessor.HttpContext.Session.IsAvailable)
                        {
                            SaveToSession(lstFiles);
                        }
                        TempData["guid"] = _contextAccessor.HttpContext.Session.GetString("sGUID") ?? string.Empty;
                    }
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex.Message);
                }
            }
            return RedirectToAction("FileViewer");
        }


public IActionResult ReturnData(string sessionID)
        {
            //if (objFiles != null)
            //{
                if (TempData != null)
                {
                    TempData.Keep();
                }
                List<LNPartVM> lNParts = null;
                try
                {
                    //var jsonResponse = objFiles;
                    //var jsonResponse = GetFromSession();
                    var jsonResponse = GetFromSession(sessionID);
                    if (!string.IsNullOrWhiteSpace(jsonResponse))
                    {
                        lNParts = JsonSerializer.Deserialize<List<LNPartVM>>(jsonResponse);
                    }

                    if (lNParts?.Count > 0)
                    {
                        TempData["SlideTotal"] = lNParts.Count;
                        _contextAccessor.HttpContext.Session.SetInt32("SlideTotal", lNParts.Count);
                        int partIndex = 0;

                        try
                        {
                            partIndex = (int)(_contextAccessor.HttpContext.Session.GetInt32("PartIndex") == null ? 0 : _contextAccessor.HttpContext.Session.GetInt32("PartIndex"));
                        }
                        catch (Exception ex)
                        {
                            _logger.LogError(ex.Message);
                        }
                        LNPartVM partVM = lNParts[partIndex];
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex.Message);
                }
            //}
            return ViewComponent("DataPage");
        }
        public string GetSessionID()
        {
            return _contextAccessor.HttpContext.Session.Id;
        }
        public string GetSessionGUID()
        {
            return Guid.NewGuid().ToString();
        }
        //string sessionName,
        public IActionResult SaveToSession(string obj)
        {
            bool status = false;
            // Same Session across browsers
            //string sessionID = GetSessionID();
            string sessionID = GetSessionGUID();

            if (!string.IsNullOrWhiteSpace(sessionID))
            {
                _contextAccessor.HttpContext.Session.SetString(sessionID, obj);
                _contextAccessor.HttpContext.Session.SetString("sGUID", sessionID);
                status = true;
            }
            else
            {
                _contextAccessor.HttpContext.Session.SetString("SessionPN", obj);
                status |= true;
            }

            if (status)
            {
                return Content("Session Saved");
            }
            return Content("Session Error");
        }

  public async Task<IActionResult> FileViewer()
        {
            return View();
        }

This is on the HTML page

$('#btnNext').click(function (e) {
    e.preventDefault();

    console.log(iSlideCount);

    if (iSlideCount > 0) {
        $.ajax({
            type: 'GET',
            url: '@Url.Action("NextPart", "File")',
            contentType: 'Json'
        })
        .done(function(e) {
            var sguid = $("#txthguid").val();
            var route = '@Url.Action("ReturnData","File", new { sessionID="-1" })';
            route = route.replace("-1", sguid);
            $('#contentData').load(route);

            //$('#contentData').load('@Url.Action("ReturnData","File")');

            //$('#part').load('@Url.Action("ReturnData","File")');

How to solve: yarn package not found on CircleCi?

I have been trying to learn CircleCi workflows by building simple jobs and I keep getting this error:
/bin/bash: yarn: command not found.

So all the steps run but when it comes to the job is self it stops. So spin up environment, preparing env variables, checkout code, Restore Yarn Package Cache are green(successful).

My workflow below:


default-environment: &default-environment
  docker:
    - image: cimg/base:2020.01

step-restore-build-cache: &step-restore-build-cache
  restore_cache:
    name: Restore Yarn Package Cache
    keys:
      - yarn-packages-{{ checksum "yarn.lock" }}

step-save-build-cache: &step-save-build-cache
  save_cache:
    name: Save Yarn Package Cache
    key: yarn-packages-{{ checksum "yarn.lock" }}
    paths:
      - ~/.cache/yarn

step-run-cache: &step-run-cache
  run:
    name: Install Dependencies
    command: yarn install --immutable

version: 2.1
jobs:
  build:
    <<: *default-environment
    steps:
      - checkout
      - <<: *step-restore-build-cache
      - run:
          name: Build
          command: yarn run build
      - <<: *step-save-build-cache
  lint:
    <<: *default-environment
    steps:
      - checkout
      - <<: *step-restore-build-cache
      - run:
          name: Lint
          command: yarn run lint
  format:
    <<: *default-environment
    steps:
      - checkout
      - <<: *step-restore-build-cache
      - run:
          name: Format
          command: yarn run format
  type-check:
    <<: *default-environment
    steps:
      - checkout
      - <<: *step-restore-build-cache
      - run:
          name: Type-check
          command: yarn run type-check
workflows:
  version: 2
  build-and-lint:
    jobs:
      - build
      - lint
      - format
      - type-check

Not really sure how to fix this..

Thank you very much 🙂

HTML report from web application [closed]

I have created a small web application that consists of a single html file, a couple of js-files/modules, and a few datasets in json format.
Is there an easy and fast way to create an html-report from these files?
In my case, the html-report is a simple html file that includes some interactive plots which can be adapted by the user by some dropdown menus (calculations of new plots is done within the report).

So far I have generated the report by manually copying the data and javascript code into my html file. So basically instead of importing functions via I have manually copied all the code of all my modules and necessary data within a script tag in my html file.

Como executar um código JS na página usando o Cypress [closed]

Estou realizando alguns teste com cypress e cai no seguinte problema, preciso de executar um scrypt em JS direto na página que está aberta mas não sei exatamente como fazer isso utilizando o cypress

para critério de explicação existe como fazer isso usando o puppeteer, mas preciso disso utilizando Cypress

exemplo de código puppeteer

 await page.goto('https://google.com/recaptcha/api2/demo');
 page.evaluate(() => {document.getElementById('recaptcha-demo-submit').value = 'teste'
 },'teste'); ``` 

sabem como consigo executar esse mesmo código utilizando **cypress**? 

desde já obrigado.

Is it possible to execute more than one javascript in one script tag?

I am trying to run three different functions when the submit button is clicked before my form gets submitted;

Below are the functions I am trying to run with my javascript codes;

Click Submit button==>Shows An Alert==>Take Action On Alert to==>Show Loading Bar==>Then, Submit The Form and Redirect to the next url.

  1. Show An Alert (WORKING).

  2. Show Loading Bar (WORKING).

  3. Submit and Redirect (NOT WORKING).

See my sample code below

       /*THIS CODE SHOWS THE ALERT (WORKING)*/
       
document.querySelector('#theForm').addEventListener('submit', function(e) {
      var form = confirm;
      
      e.preventDefault();
      
      swal({
          title: "Please Confirm!",
          text: "Are you sure you want to continue?",
          icon: "warning",
          buttons: [
            'No, Cancle it!',
            'Yes, I accept!'
          ],
          dangerMode: true,
        }).then(function(isConfirm) {
          if (isConfirm) {
            
        /*THIS CODE SHOWS THE LOADING ICON (WORKING)*/
        
       var div = document.createElement("div");
        var img = document.createElement("img");
        // img.src = "";
        div.innerHTML = "<span style='color: white;  text-transform: uppercase; letter-spacing: 5px; font-size: 15px;'>SAVING</span><br/>  <img  src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoTaQ3jZMSSsQvJRcN7qvrEzdFbVCl6XiotnTroAox6-cjYrnJqtsFfZ3k94E5CULApvvl8z3EE_HAhqgAofLd5am4KvpNbEJZTL6-S6N24DjCxW_fBBGRguumQg_bSQVlQWDIcd0BFjXq8B0XAkLgX2qVCJ1xZCFjIIOKqjab8EbAe_aFgm94URoA/s1600/ezgif.com-gif-maker%20%283%29.gif" width="226px" height="22px">";
        div.style.cssText =
          "position: fixed; top: 50%; left: 50%; z-index: 5000; width: auto; text-align: center; background: #b51200; border: 2px solid #b51200;  border-radius: 7px; transform: translate(-50%,-50%)";
        // div.appendChild(img);
        document.body.appendChild(div);
  event.preventDefault();
        // These 2 lines cancel form submission, so only use if needed.
        //window.event.cancelBubble = true;
        //e.stopPropagation();
        
/*THIS CODE SUBMITS THE FORM AND THEN REDIRECTS TO THE NEXT URL (NOTHING HAPPENS AT THIS STAGE)*/
        
     window.addEventListener("load", function() {
  const form = document.getElementById('submitForm');
  form.addEventListener("submit", function(e) {
    e.preventDefault();
    const data = new FormData(form);
    const action = e.target.action;
    fetch(action, {
      method: 'POST',
      body: data,
    })
    .then(() => {
      window.location.href="https://www.google.com";
    })
  });
});
        
        } else {
            swal("Cancelled", "You canceled submission :)", "error");
          }
        });
    });
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" />
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  
<form action='' method='POST' runat="server" id="theForm"  onsubmit="return ShowLoading()">

 <input name='Name' placeholder='Full Name' required='' type='text'/>

<button href='/' type='submit' id="submitForm">Submit</button>
</form>

Page data from page-data.json for the failed page /calendar/

Hi i get this error when i deploy a project on gatsby cloud what suppose to be the problem?

When i run project on localhost i get no errors, everything works fine, so is it a problem with the cloud or should i change something in the whole project?

ERROR

Page data from page-data.json for the failed page /calendar/: {
“componentChunkName”: “component—src-pages-calendar-js”, “path”:
/calendar/, “result”: {
“pageContext”: {} }, “staticQueryHashes”: [
“2744905544” ] }

For more details see https://gatsby.dev/issue-how-to

Building static HTML failed for path /calendar/

For more details see https://gatsby.dev/debug-html

the code:

import React from "react"
import { GlobalStyle } from "../components/styles/GlobalStyles";
import HomeBar from "../components/HomeBar";
import Footer from "../components/Footer";
import styled from "styled-components";

import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";
import googleCalendarPlugin from '@fullcalendar/google-calendar';

// trzeba importować css do kazdego plugina manualnie
import "@fullcalendar/daygrid/main.css";
import "@fullcalendar/timegrid/main.css";




const BookingCalendar = () => {

 
  

  return ( 
    <>
    <GlobalStyle></GlobalStyle>
    <HomeBar></HomeBar>
  
       
         <CalendarContainer lightBg="true">
        <CalendarWrapper>
          <FullCalendar
              defaultView="dayGridMonth"
              header={{
                left: "today, prev,next",
                center: "title",
                right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek"
              }}
              plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin, googleCalendarPlugin]}
              googleCalendarApiKey='apikey'
              eventSources={[
                {
                        googleCalendarId:"id"
                      },
                ]}
            />
          </CalendarWrapper>
      </CalendarContainer>
  
  
  
  <Footer />
  </>
  )
};

const CalendarContainer = styled.div`
  color: #fff;
  background: ${({ lightBg }) => (lightBg ? "#0c0c0c" : "#010606")};

  @media screen and (max-width: 768px) {
    padding: 100px 0;
  }
`;

const CalendarWrapper = styled.div`
  display: grid;
  z-index: 1;
  height: 860px;
  width: 100%;
  max-width: 1100px;
  margin-right: auto;
  margin-left: auto;
  padding: 0 24px;
  justify-content: flex;
`;

export default BookingCalendar;

Get all the anchor points from text that is in tag and rendering them over it

I have run into a terrible P5.js problem.

So, I’ve been given a program that detects the movement of the user’s eyes via “createCapture” and processes them with a machine learning algorithm. The machine learning is in perfect shape and it is not a part of the problem at all. It searches for four different aspects of the user’s eye and stores them. Then there’s a

tag in the index.html, that is in its own next to the sketch, and has a bit of text in it. The four values derived from the machine learning algorithm affect the text’s oblique angle, letter spacing, vertical boldness (meaning that the boldness value does not affect the text horizontally), and lastly, size.

Now for the problem:

I need to render the vertices around the

tag’s text. I have tried textToPoints but it does not render the points in their proper positions nor does it account for the transformations that are applied by the CSS. I looked at opentype.js and it places the points properly, but it lacks the capability to apply the CSS values.

I have researched multiple approaches including using an algorithm that detects text on the screen and then places points that identify the glyph.

What I need is a way to take the

tag’s alignment, plain text, and CSS styles (slant, boldness, etc.) and render points on the edges of the letters, as shown below:

picture of opentype.js point configuration

If you have a solution, please contact me ASAP as this is a time sensitive project. I have a screenshot of the program attached to this message. If not, thanks anyway.

Include custom functionalities to inherited js file odoo 15

I am working on some website modifications on the appointment module to change some behaviors.
What I am trying to do is make it able to choose more than one appointment in (/calendar/<appointment_type>) before sending the user to the confirmation form.
The original functionality is works by sending the user to confirm his appointment by clicking on any hour button he choose, First I have tried to inherit and replace the XML snippet (calendar_appointment_slots.xml) which is concerned with giving an href for each hour button by ones that don’t have an href.
This is the original XML code

<?xml version="1.0" encoding="UTF-8"?>
<template>
    <t t-name="appointment.slots_list">
        <h5 class="text-center" t-out="slotDate"/>
        <div class="o_slots_list row">
            <t t-foreach="slots" t-as="slot">
                <div class="col-md-6 col-12 mt-2 px-1">
                    <a class="btn btn-block btn-outline-primary text-black col-12"
                        t-attf-href="/calendar/#{appointment_type_id}/info?employee_id=#{slot['employee_id']}&amp;date_time=#{slot['datetime']}&amp;duration=#{slot['duration']}#{filter_appointment_type_ids ? '&amp;filter_appointment_type_ids=' + filter_appointment_type_ids : ''}"
                        t-out="slot['hours']"/>
                </div>
            </t>
        </div>
    </t>
</template>

and this is what I want to replace with

<?xml version="1.0" encoding="utf-8"?>
<template>
        <t t-name="my_module.inherit_slots_list" t-inherit="appointment.slots_list" t-inherit-mode="extension">
            <xpath expr="//div[@class='o_slots_list row'][1]/t[1]" position="replace">
                <t t-foreach="slots" t-as="slot">
                <div class="col-md-6 col-12 mt-2 px-1">
                    <a class="btn btn-block btn-outline-primary text-black col-12 o_time"
                        t-out="slot['hours']"/>
                </div>
            </t>
            </xpath>
        </t>
</template>

then I have tried to inherit a JS file (appointment_select_appointment_slot.js) and add a function to append more than one appointment based on a number that user can choose to a list of appointments before sending the result to some backend route.
This is the original appointment_select_appointment_slot.js

odoo.define('appointment.select_appointment_slot', function (require) {
'use strict';

var core = require('web.core');
var publicWidget = require('web.public.widget');
var qweb = core.qweb;

publicWidget.registry.appointmentSlotSelect = publicWidget.Widget.extend({
    selector: '.o_appointment',
    xmlDependencies: ['/appointment/static/src/xml/calendar_appointment_slots.xml'],
    events: {
        'change select[name="timezone"]': '_onRefresh',
        'change select[id="selectEmployee"]': '_onRefresh',
        'click .o_js_calendar_navigate': '_onCalendarNavigate',
        'click .o_day': '_onClickDaySlot',
    },

    /**
     * Navigate between the months available in the calendar displayed
     */
    _onCalendarNavigate: function (ev) {
        var parent = this.$('.o_appointment_month:not(.d-none)');
        let monthID = parseInt(parent.attr('id').split('-')[1]);
        monthID += ((this.$(ev.currentTarget).attr('id') === 'nextCal') ? 1 : -1);
        parent.addClass('d-none');
        this.$(`div#month-${monthID}`).removeClass('d-none');
    },

    /**
     * Display the list of slots available for the date selected
     */
    _onClickDaySlot: function (ev) {
        this.$('.o_slot_selected').removeClass('o_slot_selected');
        this.$(ev.currentTarget).addClass('o_slot_selected');

        const appointmentTypeID = this.$("input[name='appointment_type_id']").val();
        const appointmentTypeIDs = this.$("input[name='filter_appointment_type_ids']").val();
        const slotDate = this.$(ev.currentTarget.firstElementChild).attr('id');
        const slots = JSON.parse(this.$(ev.currentTarget).find('div')[0].dataset['availableSlots']);

        let $slotsList = this.$('#slotsList').empty();
        $(qweb.render('appointment.slots_list', {
            slotDate: moment(slotDate).format("dddd D MMMM"),
            slots: slots,
            appointment_type_id: appointmentTypeID,
            filter_appointment_type_ids: appointmentTypeIDs,
        })).appendTo($slotsList);
    },

    /**
     * Refresh the slots info when the user modify the timezone or the employee
     */
    _onRefresh: function (ev) {
        if (this.$("#slots_availabilities")[0]) {
            var self = this;
            const appointmentTypeID = this.$("input[name='appointment_type_id']").val();
            const employeeID = this.$("#slots_form select[name='employee_id']").val();
            const timezone = this.$("select[name='timezone']").val();
            this._rpc({
                route: `/calendar/${appointmentTypeID}/update_available_slots`,
                params: {
                    employee_id: employeeID,
                    timezone: timezone,
                },
            }).then(function (data) {
                if (data) {
                    self.$("#slots_availabilities").replaceWith(data);
                }
            });
        }
    },
});
});

and this is my code

odoo.define('my_module.appointments_num', function (require) {
'use strict';

var select_appointment_slot = require('appointment.select_appointment_slot');
var clicks = 0;
var appointments = []
var numberOfAppointments = 1

select_appointment_slot.include({
    events: _.extend({}, select_appointment_slot.prototype.events, {
        'click .o_time': '_onTimeClick',
        'click .dropdown-item-number': '_onNumberClick'
    }),

    _onTimeClick: function (ev) {
        if (this.$("#slots_availabilities")[0]) {
            clicks++;
            var self = this;
            const appointmentsNumber = this.$("select[name='number_of_appointments']").val();
            const timeSelected = this.$(ev.currentTarget).text();
            const appointmentTypeID = this.$("input[name='appointment_type_id']").val();
            const employeeID = this.$("#slots_form select[name='employee_id']").val();
            const timezone = this.$("select[name='timezone']").val();
            const slots = JSON.parse(this.$('.o_slot_selected').find('div')[0].dataset['availableSlots']);
            $.each(slots , function(index, value) {
                if (value['hours'] === timeSelected){
                    appointments.push(value);
                    return false;
                }
            });
            if (clicks === numberOfAppointments){
                this._rpc({
                    route: `/calendar/${appointmentTypeID}/list_of_appointments`,
                    params: {
                        appointments
                    },
                })
            }
        }
    },

    _onNumberClick: function(ev){
        numberOfAppointments = parseInt(this.$(ev.currentTarget).text());
        alert(numberOfAppointments);
    }

});
});

My problem is neither the JS inheritance works nor the XML.
I would really appreciate if someone can help me to make this work.
Thanks!