With reactJs and react.fluentui controls, how do I detect leaving a TableRow?

I’m creating a reactJs form using the Fluent controls and Table to help layout the form (https://react.fluentui.dev/?path=/docs/components-table–default)

Within a row of the table, I have three buttons – Save, Save As, Delete that save/delete the content of the table above them. When SaveAs is clicked, it shows a further table row just below the buttons to accept the new name with OK and Cancel buttons (instead of popping up a modal dialog). The react function for that row is the following (with the Table configured to be rendered as rather than elements, so I can control the column widths with the flex attributes):

  function getNewNameRow() {
    const inputId = useId("newName");
    const styles = useStyles();
    return (
      showNewName && (
        <TableRow className={styles.tableNameRow} width="100%" onBlur={btnSaveAsCancelClick}>
          <TableCell className={styles.tableNoResize}>
            <label id={inputId}>New name:</label>
          </TableCell>
          <TableCell>
            <Input
              id={inputId}
              className={styles.input}
              aria-labelledby={inputId}
              onChange={(e) => {
                checkNewName(e);
              }}
            />
          </TableCell>
          <TableCell className={styles.tableNoResize}>
            <Button
              appearance="primary"
              size="small"
              icon=<Checkmark20Filled />
              onClick={btnSaveAsOKClick}
              disabled={!enableSaveAsOK}
            ></Button>
            <Button
              appearance="secondary"
              size="small"
              icon=<Dismiss20Filled />
              onClick={btnSaveAsCancelClick}
            ></Button>
          </TableCell>
        </TableRow>
      )
    );
  }

so I can show/hide it by toggling the showNewName state.

I can’t work out how to manage the focus. What I want to happen is:

  • If type a name in the input box, then click the OK button (in the same row), the Save code executes, saves the data and hides the New Name row.
  • If I type a name in the input box, then click the Cancel button (in the same row), the Cancel code executes and hides the New Name row.
  • If I click on the form anywhere outside the table row, it behaves the same as Cancel, hiding the NewName row.
  • I should be able to tab between the Input, OK and Cancel buttons without it hiding, but hide if I tab out of those 3 (or trap me in there until I click Cancel)

As you can see, I was hoping to do this with the onBlur of the TableRow, but that fires as soon as I leave the Input box, even if it’s only to click the OK button – so the OK button is gone before it’s clicked.

I’m a bit of a newbie with ReactJs, Fluent and these controls, so please assume I know nothing!

Dynamic table with dynamic rowspans using Vue.js and element plus

Hello i created a dynamic table component using element-plus, in Vue.js, like this (simple code)

<el-table :data="tableData" v-loading="loading" :show-header="header" class="Gema" border
      style=" width:100% !important; margin-bottom: 25px; padding:15px" :scrollbar-always-on="true"  :summary-method="summaryData"
    :show-summary="isSum" :span-method="objectSpanMethod">
      <el-table-column v-for="column in columns" :fixed="column.fixed" :key="column.prop" :label="column.label"
        :prop="column.prop" :width="column.width" :sortable="column.sortable" >
        <template v-if="column.prop === 'percentagem'" #default="scope">
          <div :class="getPercentagemClass(scope.row.percentagem)">
            {{ scope.row.percentagem }}
          </div>
        </template>
        <template v-if="column.prop === 'foto'" #default="scope">
          <img v-if="scope.row.foto" :src="'storage' + scope.row.foto" alt="Image"
            style="max-width: 100px; max-height: 100px;" />
          <img v-else :src="'storage/error/no-image.jpg'" alt="Image" style="max-width: 100px; max-height: 100px;" />
        </template
    
..... more column possibilities
</table>

What i want, is that in a table, i have a form, that i can add several data, that is assigned to one single file with an id. What i want, is based on the number of data with same file_id it defines dynamically the different rowspan i need in the column that i will have a button to download the file , so, for example, if i have 3 rows of data for file with id 1, then the specific column with the button (let’s called its prop ‘fatura’) , and 2 rows of data with file_id 2, it should make rowspan 3 and then rownspan 2, so i can have the button appear only 2 times, instead of 5 times .

I tried the approach they explain in the element-plus documentation, but couldn’t make it work .

what is the best approach i should do to accomplish this?
Thank you in advance

I have an error when running a project in meteor

This is the error that appears in the terminal:

Errors prevented startup:

While downloading [email protected]…:
error: certificate has expired

and so more messages of this type.
It’s like I need to install more packages or updates.
I need your help, I was already at the bottom of my system.
I have meteor version 2.15.
node version v14.21.3
nvm 0.39.7
and I use Ubuntu 20.4 LTS 64 bits.
thank you so much

I tried meteor reset and then meteor update.
I tried installing meteor again.
I installed it with nvm.
I searched the forums and tried to do what had worked for others and nothing.

Why am I getting a type error in the function? [closed]

I am trying to create a palindrome checker in Javascript (freeCodeCamp certification project) but keep getting a type error in the “original” var which means the function doesn’t work. I’m not sure what I have missed.

function palindrome(input) {
  var original = input.toLowerCase.replace(/[W_]/gi, '');
  var test = input.toLowerCase.replace(/[W_]/gi, '')
    .split('')
    .reverse()
    .join('');
    
  if (original === test) {
    var result = `${input} is a palindrome.`
  } else {
    var result = `${input} is not a palindrome.`
  }
}

I have tried swapping around const, let and var. I have also changed the order of .toLowerCase and .replace. I don’t know where to go next.

How to get the current text selection with Javascript on ANY part of the website?

I’d like to get the selected text from a website, but when I use document.getSelection it does not work for selections inside textareas and to get the selection from a text area I would need to know which textarea has the selection to use the textarea functions. Is there a simple methods for getting the current selection or do I need to iterate over all elements to test if they contain selected text?

How can I pass data props to a component slot in vue to use as v-model

I have a vue component that I use for a page layout in a laravel app. The layout is to display data in table format. Each page has a form with different inputs/selects to filter the data.

I’m using vue 2. I’m not sure how I can create dynamic properties on layout-component.vue. The properties will be used on the params/form inputs for v-model.

Below are the components.

layout-component.vue

<template>
    <div>
        <div v-if="hasSlot('form')">
            <form v-on:submit.prevent="emitFormValues">

                <input type="hidden" name="per_page" v-model="per_page">
                <input type="hidden" name="page" v-model="page">

                <div>
                    <!-- Form Slot -->
                    <slot name="form"></slot>

                    <div>
                        <button-component icon="search" type="submit" label="Filter"></button-component>
                    </div>
                </div>
            </form>
        </div>

        ...rest of layout
    </div>
</template>

page-a-component.vue

<template>
    <layout-component v-on:form-submitted="handleFormSubmission">
        <template v-slot:form>
            <select v-model="params.input_a" name="input_a" id="input_a" :value="params.input_a">
                <option></option>
            </select>

            <input v-model="params.input_b" name="input_b" id="input_b" :value="params.input_b"></input>
        ... more inputs/selects
        </template>

        ...rest of layout/results
    </layout-component>
</template>

<script>
export default {

    data: () => ({
        results: [],
        params: {
            input_a: null,
            input_b: null,
            page: 1,
            per_page: 15
        }
    }),
};
</script>

page-b-component.vue

<template>
    <layout-component v-on:form-submitted="handleFormSubmission">
        <template v-slot:form>
            <select v-model="params.diff_input_a" name="diff_input_a" id="diff_input_a" :value="params.diff_input_a">
                <option></option>
            </select>

            <input v-model="params.diff_input_b" name="diff_input_b" id="diff_input_b" :value="params.diff_input_b"></input>
        ... more inputs/selects
        </template>

        ...rest of layout/results
    </layout-component>
</template>

<script>
export default {

    data: () => ({
        results: [],
        params: {
            diff_input_a: null,
            diff_input_b: null,
            page: 1,
            per_page: 15
        }
    }),
};
</script>

page-a.blade.php

<page-a-component></page-a-component>

page-b.blade.php

<page-b-component></page-b-component>

It feels like I’m repeating myself a lot in page-N-component.vue when all I really need to change to is the params and form inputs/selects.

How can I just use the page component in a blade template and not need page-N-componet.vue? I would like page-a.blade.php and page-b.blade.php to look like below.

<layout-component v-on:form-submitted="handleFormSubmission">
        <template v-slot:form>
            ... ADD FORM INPUTS/PARAMS
        </template>

        ...rest of layout/results
</layout-component>

ReactJS – Trigger update of child component from another child component

Given I have a parent component hosting two child components. I managed to create a ContextProvider sharing data between those two components. But I was unable to cause an refresh on Component2, triggered by an action on Component 1.

My scenario is one ore more child components refreshing data after a refresh button (think toolbar) in Component1 is clicked. I don“t want to lift the data from Component1 to the parent, as its only used by Component2. Can i define something like an event on the context shared by the components which can be raised by Component1 and consumed by Component2 or is there a different approach I should take?

Y axis sets on zero after changing the data, on the graph, using JavaScript

I am using variables, dynamic text and plotly with javascript in grafana.

At the first load the graph shows complete

enter image description here

After changing the data, its like the hole Y axis sets on zero maximun and minimun.

enter image description here

After realoading the page it displays the graph with out issues

enter image description here

The Y axis will change from size, on the layout configuration I set

layout:{

….

autorange: true,

….
}

Any suggestion thay may help, thanks in advance.

Create a GridView with frozen header for scrolling in a website

I’m trying to create a web page (not a web form) using an ASPX page.

I have a GridView that has a lot of content, so I’d like to freeze the header so that the user can scroll down without losing the headers.

I’ve seen this elsewhere in webforms, but I can’t find any guidance for a web site page.

The data is populated from SQL as a datatable and bound to the GridView.

Is this possible in a website ASPX page or only in a webforms page?

The existing page is old and written in VB.Net and ASP.Net.

Any clues about possible of sources of code would be great.

I’m assuming I may have to use a combination of CSS and JQuery/JavaScript.

Why await response.json() return a promise? [duplicate]

I’m trying to get some data from my server using fecth API with async/await. I know i can do this inside an async function

async someFunction(url) {
  response = await fecth(url)
  data = await response.json()
  // Here I can use the data
  console.log(data) // print the data correctly
  data.map(x => x.key) // works well
}

However if I return the data and try to use it in another function, it returns a promise, but why?

mainFunction() {
  data = getData(url)
  // Here data is again a promise
  console.log(data) // "PromiseĀ {<pending>}"
  data.map(x => x.key) // "Uncaught TypeError: data.map is not a function"
}

async function getData(url) {
  response = await fecth(url)
  data = await response.json()
  console.log(data) // print the data correctly
  return data
}

if I use data = await getData(url) it works again but my code editor (vscode) says ‘await’ has no effect on the type of this expression., so I’m confused, why I have to await the data again if I’m returning the awaited data?

Ternary Operator not displaying row when condition is false but displays when true

I usually don’t post on here but I’ve been scratching my head at this for a couple days now. I have a tabbed table that’s suppose to display applicants that have been accepted in one and applicants that are pending in the other. So basically:

Condition is true:
Display the accepted applicants
Condition is false:
Don’t display the accepted applicants

When I make the value true on the database it shows up no problem but when I change it to false it doesn’t show on my table even though I know the ternary operator is working properly. Below are my tables, the second one is the one for the accepted applicants

<div className="tab-row text-left">
    <h1>Pro Applicants</h1>
    <h4 className="dashboard-header_sub" > Review new pros and grow your network! Manage BeautyLynk pro applicants here.</h4>
    <br />
    <Tab>
        <Tab.TabPane key={`Tab-3`} tab={"Pending Applicants"}>
            <div className="dashboard-table">
                {
                    applicants.length ?
                        <>
                            <table className="darkTable">
                                    <thead>
                                        <tr>
                                            <th><h4>Name</h4></th>
                                            <th><h4>Email</h4></th>
                                            {width > 1000 ? <th><h4>Location</h4></th> : ""}
                                            <th><h4>Licensed</h4></th>
                                            <th><h4>Submission Date</h4></th>
                                            <th><h4>Available By</h4></th>
                                            <th><h4>Actions</h4></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {currentApplicants.map((applicant) => (
                                            !applicant.isAccepted && !applicant.isDeclined? 
                                                <tr key={applicant.id}>
                                                    <td className="dashboard-table_serviceType">
                                                        <p>{applicant.firstName} {applicant.lastName}</p>
                                                    </td>
                                                    <td>{applicant.email}</td>
                                                    {width > 1000 ? <td>
                                                        <p>{applicant.location}</p>
                                                    </td> : ""}
                                                    <td>
                                                        {applicant.isLicensed ? "Yes" : "No"}
                                                    </td>
                                                    <td>{dateFormat(applicant.created_at)}</td>
                                                    <td>{dateFormat(applicant.dateaAvailable)}</td>
                                                    <td className="dashboard-booking_detail">
                                                        {
                                                            <div >
                                                                <a title="Click here to view more details or accept this applicant" href={`/pro-applicant?id=${applicant.id}`} to={`/pro-applicant?id=${applicant.id}`}>
                                                                    View Details
                                                                </a>
                                                            </div>  
                                                        }
                                                    </td>
                                                </tr>    
                                            : ""
                                        ))}
                                    </tbody>
                                </table> 
                                <Pagination length={applicants.filter((applicant) => applicant.isAccepted == false && applicant.isDeclined == false).length} rowsPerPage={rowsPerPge} handlePagination={handleBookingPagination} currentPage={currentApplicantsPage} type="applicants"/>
                        </>
                        : <table className="darkTable">
                            <thead>
                            </thead>
                            <tbody className="dahsboard-empty_pending">
                                <h1> No Pending Appointments </h1>
                            </tbody>
                        </table>  
                }
            </div>
        </Tab.TabPane>
        <Tab.TabPane key={`Tab-4`} tab={"Accepted Applicants"}>
            <div className="dashboard-table">
                {
                    applicants.length ?
                        <>
                            <table className="darkTable">
                                    <thead>
                                        <tr>
                                            <th><h4>Name</h4></th>
                                            <th><h4>Email</h4></th>
                                            {width > 1000 ? <th><h4>Location</h4></th> : ""}
                                            <th><h4>Licensed</h4></th>
                                            <th><h4>Submission Date</h4></th>
                                            <th><h4>Actions</h4></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {currentApplicants.map((applicant) => (
                                            !applicant.isAccepted? 
                                                <tr key={applicant.id}>
                                                    <td className="dashboard-table_serviceType">
                                                        <p>{applicant.firstName} {applicant.lastName}</p>
                                                    </td>
                                                    <td>{applicant.email}</td>
                                                    {width > 1000 ? <td>
                                                        <p>{applicant.location}</p>
                                                    </td> : ""}
                                                    <td>
                                                        {applicant.isLicensed ? "Yes" : "No"}
                                                    </td>
                                                    <td>{dateFormat(applicant.created_at)}</td>
                                                    <td className="dashboard-table_actions">
                                                        {
                                                            applicant.isAccepted ? <p className="dashboard-table_status-green">ACCEPTED</p>
                                                                : <p className="dashboard-table_status-grey">DECLINED</p>
                                                        }
                                                    </td>
                                                </tr>    
                                            : "none"
                                        ))}
                                    </tbody>
                                </table> 
                                <Pagination length={applicants.filter((applicant) => applicant.isAccepted == true && applicant.isDeclined == false).length} rowsPerPage={rowsPerPge} handlePagination={handleBookingPagination} currentPage={currentApplicantsPage} type="applicantsComp"/>
                        </>

                        : <table className="darkTable">
                            <thead>
                            </thead>
                            <tbody className="dahsboard-empty_pending">
                                <h1> No Pending Appointments </h1>
                            </tbody>
                        </table>  
                }
            </div>
        </Tab.TabPane>
        
    </Tab>
</div>

I’ve tried using different variation of conditions to check if its true and figured out the the operator is evaluating properly but the row just wont display. I’ve checked, double checked, and triple checked and don’t know whats going on. Scraping it for now but could really use some help

Thank you in advance!

What’s the best way to fetch data from a database/google sheet and store said data in a google map?

I’m working on a project that will take real-time data from either a google sheet or database and display it on a google map embedded in a website using javascript/css/html and google APIs. I haven’t found a clear and concise way of fetching that data and storing it into the designated values.

All of the ChatGPT/online tutorials work on their own but combining comes with troubles. I really need help figuring out a plan of attack.

Any guidance would be much appreciated.

How can I make the legend items bigger with react-plotly.js?

I’m using react-plotly.js and I have a graph with some dots with a color and a border. I want the border to be thick, the problem is that it looks bad in the legend, because the legend is so small.

Is there a way to either remove the border from the legend, or increase the size of the dots on the legend?

viewed on the graph:
on the graph

how it shows on the legend:
legend

Copying files in Javascript Rhino

I’m looking for the easiest solution to copy a file from /pathA/filename to /pathB/filename. No relative paths or file modifications are needed.

I’m trying to copy a file in Javascript Rhino. The code below for making a new file works with no issues:

        //Make destination file
        destinationDir = new java.io.File(filepath).mkdirs();
        localFile = new java.io.File(filepath,filename);
        localFile.createNewFile();

I just need to copy the file with no modifications, so no need for copying an input/output stream. Any suggestions? Many of the other related questions I’ve found are for java or js with html, neither of which give me an exact solution. I’ve tried Files.copy but can’t seem to get it correct.

when I try to login Privateroute not working properly

this is my app.js

import React from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import AdminLogin from "./admin/AdminLogin";
import AdminDashboard from "./admin/AdminDashboard";
import MainSection from "./components/MainSection";
import CustomerForm from "./components/CustomerForm";
import { AuthProvider, useAuth } from "./context/AuthContext";
import PrivateRoute from "./routes/PrivateRoute";

function App() {
  return (
    <AuthProvider>
      <Router>
        <Routes>
          <Route path="/" element={<AdminLogin />} />
          <Route
            path="/dashboard"
            element={
              <PrivateRoute>
                <AdminDashboard />
              </PrivateRoute>
            }
          />
          <Route
            path="/client"
            element={
              <PrivateRoute>
                <MainSection />
              </PrivateRoute>
            }
          />
          <Route
            path="/product"
            element={
              <PrivateRoute>
                <CustomerForm />
              </PrivateRoute>
            }
          />
        </Routes> 
      </Router>
    </AuthProvider>
  );
} 

export default App;

this is AuthContext

import React, { createContext, useContext, useState, useEffect } from "react";
import { auth } from "../firebase"; // Import Firebase authentication

const AuthContext = createContext();

export const useAuth = () => useContext(AuthContext);

export const AuthProvider = ({ children }) => {
  const [currentUser, setCurrentUser] = useState(null);

  useEffect(() => {
    const unsubscribe = auth.onAuthStateChanged((user) => {
      setCurrentUser(user); // Set current user based on Firebase authentication state
    });

    return unsubscribe; // Cleanup function
  }, []);

  const login = (email, password) => {
    return auth.signInWithEmailAndPassword(email, password);
  };

  const logout = () => {
    return auth.signOut();
  };

  return (
    <AuthContext.Provider value={{ currentUser, login, logout }}>
      {children}
    </AuthContext.Provider>
  );
};
import React, { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom"; // Import useNavigate
import { auth } from "../firebase";
// import "tailwindcss/tailwind.css";

const AdminLogin = () => {
  const navigate = useNavigate();
  const [loading, setLoading] = useState(true);
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");
  const [error, setError] = useState(null);
  const [prevAuthState, setPrevAuthState] = useState(false); // Previous authentication state

  useEffect(() => {
    const unsubscribe = auth.onAuthStateChanged((user) => {
      setLoading(false);
      if (user && prevAuthState) {
        alert("you are already logged in");
        navigate("/dashboard"); // Redirect to dashboard if user is already logged in
      }
      setPrevAuthState(!!user); // Update previous authentication state
    });

    return () => unsubscribe();
  }, [navigate, prevAuthState]);

  const handleLogin = async (e) => {
    e.preventDefault();
    try {
      await auth.signInWithEmailAndPassword(email, password);
      navigate("/dashboard");
    } catch (error) {
      setError(error.message);
    }
  };

  if (loading) {
    return <div>Loading...</div>; // Render loading indicator
  }
  return (
    <div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
      <div className="max-w-md w-full space-y-8">
        <div>
          <h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
            Admin Login
          </h2>
        </div>
        <form className="mt-8 space-y-6" onSubmit={handleLogin}>
          <input
            type="email"
            autoComplete="email"
            required
            className="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
            placeholder="Email address"
            value={email}
            onChange={(e) => setEmail(e.target.value)}
          />
          <input
            type="password"
            autoComplete="current-password"
            required
            className="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
            placeholder="Password"
            value={password}
            onChange={(e) => setPassword(e.target.value)}
          />
          <div className="flex items-center justify-between">
            <div className="text-sm">
              <p className="text-red-500">{error}</p>
            </div>
          </div>
          <div>
            <button
              type="submit"
              className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
            >
              Sign in
            </button>
          </div>
        </form>
      </div>
    </div>
  );
};

export default AdminLogin;

this is AdminDashboard

import React, { useEffect, useState } from "react";
import { Link, Route, Routes, useNavigate } from "react-router-dom";
import { auth } from "../firebase";
import MainSection from "../components/MainSection"; // Import Client component
// import ProductComponent from "./ProductComponent"; // Import Product component

const AdminDashboard = () => {
  const navigate = useNavigate();
  const [loading, setLoading] = useState(true); // Loading state
  const [user, setUser] = useState(null); // User state

  useEffect(() => {
    // Check if user is authenticated
    const unsubscribe = auth.onAuthStateChanged((user) => {
      setLoading(false); // Update loading state
      setUser(user); // Update user state
      if (!user) {
        navigate("/"); // Redirect to login page if not logged in
      }
    });

    // Cleanup function
    return () => unsubscribe();
  }, [navigate]);

  const handleLogout = async () => {
    try {
      await auth.signOut();
      navigate("/");
    } catch (error) {
      console.error("Error signing out:", error);
    }
  };

  if (loading) {
    return <div>Loading...</div>; // Render loading indicator
  }

  return (
    <div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
      <div className="max-w-md w-full space-y-8">
        <div>
          <h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
            Welcome to Admin Dashboard
          </h2>
        </div>
        <div className="flex items-center justify-center">
          <button
            onClick={handleLogout}
            className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
          >
            Logout
          </button>
        </div>
        <div className="flex flex-col items-center justify-center mt-4 space-y-4">
          <Link
            to="/client"
            className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
          >
            Client
          </Link>
        </div>
      </div>
    </div>
  );
};

export default AdminDashboard; 

this is privateroute

import React from "react";
import { Route, Navigate } from "react-router-dom";
import { useAuth } from "../context/AuthContext";

const PrivateRoute = ({ element, ...rest }) => {
  const { isAuthenticated } = useAuth();

  return isAuthenticated ? (
    <Route {...rest} element={element} />
  ) : (
    <Navigate to="/" replace />
  );
};

export default PrivateRoute;

I am trying to create an admin login where after I log in I will get dashboard client and product pages but when I use the privateroute it is not working properly but I am not able to login and also when I try to access client and product I am not able to access them I am using firebase to login and authentication