Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
7fec8a88
Commit
7fec8a88
authored
May 03, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove security score experiment
parent
67c6404a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
20 deletions
+7
-20
init.ts
lib/growthbook/init.ts
+0
-1
MarketplaceAppModal.tsx
ui/marketplace/MarketplaceAppModal.tsx
+1
-3
MarketplaceAppTopBar.tsx
ui/marketplace/MarketplaceAppTopBar.tsx
+1
-3
Marketplace.pw.tsx
ui/pages/Marketplace.pw.tsx
+2
-8
Marketplace.tsx
ui/pages/Marketplace.tsx
+3
-5
No files found.
lib/growthbook/init.ts
View file @
7fec8a88
...
@@ -7,7 +7,6 @@ import { STORAGE_KEY, STORAGE_LIMIT } from './consts';
...
@@ -7,7 +7,6 @@ import { STORAGE_KEY, STORAGE_LIMIT } from './consts';
export
interface
GrowthBookFeatures
{
export
interface
GrowthBookFeatures
{
test_value
:
string
;
test_value
:
string
;
security_score_exp
:
boolean
;
}
}
export
const
growthBook
=
(()
=>
{
export
const
growthBook
=
(()
=>
{
...
...
ui/marketplace/MarketplaceAppModal.tsx
View file @
7fec8a88
...
@@ -7,7 +7,6 @@ import React, { useCallback } from 'react';
...
@@ -7,7 +7,6 @@ import React, { useCallback } from 'react';
import
type
{
MarketplaceAppWithSecurityReport
}
from
'
types/client/marketplace
'
;
import
type
{
MarketplaceAppWithSecurityReport
}
from
'
types/client/marketplace
'
;
import
{
ContractListTypes
}
from
'
types/client/marketplace
'
;
import
{
ContractListTypes
}
from
'
types/client/marketplace
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
nbsp
}
from
'
lib/html-entities
'
;
import
{
nbsp
}
from
'
lib/html-entities
'
;
import
*
as
mixpanel
from
'
lib/mixpanel/index
'
;
import
*
as
mixpanel
from
'
lib/mixpanel/index
'
;
...
@@ -33,7 +32,6 @@ const MarketplaceAppModal = ({
...
@@ -33,7 +32,6 @@ const MarketplaceAppModal = ({
data
,
data
,
showContractList
:
showContractListProp
,
showContractList
:
showContractListProp
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
security_score_exp
'
,
false
);
const
starOutlineIconColor
=
useColorModeValue
(
'
gray.600
'
,
'
gray.300
'
);
const
starOutlineIconColor
=
useColorModeValue
(
'
gray.600
'
,
'
gray.300
'
);
const
{
const
{
...
@@ -183,7 +181,7 @@ const MarketplaceAppModal = ({
...
@@ -183,7 +181,7 @@ const MarketplaceAppModal = ({
/>
/>
</
Flex
>
</
Flex
>
{
(
isExperiment
&&
securityReport
)
&&
(
{
securityReport
&&
(
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
AppSecurityReport
<
AppSecurityReport
id=
{
id
}
id=
{
id
}
...
...
ui/marketplace/MarketplaceAppTopBar.tsx
View file @
7fec8a88
...
@@ -8,7 +8,6 @@ import { route } from 'nextjs-routes';
...
@@ -8,7 +8,6 @@ import { route } from 'nextjs-routes';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
...
@@ -31,7 +30,6 @@ const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => {
...
@@ -31,7 +30,6 @@ const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => {
const
[
showContractList
,
setShowContractList
]
=
useBoolean
(
false
);
const
[
showContractList
,
setShowContractList
]
=
useBoolean
(
false
);
const
appProps
=
useAppContext
();
const
appProps
=
useAppContext
();
const
isMobile
=
useIsMobile
();
const
isMobile
=
useIsMobile
();
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
security_score_exp
'
,
false
);
const
goBackUrl
=
React
.
useMemo
(()
=>
{
const
goBackUrl
=
React
.
useMemo
(()
=>
{
if
(
appProps
.
referrer
&&
appProps
.
referrer
.
includes
(
'
/apps
'
)
&&
!
appProps
.
referrer
.
includes
(
'
/apps/
'
))
{
if
(
appProps
.
referrer
&&
appProps
.
referrer
.
includes
(
'
/apps
'
)
&&
!
appProps
.
referrer
.
includes
(
'
/apps/
'
))
{
...
@@ -72,7 +70,7 @@ const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => {
...
@@ -72,7 +70,7 @@ const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => {
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
MarketplaceAppInfo
data=
{
data
}
/>
<
MarketplaceAppInfo
data=
{
data
}
/>
</
Skeleton
>
</
Skeleton
>
{
(
isExperiment
&&
(
securityReport
||
isLoading
)
)
&&
(
{
(
securityReport
||
isLoading
)
&&
(
<
AppSecurityReport
<
AppSecurityReport
id=
{
data
?.
id
||
''
}
id=
{
data
?.
id
||
''
}
securityReport=
{
securityReport
}
securityReport=
{
securityReport
}
...
...
ui/pages/Marketplace.pw.tsx
View file @
7fec8a88
...
@@ -46,14 +46,11 @@ test('with banner +@dark-mode', async({ render, mockEnvs, mockConfigResponse })
...
@@ -46,14 +46,11 @@ test('with banner +@dark-mode', async({ render, mockEnvs, mockConfigResponse })
await
expect
(
component
).
toHaveScreenshot
();
await
expect
(
component
).
toHaveScreenshot
();
});
});
test
(
'
with scores +@dark-mode
'
,
async
({
render
,
mockConfigResponse
,
mockEnvs
,
mockFeatures
})
=>
{
test
(
'
with scores +@dark-mode
'
,
async
({
render
,
mockConfigResponse
,
mockEnvs
})
=>
{
const
MARKETPLACE_SECURITY_REPORTS_URL
=
'
https://marketplace-security-reports.json
'
;
const
MARKETPLACE_SECURITY_REPORTS_URL
=
'
https://marketplace-security-reports.json
'
;
await
mockEnvs
([
await
mockEnvs
([
[
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
],
[
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
],
]);
]);
await
mockFeatures
([
[
'
security_score_exp
'
,
true
],
]);
await
mockConfigResponse
(
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
,
JSON
.
stringify
(
securityReportsMock
));
await
mockConfigResponse
(
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
,
JSON
.
stringify
(
securityReportsMock
));
const
component
=
await
render
(<
Marketplace
/>);
const
component
=
await
render
(<
Marketplace
/>);
await
component
.
getByText
(
'
Apps scores
'
).
click
();
await
component
.
getByText
(
'
Apps scores
'
).
click
();
...
@@ -95,14 +92,11 @@ test.describe('mobile', () => {
...
@@ -95,14 +92,11 @@ test.describe('mobile', () => {
await
expect
(
component
).
toHaveScreenshot
();
await
expect
(
component
).
toHaveScreenshot
();
});
});
test
(
'
with scores
'
,
async
({
render
,
mockConfigResponse
,
mockEnvs
,
mockFeatures
})
=>
{
test
(
'
with scores
'
,
async
({
render
,
mockConfigResponse
,
mockEnvs
})
=>
{
const
MARKETPLACE_SECURITY_REPORTS_URL
=
'
https://marketplace-security-reports.json
'
;
const
MARKETPLACE_SECURITY_REPORTS_URL
=
'
https://marketplace-security-reports.json
'
;
await
mockEnvs
([
await
mockEnvs
([
[
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
],
[
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
],
]);
]);
await
mockFeatures
([
[
'
security_score_exp
'
,
true
],
]);
await
mockConfigResponse
(
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
,
JSON
.
stringify
(
securityReportsMock
));
await
mockConfigResponse
(
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
MARKETPLACE_SECURITY_REPORTS_URL
,
JSON
.
stringify
(
securityReportsMock
));
const
component
=
await
render
(<
Marketplace
/>);
const
component
=
await
render
(<
Marketplace
/>);
await
component
.
getByText
(
'
Apps scores
'
).
click
();
await
component
.
getByText
(
'
Apps scores
'
).
click
();
...
...
ui/pages/Marketplace.tsx
View file @
7fec8a88
...
@@ -7,7 +7,6 @@ import type { TabItem } from 'ui/shared/Tabs/types';
...
@@ -7,7 +7,6 @@ import type { TabItem } from 'ui/shared/Tabs/types';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
throwOnResourceLoadError
from
'
lib/errors/throwOnResourceLoadError
'
;
import
throwOnResourceLoadError
from
'
lib/errors/throwOnResourceLoadError
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
Banner
from
'
ui/marketplace/Banner
'
;
import
Banner
from
'
ui/marketplace/Banner
'
;
import
ContractListModal
from
'
ui/marketplace/ContractListModal
'
;
import
ContractListModal
from
'
ui/marketplace/ContractListModal
'
;
...
@@ -74,7 +73,6 @@ const Marketplace = () => {
...
@@ -74,7 +73,6 @@ const Marketplace = () => {
}
=
useMarketplace
();
}
=
useMarketplace
();
const
isMobile
=
useIsMobile
();
const
isMobile
=
useIsMobile
();
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
security_score_exp
'
,
false
);
const
categoryTabs
=
React
.
useMemo
(()
=>
{
const
categoryTabs
=
React
.
useMemo
(()
=>
{
const
tabs
:
Array
<
TabItem
>
=
categories
.
map
(
category
=>
({
const
tabs
:
Array
<
TabItem
>
=
categories
.
map
(
category
=>
({
...
@@ -189,7 +187,7 @@ const Marketplace = () => {
...
@@ -189,7 +187,7 @@ const Marketplace = () => {
</
Box
>
</
Box
>
<
Flex
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
mb=
{
{
base
:
4
,
lg
:
6
}
}
gap=
{
{
base
:
4
,
lg
:
3
}
}
>
<
Flex
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
mb=
{
{
base
:
4
,
lg
:
6
}
}
gap=
{
{
base
:
4
,
lg
:
3
}
}
>
{
(
feature
.
securityReportsUrl
&&
isExperiment
)
&&
(
{
feature
.
securityReportsUrl
&&
(
<
Skeleton
isLoaded=
{
!
isPlaceholderData
}
>
<
Skeleton
isLoaded=
{
!
isPlaceholderData
}
>
<
RadioButtonGroup
<
MarketplaceDisplayType
>
<
RadioButtonGroup
<
MarketplaceDisplayType
>
onChange=
{
onDisplayTypeChange
}
onChange=
{
onDisplayTypeChange
}
...
@@ -226,12 +224,12 @@ const Marketplace = () => {
...
@@ -226,12 +224,12 @@ const Marketplace = () => {
onChange=
{
onSearchInputChange
}
onChange=
{
onSearchInputChange
}
placeholder=
"Find app by name or keyword..."
placeholder=
"Find app by name or keyword..."
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
size=
{
(
feature
.
securityReportsUrl
&&
isExperiment
)
?
'
xs
'
:
'
sm
'
}
size=
{
feature
.
securityReportsUrl
?
'
xs
'
:
'
sm
'
}
flex=
"1"
flex=
"1"
/>
/>
</
Flex
>
</
Flex
>
{
(
selectedDisplayType
===
MarketplaceDisplayType
.
SCORES
&&
feature
.
securityReportsUrl
&&
isExperiment
)
?
(
{
(
selectedDisplayType
===
MarketplaceDisplayType
.
SCORES
&&
feature
.
securityReportsUrl
)
?
(
<
MarketplaceListWithScores
<
MarketplaceListWithScores
apps=
{
displayedApps
}
apps=
{
displayedApps
}
showAppInfo=
{
showAppInfo
}
showAppInfo=
{
showAppInfo
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment