Know about Mapping or Routing against Sales Order page when we put item code automates item tax template and taxes and charges

Hiiii Teams
In ERPNext Version 14 , how to find location of source code for sales order page where we put item code , automatically they fetch item tax template and taxes and chargers sections, how to know about that mapping and routing if that page works , I want to understand source code file which may be .js file or .py file, please help me to find that particular location where they connect in erpnext v14, so i can easily debug code

I want to understand source code file which may be .js file or .py file, please help me to find that particular location where they connect in erpnext v14, so i can easily debug code

Dialogflow CX avatar image URI

I need to change dummy avatar image of bot in dialog flow CX?

Looking for avatar change option in CX but cannot find any solution for it. Can anyone help me on it where I can change this please share json or javascript code

Synchronous XMLHttpRequest last modified time, how to make it asynchronous?

I found a code that could get the last modified time of a file on the server and have adapted it to my needs, it works fine but I get the warning below and reading about the code seems to be resource intensive for the users computer.
The code needs to react (reload) to a file being modified and print out the time since it was last modified.
I notice my computer is (slightly) sluggish when I have two windows open that use this code, perhaps this is the reason.

What can I do to make this asynchronous?

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/ .

       <script>
            var pageload = new Date();
            function fetchHeader(url, wch) {
                try {
                    var req=new XMLHttpRequest();
                    req.open("HEAD", url, false);
                    req.send(null);
                    if(req.status== 200){
                        return req.getResponseHeader(wch);
                    }
                    else return false;
                } catch(er) {
                    return er.message;
                }
            }

            window.setInterval(function(){
                var time = Date.parse(fetchHeader("Akut.txt",'Last-Modified'));
                var d = new Date();
                var diffSec = Math.round((d - time) / 1000);
                document.getElementById("time").innerHTML = Math.trunc(diffSec/60) + " minutes"; // time since it was modified
                
                if ((d-pageload)/1000 > 10 && diffSec < 5 ){
                    location.reload();
                }
            }, 2500);
        </script>

I found this thread XMLHttpRequest is deprecated. What to use instead? and I have tried to modify the code but I can’t get this code to give me the last modified time.
This just returns NaN.


             function fetchHeader(url, wch) {
                try {
                    var xhr = new XMLHttpRequest()
                    xhr.onreadystatechange = function() {
                        if (this.readyState === this.DONE) {
                            console.log(this.getResponseHeader(wch)); // assumed this would work but it doesn't
                        }
                    }
                    xhr.open("HEAD", url)
                    xhr.send()
                } catch(er) {
                    return er.message;
                }
            }

I need help with making this asynchronous. I have tried to read the xhr link from the warning but I’m not much of a Javascript developer so it’s hard for me to find what I need to do.
Can someone point me in the right direction here?

Fetching JSON from an URL and store it as a list

I have receiving JSON response form an URL and I want to store the response in a list of JSON objects.

I have:
 

var movies;
  function GetMovies() {
    fetch(url, {
      method: 'GET',
      headers: {
        'Accept': 'application/json',
      },
    }).then(response => movies = response.json());
  }

  GetMovies();
  console.log(movies);

But movies stays undefined. How can i convert the returned JSON as list of JSON objects e.g.:

  const movies = [
    { label: 'The Shawshank Redemption', year: 1994 },
    { label: 'The Godfather', year: 1972 },
    { label: 'The Godfather: Part II', year: 1974 }];

I installed the react-native-rate package and after this, the android build failed

I am using :
“react-native”: “0.69.5”
“react-native-rate”: “^1.2.12”
android-gradle-plugin-version: 7.1.1
gradle-version: 7.5

Issue:
FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ‘:app:checkDebugDuplicateClasses’.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1

Here are my Package.json dependencies and devDependencies:

