Skip to content

Commit

Permalink
Merge branch 'dev' into featureflag/import-validation-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Yagnik56 authored Aug 21, 2024
2 parents 3828069 + 1af167c commit 41f4031
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ const reducer = createReducer(
const existingFlag = state.entities[featureFlag?.id];

if (existingFlag) {
const updatedInclusions = existingFlag.featureFlagSegmentInclusion.map((inclusion) =>
inclusion.segment.id === listResponse.segment.id ? listResponse : inclusion
);
const updatedInclusions =
existingFlag.featureFlagSegmentInclusion?.map((inclusion) =>
inclusion.segment.id === listResponse.segment.id ? listResponse : inclusion
) ?? [];

return adapter.updateOne(
{
Expand All @@ -179,14 +180,13 @@ const reducer = createReducer(
on(FeatureFlagsActions.actionDeleteFeatureFlagInclusionListSuccess, (state, { segmentId }) => {
const updatedState = { ...state, isLoadingUpsertPrivateSegmentList: false };
const flagId = Object.keys(state.entities).find((id) =>
state.entities[id].featureFlagSegmentInclusion.some((inclusion) => inclusion.segment.id === segmentId)
state.entities[id].featureFlagSegmentInclusion?.some((inclusion) => inclusion.segment.id === segmentId)
);

if (flagId) {
const flag = state.entities[flagId];
const updatedInclusions = flag.featureFlagSegmentInclusion.filter(
(inclusion) => inclusion.segment.id !== segmentId
);
const updatedInclusions =
flag.featureFlagSegmentInclusion?.filter((inclusion) => inclusion.segment.id !== segmentId) ?? [];

return adapter.updateOne(
{
Expand Down Expand Up @@ -231,9 +231,10 @@ const reducer = createReducer(
const existingFlag = state.entities[featureFlag?.id];

if (existingFlag) {
const updatedExclusions = existingFlag.featureFlagSegmentExclusion.map((exclusion) =>
exclusion.segment.id === listResponse.segment.id ? listResponse : exclusion
);
const updatedExclusions =
existingFlag.featureFlagSegmentExclusion?.map((exclusion) =>
exclusion.segment.id === listResponse.segment.id ? listResponse : exclusion
) ?? [];

return adapter.updateOne(
{
Expand All @@ -255,14 +256,13 @@ const reducer = createReducer(
on(FeatureFlagsActions.actionDeleteFeatureFlagExclusionListSuccess, (state, { segmentId }) => {
const updatedState = { ...state, isLoadingUpsertPrivateSegmentList: false };
const flagId = Object.keys(state.entities).find((id) =>
state.entities[id].featureFlagSegmentExclusion.some((exclusion) => exclusion.segment.id === segmentId)
state.entities[id].featureFlagSegmentExclusion?.some((exclusion) => exclusion.segment.id === segmentId)
);

if (flagId) {
const flag = state.entities[flagId];
const updatedExclusions = flag.featureFlagSegmentExclusion.filter(
(exclusion) => exclusion.segment.id !== segmentId
);
const updatedExclusions =
flag.featureFlagSegmentExclusion?.filter((exclusion) => exclusion.segment.id !== segmentId) ?? [];

return adapter.updateOne(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button
*ngFor="let item of menuButtonItems"
mat-menu-item
[disabled]="item.disabled"
(click)="onMenuButtonItemClick(item.name)"
>
<span class="ft-14-400">{{ item.name }}</span>
</button>
<ng-container *ngFor="let item of menuButtonItems">
<button
*ngIf="!item.disabled"
mat-menu-item
(click)="onMenuButtonItemClick(item.name)"
>
<span class="ft-14-400">{{ item.name }}</span>
</button>
</ng-container>
</mat-menu>

<button
Expand Down

0 comments on commit 41f4031

Please sign in to comment.