Skip to content

Commit

Permalink
10/10 changeLog
Browse files Browse the repository at this point in the history
1. Correxted the Map json of createProjectData function in step.js
  • Loading branch information
wonderfulday-john committed Oct 9, 2024
1 parent d06a44e commit 5e4dd1c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion content.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function handleClick(event) {
// Add a "welcome" step if this is the first step
if (steps.length === 0) {
const welcomeStep = {
type: 'Navigate',
type: 'navigate',
timestamp: new Date().toISOString(),
message: 'Welcome to the recording session!',
url: window.location.href
Expand Down
51 changes: 29 additions & 22 deletions step.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,9 @@ function createProjectData() {
steps: displayedSteps.map(step => (
step.type === 'click'
? {
stepType: step.type,
targetUrl: step.url,
screenshotUrl: step.screenshot,
viewportWidth: step.viewportWidth,
viewportHeight: step.viewportHeight,
createdTime: step.timestamp,
pageX: step.pageX,
pageY: step.pageY,
scrollX: step.scrollX,
scrollY: step.scrollY,
iframeX: step.x,
iframeY: step.coordinates.y,
innerText: step.target.innerText
} : step.type === 'Navigate' ?
{
stepType: step.type,
targetUrl: step.url,
createdTime: step.timestamp,
innerText: step.message,
} : {
stepType: step.type,
runtimeType: step.type,
//runtimeType must be declared, as have to be clearify for @freezed
clickStep: {
targetUrl: step.url,
screenshotUrl: step.screenshot,
viewportWidth: step.viewportWidth,
Expand All @@ -63,10 +45,35 @@ function createProjectData() {
pageY: step.pageY,
scrollX: step.scrollX,
scrollY: step.scrollY,
iframeX: step.coordinates.x,
iframeX: step.x,
iframeY: step.coordinates.y,
innerText: step.target.innerText
}
} : step.type === 'navigate' ?
{
runtimeType: step.type,
navigateStep: {
targetUrl: step.url,
createdTime: step.timestamp,
innerText: step.message,
}
} : {
runtimeType: step.type,
clickStep: {
targetUrl: step.url,
screenshotUrl: step.screenshot,
viewportWidth: step.viewportWidth,
viewportHeight: step.viewportHeight,
createdTime: step.timestamp,
pageX: step.pageX,
pageY: step.pageY,
scrollX: step.scrollX,
scrollY: step.scrollY,
iframeX: step.coordinates.x,
iframeY: step.coordinates.y,
innerText: step.target.innerText
}
}
)),
createdTime: new Date().toISOString()
};
Expand Down

0 comments on commit 5e4dd1c

Please sign in to comment.