“dependencies”: {
“@invertase/react-native-apple-authentication”: “^2.2.2”,
“@react-native-async-storage/async-storage”: “^1.17.10”,
“@react-native-camera-roll/camera-roll”: “^5.1.0”,
“@react-native-clipboard/clipboard”: “^1.11.1”,
“@react-native-community/datetimepicker”: “^6.7.5”,
“@react-native-community/masked-view”: “^0.1.11”,
“@react-native-community/push-notification-ios”: “^1.10.1”,
“@react-native-community/slider”: “^4.3.1”,
“@react-native-firebase/analytics”: “^15.6.0”,
“@react-native-firebase/app”: “^15.6.0”,
“@react-native-firebase/crashlytics”: “^15.6.0”,
“@react-native-firebase/dynamic-links”: “15.6.0”,
“@react-native-firebase/messaging”: “^15.6.0”,
“@react-native-google-signin/google-signin”: “^9.0.2”,
“@react-navigation/bottom-tabs”: “^6.4.0”,
“@react-navigation/native”: “^6.0.13”,
“@react-navigation/native-stack”: “^6.9.0”,
“axios”: “^0.27.2”,
“buffer”: “^6.0.3”,
“moment”: “^2.29.4”,
“react”: “18.0.0”,
“react-native”: “0.69.5”,
“react-native-animatable”: “^1.3.3”,
“react-native-app-intro-slider”: “^4.0.4”,
“react-native-audio-recorder-player”: “^3.5.1”,
“react-native-autoheight-webview”: “^1.6.5”,
“react-native-blob-util”: “^0.17.3”,
“react-native-calendars”: “^1.1289.0”,
“react-native-chart-kit”: “^6.12.0”,
“react-native-collapsible”: “^1.6.0”,
“react-native-confirmation-code-field”: “^7.3.1”,
“react-native-device-info”: “^10.3.0”,
“react-native-dialog”: “^9.3.0”,
“react-native-fast-image”: “^8.6.1”,
“react-native-fbsdk”: “^3.0.0”,
“react-native-fs”: “^2.20.0”,
“react-native-google-mobile-ads”: “^8.2.2”,
“react-native-iap”: “^12.4.4”,
“react-native-image-crop-picker”: “^0.38.0”,
“react-native-image-picker”: “^4.10.0”,
“react-native-image-progress”: “^1.2.0”,
“react-native-image-zoom-viewer”: “^3.0.1”,
“react-native-in-app-review”: “^4.2.1”,
“react-native-iphone-x-helper”: “^1.3.1”,
“react-native-keyboard-aware-scroll-view”: “^0.9.5”,
“react-native-linear-gradient”: “^2.6.2”,
“react-native-material-menu”: “^2.0.0”,
“react-native-modal”: “^13.0.1”,
“react-native-modal-datetime-picker”: “^14.0.0”,
“react-native-paper”: “^5.5.1”,
“react-native-pell-rich-editor”: “^1.8.8”,
“react-native-permissions”: “^3.8.0”,
“react-native-progress”: “^5.0.0”,
“react-native-push-notification”: “^8.1.1”,
“react-native-rate”: “^1.2.12”,
“react-native-render-html”: “^6.3.4”,
“react-native-safe-area-context”: “^4.3.4”,
“react-native-screens”: “^3.17.0”,
“react-native-share”: “^7.9.1”,
“react-native-splash-screen”: “^3.3.0”,
“react-native-svg”: “^13.8.0”,
“react-native-svg-charts”: “^5.4.0”,
“react-native-swipeable-list”: “^0.1.2”,
“react-native-toast-message”: “^2.1.5”,
“react-native-track-player”: “3.1”,
“react-native-version-check”: “^3.4.3”,
“react-native-webview”: “^11.25.0”,
“react-native-wheel-color-picker”: “^1.2.0”,
“victory-native”: “^36.6.8”
},
“devDependencies”: {
“@babel/core”: “^7.12.9”,
“@babel/runtime”: “^7.12.5”,
“@react-native-community/eslint-config”: “^2.0.0”,
“babel-jest”: “^26.6.3”,
“babel-plugin-transform-remove-console”: “^6.9.4”,
“eslint”: “^7.32.0”,
“jest”: “^26.6.3”,
“metro-react-native-babel-preset”: “^0.70.3”,
“react-test-renderer”: “18.0.0”
},

kindly help me to fix this issue.

WARNING: Calling an account which is not a contract

