Skip to content

Conversation

steveninhle
Copy link
Collaborator

No description provided.

@steveninhle steveninhle changed the title feat: flags discard change feat(ui/dashboard): flags discard change Sep 10, 2025
@steveninhle steveninhle force-pushed the feat-flags-discard-change branch 2 times, most recently from fb1ad41 to 8cf02cd Compare September 16, 2025 06:53
@steveninhle steveninhle marked this pull request as ready for review September 16, 2025 08:07
@cre8ivejp cre8ivejp requested a review from Copilot September 22, 2025 02:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a comprehensive "discard changes" feature for the feature flag details targeting system. It adds functionality to track and revert unsaved changes in different sections of the targeting configuration.

  • Adds a discard changes modal with support for multiple change types (prerequisites, individual rules, custom rules, default rules)
  • Implements change tracking and comparison utilities for detecting modifications in targeting configurations
  • Adds undo buttons throughout the targeting interface to trigger discard operations

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ui/dashboard/src/utils/style.ts Adds capitalize utility function for string formatting
ui/dashboard/src/utils/data-type.ts Updates isEmpty function to support generic array types
ui/dashboard/src/pages/feature-flag-details/targeting/utils.ts Adds extensive discard changes logic and utility functions
ui/dashboard/src/pages/feature-flag-details/targeting/types.ts Defines types for discard changes functionality
ui/dashboard/src/pages/feature-flag-details/targeting/segment-rule/rule.tsx Adds null safety for feature rules and clauses
ui/dashboard/src/pages/feature-flag-details/targeting/segment-rule/index.tsx Replaces remove button with undo button for discard changes
ui/dashboard/src/pages/feature-flag-details/targeting/prerequisite-rule/index.tsx Adds undo button for prerequisite rule discard changes
ui/dashboard/src/pages/feature-flag-details/targeting/prerequisite-rule/condition.tsx Adds validation and auto-selection for prerequisite variations
ui/dashboard/src/pages/feature-flag-details/targeting/individual-rule/index.tsx Adds undo button for individual rule discard changes
ui/dashboard/src/pages/feature-flag-details/targeting/index.tsx Integrates discard changes functionality into main targeting component
ui/dashboard/src/pages/feature-flag-details/targeting/default-rule/index.tsx Adds undo button for default rule discard changes
ui/dashboard/src/pages/feature-flag-details/elements/discard-changes-modal/index.tsx Implements the discard changes modal component
ui/dashboard/src/components/date-time-picker/custom-datepicker.css Fixes z-index for datepicker triangle
ui/dashboard/src/@types/feature.ts Adds type field to FeatureRuleClause
ui/dashboard/src/@locales/ja/form.json Adds Japanese translations for discard changes
ui/dashboard/src/@locales/ja/common.json Adds Japanese translations for common discard actions
ui/dashboard/src/@locales/en/form.json Adds English translations for discard changes
ui/dashboard/src/@locales/en/common.json Adds English translations for common discard actions
ui/dashboard/src/@icons/index.tsx Exports new warning and arrow icons

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 4 to 5
import { capitalize } from 'lodash';
import { cn } from 'utils/style';
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import uses lodash's capitalize function, but the project has a custom capitalize function in utils/style.ts. The imports should be consistent - either use the custom function or ensure the lodash version is intended.

Suggested change
import { capitalize } from 'lodash';
import { cn } from 'utils/style';
import { capitalize, cn } from 'utils/style';

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed b461ec6

"custom-rule-audience-not-include-desc": "<p>この配分に含まれていない <b>{{percent}}%</b> には <b>{{variation}}</b> が提供されます</p>",
"custom-rule-audience-include-desc": "<p>この配分に含まれている <b>{{percent}}%</b> には提供されます</p>",
"custom-rule-default-strategy-discard-desc": "デフォルトルールに設定",
"custom-rule-default-audience-discard-desc": "デフォルトオーディエンスに設定します"
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing comma after the translation value. This should end with a comma to maintain consistent JSON formatting.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed b461ec6

@steveninhle steveninhle force-pushed the feat-flags-discard-change branch from 7985caa to b461ec6 Compare September 22, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant