Skip to content

Commit 702f56a

Browse files
Merge pull request #1346 from devtron-labs/fix/modal-env_filter
fix: filter in unatuh apps
2 parents 401342b + 1b01ac8 commit 702f56a

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

src/components/ApplicationGroup/CreateAppGroup.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ export default function CreateAppGroup({
163163
? _unauthorizedAppList.push({ id: app.id, appName: app.appName })
164164
: _authorizedAppList.push({ id: app.id, appName: app.appName })
165165
})
166-
_unauthorizedAppList.filter(
167-
(app) =>
168-
selectedAppsMap[app.id] && (!selectedAppSearchText || app.appName.indexOf(selectedAppSearchText) >= 0),
169-
)
170166
setUnauthorizedAppList(_unauthorizedAppList)
171167
setAuthorizedAppList(_authorizedAppList)
172168
}
@@ -187,6 +183,10 @@ export default function CreateAppGroup({
187183
(app) =>
188184
selectedAppsMap[app.id] && (!selectedAppSearchText || app.appName.indexOf(selectedAppSearchText) >= 0),
189185
)
186+
const filteredUnAuthList = unauthorizedAppList.filter(
187+
(app) =>
188+
selectedAppsMap[app.id] && (!selectedAppSearchText || app.appName.indexOf(selectedAppSearchText) >= 0),
189+
)
190190
return (
191191
<div>
192192
<SearchBar
@@ -197,7 +197,7 @@ export default function CreateAppGroup({
197197
setSearchApplied={setSelectedAppSearchApplied}
198198
/>
199199
<div>
200-
{filteredAuthList.length <= 0
200+
{filteredAuthList.length <= 0 && filteredUnAuthList.length <= 0
201201
? renderEmptyState('No matching results')
202202
: filteredAuthList.map((app) => {
203203
return (
@@ -213,12 +213,12 @@ export default function CreateAppGroup({
213213
</div>
214214
)
215215
})}
216-
{unauthorizedAppList.length > 0 && (
216+
{filteredUnAuthList.length > 0 && (
217217
<div className="dc__bold ml-4">
218218
{`You don't have admin/manager pemission for the following ${filterParentTypeMsg}.`}
219219
</div>
220220
)}
221-
{unauthorizedAppList.map((app) => {
221+
{filteredUnAuthList.map((app) => {
222222
return (
223223
<Tippy
224224
key={`selected-app-${app.id}`}

src/components/app/details/app.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,23 @@
5050
}
5151
}
5252
}
53+
54+
.create-group-container,
55+
.env-header-tab {
56+
.tab-list {
57+
.tab-list__tab {
58+
.tab-hover {
59+
&:hover,
60+
&.active {
61+
color: var(--B500);
62+
}
63+
}
64+
.apps-tab__active-tab {
65+
height: 2px;
66+
background-color: var(--B500);
67+
border-radius: 2px 2px 0px 0px;
68+
margin-top: -1px;
69+
}
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)