When calling a view function, I get the WARNING: Calling an account which is not a contract on my hardhat http node and
index.ts:269 Uncaught (in promise) Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ]
on my console. this is my hardhat config

 networks: {
    hardhat: {
      chainId: 1337,
    },



async function fetchArtisteData() {
    if (typeof window.ethereum !== 'undefined') {
      await requestAccount()
      const provider = new ethers.providers.Web3Provider(window.ethereum)
      const signer = provider.getSigner()
      const contract = new ethers.Contract(contractAddress, abi, signer)
      const artisteCount = await contract.artisteCount()

      // Get artiste data
      let artistes = []
      for (let i = 1; i <= artisteCount; i++) {
        const artiste = await contract.artiste(i)
        artistes.push(artiste)
      }
      setArtistes(artistes)
      console.log(artistes)
    }
  }

  useEffect(() => {
    fetchArtisteData()
 }, [])

Stripe in Angular 14

I would like to implement Stripe on my Angular 14 project without stripe-ngx because the pop-up design isn’t appropriate for me.

So, I use the “Personalized payment tunnel” and I want to catch if the payment is “Succeeded” without redirect to a new URL. That is possible?

Morever, I tryed to implement the full JS checkout in my Angular component but an error is returned to me when I call the method :

const { error } = await stripe.confirmPayment({
    elem,
    confirmParams: {
      return_url: `http://localhost/example`,
      receipt_email: emailAddress,
    },
  });

He don’t find my “clientSecret” while he’s in my variable “elem”.
Someone can help me?

Don’t hesitate to tell me if you need more informations.

Regards,

How can I pass a transition MUI prop to my child component in React?

I have one parent component with a button. when I click it, it opens a snackBar from MUI (child component). My teacher told me to add a transition effect to the onClick so when I show the snackbar, it has a slide transition.
I’ve tried to adjust MUI slide transition code from here MUI transition but I don’t know how to pass the prop to the child component, I get an error in TransitionComponent={transition}. Any suggestion to make this working?

Parent component:

//NOTE: transition
type TransitionProps = Omit<SlideProps, 'direction'>;
const TransitionLeft = (props: TransitionProps) => <Slide {...props} direction="left" />


export const Messages = () => {

  const [msgStatus, setMsgStatus] = useState("");     
  
  //NOTE: transition
  const [transition, setTransition] = useState<React.ComponentType<TransitionProps> | undefined>(undefined);

  const handleClick = (Transition: React.ComponentType<TransitionProps>) => () => {
    setTransition(() => Transition);
    setMsgStatus('info');
  };

  return (
    <Stack>
       <Button
             onClick={handleClick(TransitionLeft)}
           >
             open info
           </Button>
           <InfoMessage
             open={msgStatus === 'info'}
             transition={transition}
             onClose={() => setMsgStatus('')}
           />
    </Stack>
  )
}

child component

interface InfoMessageProps {
  open: boolean;
  onClose: () => void;
  transition: React.ElementType;
}

export const InfoMessage = ({ open, onClose, transition }: InfoMessageProps) => {

  const handleClose = (): void => {
    onClose();
  };

  return (
    <Snackbar
      open={open}
      autoHideDuration={4000}
      anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
      onClose={handleClose}
      TransitionComponent={transition} // here I have an error
    >
      <Alert
        sx={{
              width: '487px',
              height: '104px',
              paddingTop: '20px',
              paddingLeft: '20px',
              backgroundColor: '#FDFDFD',
        }}
        icon={false}
        action={(
          <IconButton
            aria-label="close"
            color="inherit"
            size="small"
          >
            <CloseIcon style={{ fontSize:'24px' }} />
          </IconButton>
        )}
        onClose={handleClose}
      >
        <AlertTitle sx={{ paddingRight:'80px' }}>
          <Typography variant='headings.h4'>title</Typography>
        </AlertTitle>
        <Typography variant='captions.default'>Insert message here</Typography>
      </Alert>
    </Snackbar>
  );
};

Why is Vue displaying both alternatives of a v-if condition?

I am somehow ending up with Vue displaying both variants of a v-if condtion, when it should be displaying only one.

The layout starts like this:

enter image description here

and after a drag operation looks like this, with the extra component ( a vuetify v-chip) being pushed into a new row because there isn’t enough room (there should be only 5 in a row):

enter image description here

I have checked the contents of the grid row that contains the data for these chips and confirmed that, after the drag, it still has only five columns, so there should be just 5 chips. The duplicated chip (the first ‘A’, the one that should not be there) has the outlined variant and the correct one (the blue ‘A’) does not – this is the correct result of dragging the original outlined ‘A’ chip out of the grid. The Vue template section is:

<v-container id="startgrid" style="max-width: 240px; height: 250px; position: relative;">
  <v-row v-for="(row,r) in startGrid" >
    <template v-for="(chip,c) in row" :key="chip.id" >
        <v-chip v-if="!chip.used" size="x-large" variant="outlined" class="copyable changeclass"
            @dropped="drop"
            @swapped="swap"
            :data-keep-row = r
            :data-keep-col = c
            :data-letter = chip.name
            :id=idString(0,r,c)
            > {{ chip.name }}
        </v-chip>
        <v-chip v-else size="x-large" 
            :data-letter = chip.name
            :id=idString(0,r,c)
            color="blue"
            > {{ chip.name }}
        </v-chip>
    </template>
  </v-row>
</v-container>

To confirm that I really am seeing both conditions of the v-if, I temporarily added the row and column numbers to the text of the blue variant but not to the outlined one, the result being (for a different letter being dragged):

enter image description here

Also (although not shown here) I temporarily added the length of the grid row to the chip name, to see how long ‘Vue’ thought it was when it was actually rendered. It was 5.

Looking at the elements in the browser debugger confirms what I am seeing, i.e. an extra component with opposing styles.

The drag/drop code manipulating the components (the code that provides the dropped and swapped events) is too involved to replicate here, so I am just wondering what sort of error might lead to this? How can chip.used (the conditional value) be both true and false at the same time?

Looking for an alternative solution for set Interval (Salesforce Lightning Aura component)

We have build an component on the Case Lightning Page to highlight dynamically the Case tab after an conditional update on the case record. We also want to use an Case Timer(appExchangeStore) to track the total time spent on the case.

We identified a problem in the Case Timer app caused by the interval in my controller. The timer starts automatically, but when we switch in different tabs it doesn’t work correctly anymore.

by that, we are looking for another solution to replace the interval. Any ideas?

Component:

<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global">
     
    <!--Attributes-->
    <aura:attribute name="CaseFields" type="Case"/>
    
    <!--Component Start-->


    <!--Lightning Workspace API-->
    <lightning:workspaceAPI aura:id="workspace"/>
     
    <force:recordData aura:id="accRecordData"
                      fields="Status"
                      layoutType="FULL"
                      recordId="{!v.recordId}"
                      targetFields="{!v.CaseFields}"
                      recordUpdated="{!c.handleRecordUpdate}"/>
</aura:component>

Controller:

({
    handleRecordUpdate: function(component, event, helper) {
        var workspaceAPI = component.find("workspace");
        var caseId = component.get("v.CaseFields.Id");
        
        setInterval(function() {
             var caseStatus = component.get("v.CaseFields.Status");
             if(caseStatus === "Response received"){
                    helper.startHighlight(workspaceAPI, caseId);
             } else if (caseStatus != "Response received"){
                    helper.stopHighlight(workspaceAPI, caseId);
             } 
        }, 2000);
    }
})

Helper:

({
    startHighlight: function (workspaceAPI, caseId) {
        var tabInfo = workspaceAPI.getTabInfo();
        if(tabInfo != null){
        tabInfo.then(function (response) {
            var tabCaseId = response.recordId;
            var focusedTabId = response.tabId;
            var isTabVisible = false;
                
                if(tabCaseId == caseId){
                    workspaceAPI.setTabHighlighted({
                        tabId: focusedTabId,
                        highlighted: true,
                        options: {
                            pulse: true,
                            state: "success"
                        }
                    });
                    workspaceAPI.setTabIcon({
                        tabId: focusedTabId,
                        icon: "standard:answer_public",
                        iconAlt: "Approval"
                    });           
                }
            });
        }
    },
    
    stopHighlight: function (workspaceAPI, caseId) {
        var tabInfo = workspaceAPI.getTabInfo();
        if(tabInfo != null){
            tabInfo.then(function (response) {
                var tabCaseId = response.recordId;
                var focusedTabId = response.tabId;
                var isTabVisible = false;
                    if(tabCaseId == caseId){
                        workspaceAPI.setTabHighlighted({
                            tabId: focusedTabId,
                            highlighted: false,
                            options: {
                                pulse: true,
                                state: "success"
                            }
                        });
                        workspaceAPI.setTabIcon({
                            tabId: focusedTabId,
                            icon: "standard:case",
                            iconAlt: "Approval"
                        }); 
                    }
            }); 
        }
    }
})

I tried to found another solution for the set Interval in my controller, but without success.

Slider image in div with preview

I have a question. Starting from this slider, is it possible to have on the right and left the previews of the images (with low opacity) that will go to the iphone (with high opacity) once the slider starts?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/assets/owl.theme.green.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/owl.carousel.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/assets/owl.carousel.min.css" rel="stylesheet" />

<div class="phone">
<div class="owl-carousel owl-theme screen">
    <div class="item"><h4>1</h4></div>
    <div class="item"><h4>2</h4></div>
    <div class="item"><h4>3</h4></div>
    <div class="item"><h4>4</h4></div>
    <div class="item"><h4>5</h4></div>
</div>
<div>
.screen .item{
  background-color:#5fba7d;
}

.phone{
    background-image: url(https://i.stack.imgur.com/vKQ2K.png);
    width: 320px !important;
    height: 650px;
    background-position: -25px 0;
}

.no-js .owl-carousel, .owl-carousel.owl-loaded {
    position: relative;
    top: 48px;
    width: 278px;
    left: 20px;
    height: 100%;
}

.owl-stage-outer, .owl-item, .item{
  height:100%;
}

.owl-stage{
  height:calc(100% - 153px);
}
$('.owl-carousel').owlCarousel({
    center: true,
    items:1,
    loop:true,
    margin:0
});

I found this old code, it should have result like this in the link: https://themes.getbootstrap.com/preview/?theme_id=19860

where is the “Take a closer look” section

How to make new Object with the properties from an array? [closed]

I want to make a new Object depending from the array values.
For example if I get an array from a fetch request like this:

[
  {source: 'indeed', job: 'frontend', person: 'John', lever: 'junior'}, 
  {source: 'indeed', job: 'backend', person: 'Mike', lever: 'senior'}, 
  {source: 'indeed', job: 'frontend', person: 'Lilly', lever: 'middle'}
]

from that array, I want an object like this:

const jobs = {
        indeed: {
            frontend:
                [
                    {person: 'John', lever: 'junior'},
                    {person: 'Lilly', lever: 'middle'}
                ],
            backend:
                [
                    {person: 'Mike', lever: 'senior'}
                ]
        }
    }

And when I get another fetch array, and now instead of indeed, the source is stepstone, like:

[
  {source: 'stepstone', job: 'frontend', person: 'John', lever: 'junior'}, 
  {source: 'stepstone', job: 'backend', person: 'Mike', lever: 'senior'}, 
  {source: 'stepstone', job: 'frontend', person: 'Lilly', lever: 'middle'}
]

the jobs should look like this:

jobs = {
        indeed: {
            frontend:
                [
                    {person: 'John', lever: 'junior'},
                    {person: 'Lilly', lever: 'middle'}
                ],
            backend:
                [
                    {person: 'Mike', lever: 'senior'}
                ]
        },
        stepstone: {
            frontend:
                [
                    {person: 'John', lever: 'junior'},
                    {person: 'Lilly', lever: 'middle'}
                ],
            backend:
                [
                    {person: 'Mike', lever: 'senior'}
                ]
        }
    }

how can i get the JSON of editor applied palates with modal set values and position

in angular 15.1.15 i am using , here is the GitHub repo https://github.com/spring-projects/spring-flo/issues
here in demo app we are able to provide the dls text to render the element but in my requirement i need position also so that whatever is the position i can load it !!

here I am not getting how to extract the details of dragged palate items with position and modal values in angularjs 1 we having one json object which is containing the position and all details but here on top only the DLS text is provided

jQuery add link to text in every row cell from url on another cell

I have a Google Sheet that has a table of many entries from Special Offers that are loaded using csv export to my site and then I display those offers in a table.

My problem is that csv export does not include the link of the boat that’s in the title, so I have added the link at the end of the google sheet table so I can then use jquery to get the value of the cell and replace the text of the boat title to include the boat name along with the link.

Here’s the google sheet. The URL I want to get is at the I column; and I then replace the text at the B column with the original text that has the link from column I.
enter image description here

It does work kinda, but it puts all the links from every cell in the tag like so:
enter image description here

Here’s the code I use that needs revamp:

<script>
jQuery(document).ready(function($) {
    $('#create_tables td:nth-child(2)').html(function(){
        return '<a href="' + $('#create_tables td:nth-child(9)').text() + '" target="_blank">' + $(this).text() + '</a>';
    });
});
</script>

Cant fetch data from an api on mobile browser with react front end

here is my react component where if fetch my data

const Home = () => {
    
    const  [remp, setRemp] = useState<remplas[]>(); 

    const getAllRempla = async () => {
        try{
            const response = await fetch(`${import.meta.env.VITE_API_REMPLA_URL}/api/all/`)
            if (response.ok) setRemp(parseDateFromJson(await response.json()))
            else {
                console.log(response.json())
            }
        } catch(error){
            console.log(error)
        }
        
    
        }
    

this code works only on desktop browser and on my ipad, but not on my iphone
I tried axios aswell.

I think its about a params to pass to the fetch method, but i cant figure out wich one it is.

I configured cors on the api enpoint since it work on desktop
I deployed this app on fly.io

here is the dockerfile

FROM node:alpine

WORKDIR /app
COPY package.json .
RUN npm install 
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev"]

Thank you for your help,