Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop 1.1.0 #2754

Open
wants to merge 113 commits into
base: staging-1.1.0
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
0a21d8c
feat(open-spark): ui implementation
skrushna1506 Dec 2, 2024
a5672f6
Merge pull request #2631 from beckn/feat/open-spark_Welcome_AuthPage
aniketceminds Dec 2, 2024
9060dcb
feat(open-spark): added UI signIn, signUp functionality
aniketceminds Dec 2, 2024
ccead9c
Merge pull request #2632 from beckn/feat/login-functionality
aniketceminds Dec 2, 2024
8e00830
feat(open-spark): /login, /signup api integration
aniketceminds Dec 2, 2024
9945742
Merge pull request #2633 from beckn/feat/signin-signup-integration
aniketceminds Dec 2, 2024
a26c438
feat(open-spark): modified code to add profile section and functionality
aniketceminds Dec 3, 2024
a533134
Merge pull request #2636 from beckn/feat/profile-section
aniketceminds Dec 3, 2024
f6f7b0a
feat(open-spark): modified code to add mycred page and modifid code i…
aniketceminds Dec 4, 2024
ab5dec9
Merge pull request #2650 from beckn/feat/my-cred-page
aniketceminds Dec 4, 2024
94eadaa
feat(open-spark): ui for open spark
skrushna1506 Dec 4, 2024
a16e10f
Merge pull request #2651 from beckn/feat/openSpark_Dashboard_DateRang…
aniketceminds Dec 4, 2024
054e5ed
test(dragon-food): add e2e tests for Dragon Food
aniketceminds Dec 2, 2024
c6a8ec5
feat(P2P-ENERGY): added cypress test case for open spark search page
imrthr Dec 4, 2024
fd54bf2
fix(open-spark): modified code to fix cosmetic chnge in hompge
aniketceminds Dec 4, 2024
3595feb
Merge pull request #2666 from beckn/fix/cosmetic-change-homepge
aniketceminds Dec 4, 2024
bc85109
Merge pull request #2663 from beckn/cypress-2467
aniketceminds Dec 4, 2024
ab352ce
Merge pull request #2665 from beckn/dragon-food-e2e-testing
aniketceminds Dec 4, 2024
d1cd9a0
feat(open-spark): api integration for dashboard page
skrushna1506 Dec 4, 2024
26d1c9b
Merge pull request #2669 from beckn/feat/api_integration_dashboard_to…
aniketceminds Dec 4, 2024
b394a70
feat(DSNP): fixed order history issue and footer css
imrthr Dec 5, 2024
87bf955
feat(P2P-ENERGY): added cypress test case for open spark product deta…
imrthr Dec 5, 2024
5acd6d2
feat(open-spark): modified code to add fie upload func
aniketceminds Dec 5, 2024
fba4fc8
Merge pull request #2685 from beckn/feat/issue-2643
aniketceminds Dec 5, 2024
975d21f
Merge pull request #2675 from beckn/issue-2449
aniketceminds Dec 5, 2024
5ab673f
Merge pull request #2684 from beckn/cypress-2468
aniketceminds Dec 5, 2024
4fc4853
feat: update and modify existing files for ongoing work
SanketEminds Dec 5, 2024
c074d2e
feat(P2P-ENERGY): added cypress test case for open spark cart page i…
imrthr Dec 6, 2024
ae0d255
feat: wip partial implementation, changes pending
SanketEminds Dec 6, 2024
3ae02da
feat: complete e2e tests for sky analytics
SanketEminds Dec 6, 2024
87a0c03
fix: modified code in retail cypress code for failure of tests
aniketceminds Nov 25, 2024
014e135
feat(open-spark): modified code to add trade details page
aniketceminds Dec 6, 2024
4776ae4
Merge pull request #2693 from beckn/feat/issue-2643-trade-details
aniketceminds Dec 6, 2024
4f565cd
Merge pull request #2587 from beckn/fix/mobility-test
aniketceminds Dec 6, 2024
f178625
Merge pull request #2686 from beckn/cypress-2469
aniketceminds Dec 9, 2024
a3f3a69
Merge pull request #2687 from beckn/sky-analytics-e2e-testing
aniketceminds Dec 9, 2024
c2015fe
feat(open-spark): added changes as per figma for my ders page
skrushna1506 Dec 6, 2024
2975f6b
Merge pull request #2690 from beckn/feat/myDersPage
aniketceminds Dec 9, 2024
3853625
feat: wip partial implementation, changes pending
SanketEminds Dec 9, 2024
a777ad7
fix: fixed scroll issue on firefox for climate apps
imrthr Dec 9, 2024
a666ff1
feat: final implementation with all necessary changes
SanketEminds Dec 9, 2024
74f4d5a
feat(open-spark): api integration for my ders page
skrushna1506 Dec 9, 2024
6b054d2
fix(open-spark): modified code in date-selection to fix calender date…
aniketceminds Dec 9, 2024
da3ad96
Merge pull request #2704 from beckn/fix/date-range
aniketceminds Dec 9, 2024
b650abc
Merge pull request #2701 from beckn/issue-2700
aniketceminds Dec 9, 2024
d8e2609
Merge pull request #2702 from beckn/harmoniAid-e2e-testing
aniketceminds Dec 9, 2024
07e3212
Merge pull request #2703 from beckn/feat/api_integration_myDers
aniketceminds Dec 9, 2024
95ffff5
Create main-1.1.0-aws-amplify-deploy.yml
em-tpt-bbandi Dec 10, 2024
2de1e84
feat(open-spark): integrated the cred APIs and profile section APIs
aniketceminds Dec 10, 2024
d627d9d
Merge pull request #2709 from beckn/feat/integraion-cred-profile
aniketceminds Dec 10, 2024
262d0cd
feat: add e2e testing changes and update testing IDs for forest conse…
SanketEminds Dec 10, 2024
d28a6ae
feat(open-spark): api integration for open spark
skrushna1506 Dec 11, 2024
fb63e8c
Merge pull request #2723 from beckn/feat/api_integration_dashboard_tr…
aniketceminds Dec 11, 2024
4eb056a
feat(open-spark): modified code to integrate delete cred
aniketceminds Dec 11, 2024
bc1a38a
Merge pull request #2727 from beckn/feat/delete-cred-integration
aniketceminds Dec 11, 2024
5942ec8
fix: apply requested changes for pull request review
SanketEminds Dec 11, 2024
c25d006
feat: wip partial implementation, changes pending
SanketEminds Dec 9, 2024
73f0704
feat: add e2e testing changes and update testing IDs for forest conse…
SanketEminds Dec 10, 2024
1fb0eb2
fix: apply requested changes for pull request review
SanketEminds Dec 11, 2024
2ef2b5c
fix: conflict resolved
SanketEminds Dec 11, 2024
6b0cc93
fix(open-spark): modified code to fix cosmetci UI and code level bugs
aniketceminds Dec 11, 2024
4c48833
Merge pull request #2729 from beckn/fix/cosmetic-bug
aniketceminds Dec 11, 2024
1d792bc
fix: fixed search bar spacing issue on search input
imrthr Dec 11, 2024
eb7840d
Merge pull request #2716 from beckn/forest-conservation-e2e-testing
SanketEminds Dec 11, 2024
2403c8e
fix(open-spark): fixed issue whick discussed during demo call
skrushna1506 Dec 11, 2024
bf9ba28
Merge pull request #2733 from beckn/issues-spacingInSearchBar
aniketceminds Dec 12, 2024
e31a7a9
Merge pull request #2736 from beckn/fix/open-spark-demo-bugs
aniketceminds Dec 12, 2024
2d9ec3b
fix: added min height on short description area for state forest dep
imrthr Dec 12, 2024
0c53bb7
feat(P2P-ENERGY): added cypress test case for open spark checkout pa…
imrthr Dec 11, 2024
575f13f
fix: fixed font discrepancy in price and rating filters
imrthr Dec 12, 2024
0a43d94
feat(open-spark): modified code to impl admin bap flow
aniketceminds Dec 12, 2024
1e1a7f9
Merge pull request #2751 from beckn/feat/admin-bap-flow
aniketceminds Dec 12, 2024
e1a036f
Merge pull request #2743 from beckn/cypress-2734
aniketceminds Dec 12, 2024
6611348
Merge pull request #2750 from beckn/issue-2748
aniketceminds Dec 12, 2024
34a00a6
Merge pull request #2732 from beckn/cypress-2448
aniketceminds Dec 12, 2024
3997dbc
fix(open-spark): modified code to fix minor cosmetic css issues
aniketceminds Dec 12, 2024
141b2b1
fix: update test ids for all product page
SanketEminds Dec 12, 2024
bef79b7
Merge pull request #2755 from beckn/update-test-ids
aniketceminds Dec 12, 2024
c67cf1f
fix: climate, forest app cors error fix
aniketceminds Dec 12, 2024
25aea56
Merge pull request #2757 from beckn/fix/cors-err
aniketceminds Dec 12, 2024
5a7a8d1
fix(open-spark): fixed functional issues and added alert modal while …
aniketceminds Dec 12, 2024
30db58c
Merge pull request #2752 from beckn/fix/ui-css-cosmetic-fix
aniketceminds Dec 12, 2024
d8a72fd
fix: modified code to fix cors err in climate, forest apps
aniketceminds Dec 13, 2024
8370a88
Merge pull request #2761 from beckn/fix/cors-err-climate-forest
aniketceminds Dec 13, 2024
048f4a2
fix: removed garuda pckg from all apps
aniketceminds Dec 13, 2024
c088cce
Merge pull request #2764 from beckn/fix/remove-garuda-pckg
aniketceminds Dec 13, 2024
4215d4e
Update develop-1.1.0-aws-amplify-deploy.yml
em-tpt-bbandi Dec 13, 2024
7d83956
fix(open-spark): fix styling in comp in dashboard, trade, my der page
aniketceminds Dec 14, 2024
f71d01c
Merge pull request #2769 from beckn/fix/cosmetic-style-fix
aniketceminds Dec 14, 2024
2da3f49
fix(open-spark): on dashboard current trade data text should be based…
skrushna1506 Dec 16, 2024
8b5e6f2
feat(P2P-ENERGY): added cypress test case for open spark confirmation…
imrthr Dec 17, 2024
a95b852
Merge pull request #2777 from beckn/fix/open-spark-bug
aniketceminds Dec 17, 2024
77f9116
Merge pull request #2778 from beckn/cypress-2471
aniketceminds Dec 17, 2024
bfc3844
feat(OPEN-SPARK): fixed prefix value of buying preference input and l…
imrthr Dec 17, 2024
3346abc
fix: update test ids for all cart pages
SanketEminds Dec 17, 2024
37129b7
Merge pull request #2780 from beckn/issue-open-spark
aniketceminds Dec 17, 2024
ea1798c
fix(open-spark): trade api route changes and other cosmetic changes
skrushna1506 Dec 17, 2024
1b4dec7
Merge pull request #2782 from beckn/fix/trade_api_integration
aniketceminds Dec 17, 2024
07d7733
Merge pull request #2783 from beckn/update-testids-in-cart
aniketceminds Dec 17, 2024
6a2e377
fix(open-spark): fixed minor functinal chnges in dashboard, trade det…
aniketceminds Dec 17, 2024
ef62a34
Merge pull request #2785 from beckn/fix/issue-cosmetic-functional
aniketceminds Dec 17, 2024
3cd70e8
feat(open-spark): modified code to add update trade api
aniketceminds Dec 17, 2024
2473db6
Merge pull request #2786 from beckn/fix/update-trade-intgrtion
aniketceminds Dec 17, 2024
d3eba3f
fix(open-spark): fixed document issue
skrushna1506 Dec 18, 2024
ffc64b3
Merge pull request #2787 from beckn/fix/myCred-document
skrushna1506 Dec 18, 2024
905ae16
feat(OPEN-SPARK): fixed prefix decrement value of buying preference i…
imrthr Dec 18, 2024
e146a22
Merge pull request #2788 from beckn/issue-open-spark-decreament
kundanEminds Dec 18, 2024
aba3263
fix(OPEN-SPARK): added kwh on input
imrthr Dec 18, 2024
ed5b60d
Merge pull request #2789 from beckn/issue-open-spark-workspace-bug
kundanEminds Dec 18, 2024
153a923
fix(open-spark): current trade will be result of 0th position
skrushna1506 Dec 18, 2024
c342ad6
Merge pull request #2790 from beckn/fix/open-spark-bugs
skrushna1506 Dec 18, 2024
de0f32a
fix(open-spark): fixed trade api url
skrushna1506 Dec 20, 2024
c3ac81e
Merge pull request #2819 from beckn/fix/trade_api_url_change
skrushna1506 Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/open-spark/components/energyPurchaseForm/index.tsx
Original file line number Diff line number Diff line change
@@ -108,7 +108,16 @@ export default function EnergyPurchaseForm({ preferenceType }: EnergyPurchaseFor

if (response.status === 200 || response.status === 204) {
console.log('Trade created successfully:', response.data)
router.push('/')
if (role !== ROLE.PRODUCER) {
router.push({
pathname: '/',
query: { id: response.data?.id }
})
} else {
router.push({
pathname: '/'
})
}
}
} catch (error) {
console.error('Error creating trade:', error)
1 change: 1 addition & 0 deletions apps/open-spark/lib/types/dashboard.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ export interface CurrentTradeData {
symbol: string
}
export type StatusItem = {
isPending?: boolean
label: string | React.ReactNode
status?: string
statusTime?: string
50 changes: 26 additions & 24 deletions apps/open-spark/pages/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ import Cookies from 'js-cookie'
import axios from 'axios'
import { DashboardData, StatusItem, TradeData } from '@lib/types/dashboard'
import { parseAndFormatDate } from '@utils/parsedFormatDate-utils'
import PendingIcon from '@public/images/pending.svg'

const Dashboard = () => {
const { t } = useLanguage()
@@ -103,32 +104,30 @@ const Dashboard = () => {
}, [role, bapDashboardData, bppDashboardData, startDate, endDate])

const fetchLastTradeData = async () => {
try {
const response = await axios.get(`${strapiUrl}${ROUTE_TYPE[role!]}/trade`, {
headers: { Authorization: `Bearer ${bearerToken}` },
withCredentials: true
})
const routerQueryId = router.query?.id
if (routerQueryId) {
try {
const response = await axios.get(`${strapiUrl}${ROUTE_TYPE[role!]}/trade?id=${routerQueryId}`, {
headers: { Authorization: `Bearer ${bearerToken}` },
withCredentials: true
})

const result = response.data
const result = response.data
const mappedTrade: TradeData = {
id: result.id,
quantity: result.quantity,
price: result.price || 0
}

const lastTrade = result[result.length - 1]
setCurrentTradeData([mappedTrade])
const statusData = createStatusData(result)
setCurrentStatusData(statusData)

const mappedTrade: TradeData = {
id: lastTrade.id,
quantity: lastTrade.quantity,
price: lastTrade.price || 0
const tags = [result.trusted_source && 'Trusted Source', result.cred_required && 'Solar Energy'].filter(Boolean)
setPreferencesTags(tags)
} catch (error) {
console.error('Error fetching last trade data:', error)
}

setCurrentTradeData([mappedTrade])
const statusData = createStatusData(lastTrade)
setCurrentStatusData(statusData)

const tags = [lastTrade.trusted_source && 'Trusted Source', lastTrade.cred_required && 'Solar Energy'].filter(
Boolean
)
setPreferencesTags(tags)
} catch (error) {
console.error('Error fetching last trade data:', error)
}
}

@@ -183,19 +182,21 @@ const Dashboard = () => {
const createStatusData = (tradeData: { status: string; createdAt: string }) => {
const { status, createdAt } = tradeData
const statusTime = formatDate(createdAt, 'hh:mm a')
const label = status === 'RECEIVED' ? 'Requirement Received' : 'Requirement Completed'
const isPending = status === 'RECEIVED'

return [
{
label,
label: isPending ? 'Requirement Received' : 'Requirement Completed',
status,
statusTime,
noLine: false,
isPending,
lastElement: false
},
{
label: <StatusLabel />,
statusTime: '',
isPending,
noLine: true,
lastElement: true
}
@@ -378,6 +379,7 @@ const Dashboard = () => {
statusTime={data.statusTime!}
noLine={data.noLine}
lastElement={data.lastElement}
statusIcon={data.isPending ? PendingIcon : null}
/>
))
) : (
27 changes: 26 additions & 1 deletion apps/open-spark/pages/tradeDetails.tsx
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import { formatDate } from '@beckn-ui/common'
import CurrentTrade from '@components/currentTrade/CurrentTrade'
import { Box, Divider, Flex, Stack, Tag, TagLabel } from '@chakra-ui/react'
import { OrderStatusProgress } from '@beckn-ui/becknified-components'
import PendingIcon from '@public/images/pending.svg'

interface TradeMetaData {
orderId: string
@@ -23,6 +24,17 @@ interface TradeMetaData {
preferencesTags: string[]
}

const TRADDE_EVE_NUM = Object.freeze({
BUY_REQUEST: 'buy_request',
BECKN_SEARCH: 'beckn_search',
BECKN_ON_SEARCH: 'beckn_on_search',
BECKN_INIT: 'beckn_init',
BECKN_ON_INIT: 'beckn_on_init',
BECKN_CONFIRM: 'beckn_confirm',
BECKN_ON_CONFIRM: 'beckn_on_confirm',
PENDING: 'pending'
})

const TradeDetails = () => {
const bearerToken = Cookies.get('authToken')
const strapiUrl = process.env.NEXT_PUBLIC_STRAPI_URL
@@ -52,6 +64,18 @@ const TradeDetails = () => {
if (result.cred_required) {
tags.push('Solar Energy')
}
const tradeEvents = result.trade_events || []
const lastEvent = tradeEvents[tradeEvents.length - 1]

if (!lastEvent || lastEvent.event_name !== TRADDE_EVE_NUM.BECKN_ON_CONFIRM) {
tradeEvents.push({
id: tradeEvents.length + 1,
event_name: TRADDE_EVE_NUM.PENDING,
description: 'Pending',
createdAt: new Date().toISOString()
})
}

setTradeDetails({
orderId: result.orderId,
name: result.item_name,
@@ -197,7 +221,8 @@ const TradeDetails = () => {
label={data.description}
statusTime={formatDate(data.createdAt, "do MMM yyyy',' hh:mm a")}
noLine={true}
lastElement={false}
lastElement={index === tradeDetails.tradeEvents.length - 1}
statusIcon={data.event_name === TRADDE_EVE_NUM.PENDING ? PendingIcon : null}
/>
))}
</Stack>
3 changes: 3 additions & 0 deletions apps/open-spark/public/images/pending.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -3,13 +3,15 @@ import { Box, Flex, Image } from '@chakra-ui/react'
import { Typography } from '@beckn-ui/molecules'
import LineBlack from '../../../public/images/lineBlack.svg'
import TrackIcon from '../../../public/images/TrackIcon.svg'
import PendingIcon from '../../../public/images/pendingStatus.svg'
import { OrderStatusProgressProps } from './order-status-progress.types'

const OrderStatusProgress: React.FC<OrderStatusProgressProps> = ({
label,
statusTime,
className = '',
noLine = false,
statusIcon,
lastElement,
statusDescription,
dataTestStateName = 'statusName',
@@ -30,7 +32,7 @@ const OrderStatusProgress: React.FC<OrderStatusProgressProps> = ({
maxW={'unset'}
width="18px"
height="18px"
src={TrackIcon}
src={statusIcon || TrackIcon}
/>
{!showNoLine && (
<Image
Original file line number Diff line number Diff line change
@@ -8,4 +8,5 @@ export interface OrderStatusProgressProps {
dataTestStateTime?: string
statusDescription?: string
dataTestStateDescription?: string
statusIcon?: string
}