You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Using allowlist.length would require adding it as a dependency of useEffect.
43
+
// This causes an unintended behavior of automatically selecting the first item when the user unselects all checkboxes. (making it impossible to make allowlist empty).
@@ -99,7 +119,7 @@ export function AllowlistDialog({
99
119
<Button
100
120
size="1"
101
121
onClick={handleSelectAll}
102
-
disabled={isEqual(filteredHosts,allowlist)}
122
+
disabled={isSelectAllDisabled}
103
123
>
104
124
Select all
105
125
</Button>
@@ -117,21 +137,28 @@ export function AllowlistDialog({
117
137
<Cardsize="1"mb="2">
118
138
<Insetcss={{height: '210px'}}>
119
139
<ScrollAreascrollbars="vertical"type="always">
120
-
<Flexp="2"pr="4"asChildoverflow="hidden">
121
-
<CheckboxGroup.Root
122
-
size="2"
123
-
value={allowlist}
140
+
<Flexdirection="column"pt="2">
141
+
{firstPartyFilteredHosts.length>0&&(
142
+
<AllowlistSeparatortext="Hosts"/>
143
+
)}
144
+
<AllowlistCheckGroup
145
+
allowlist={allowlist}
124
146
onValueChange={handleChangeHosts}
125
-
>
126
-
{filteredHosts.map((host)=>(
127
-
<Textas="label"size="2"key={host}>
128
-
<Flexgap="2">
129
-
<CheckboxGroup.Itemvalue={host}/>{' '}
130
-
<Texttruncate>{host}</Text>
131
-
</Flex>
132
-
</Text>
133
-
))}
134
-
</CheckboxGroup.Root>
147
+
hosts={firstPartyFilteredHosts}
148
+
/>
149
+
{thirdPartyFilteredHosts.length>0&&(
150
+
<>
151
+
<AllowlistSeparator
152
+
text="3rd party hosts"
153
+
tooltip="Selecting third-party hosts may include irrelevant or sensitive data outside your control. It is recommended that only hosts directly related to your app are selected."
154
+
/>
155
+
<AllowlistCheckGroup
156
+
allowlist={allowlist}
157
+
onValueChange={handleChangeHosts}
158
+
hosts={thirdPartyFilteredHosts}
159
+
/>
160
+
</>
161
+
)}
135
162
</Flex>
136
163
</ScrollArea>
137
164
</Inset>
@@ -150,3 +177,34 @@ export function AllowlistDialog({
0 commit comments