-
Notifications
You must be signed in to change notification settings - Fork 40
feat(ui): ownership section (WIP) #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
cswni
wants to merge
6
commits into
next
Choose a base branch
from
app/feat/ui-ownership
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduced new components and updates for ownership management: - `ownership-table.tsx`: Displays the ownership list with pagination, sorting, and loading states. - `ownership-table-row.tsx`: Represents individual rows in the table, with settings and actions. - `ownership-create.tsx`: Implements a modal for registering ownership campaigns. - `ownership-modal-content.tsx`: Handles the content and logic for registering assets. - `ownership-settings-modal.tsx`: Modal for configuring ownership settings per asset. - `ownership-settings-modal-content.tsx`: Contains the form and fields for asset-specific configurations. Updated: - `ownership-view.tsx`: Integrated the new table and create ownership features. - `CONSTANTS.tsx`: Added labels and colors for ownership types and statuses. - `index.tsx`: Updated exports for ownership's main view.
- Add OwnershipTimelineModal for viewing asset history. - Remove unused `type` field from ownership data, constants, and UI. - Update OwnershipSettingsModal to dynamically fetch and upsert data. - Improve region handling with multi-select and checkbox UI. - Add `fetchAssetSettings` and `upsertAssetSettings` utilities.
- Add CustomRandom utility to generate pseudo-random numbers in `src/utils/random.ts`. The implementation uses a linear congruential generator (LCG). - Update key generation logic in `ownership-settings-modal-content.tsx` to improve `randomKey` usage by adding context-specific suffixes. - Replace `Math.random()` with `CustomRandom.get()` in `ownership-view.tsx` for generating random assets. Adjusted all relevant instances, including policies, statuses, and other random values.
- `src/pages/ownership.tsx`: - Wrapped `OwnershipView` with `WithAuth` for authentication checks. - Updated header title from "Ownership" to "Finance". - `src/sections/ownership/components/ownership-create.tsx`: - Renamed `confirmPublish` to `ownershipConfirmPublish` for clarity. - Updated modal title from "Register a campaign" to "Register an asset". - Improved modal behavior to better align with ownership use cases.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several new components and refactors existing ones in the
src/sections/ownership
directory. The changes include the addition of new modals, table components, and constants to enhance the ownership section's functionality.New Components and Modals:
src/sections/ownership/components/ownership-create.tsx
: Added a new component for creating ownership entries with a modal for user interaction.src/sections/ownership/components/ownership-modal-content.tsx
: Implemented the modal content for registering ownership, including form validation and asset registration logic.src/sections/ownership/components/ownership-settings-modal-content.tsx
: Added modal content for configuring ownership settings, including form validation and select input handling.src/sections/ownership/components/ownership-settings-modal.tsx
: Created a settings modal component to display the settings form.Table Enhancements:
src/sections/ownership/components/ownership-table.tsx
: Introduced a new table component for displaying ownership data, including pagination and loading states.src/sections/ownership/components/ownership-table-row.tsx
: Added a new table row component with settings and action buttons for each ownership entry.Constants and Types:
src/sections/ownership/CONSTANTS.tsx
: Defined new constants for table headers, status colors, type colors, and text mappings for regions and types.Refactoring:
src/sections/marketing/types.ts
: RefactoredCampaignTableRowType
from an interface to a type alias and removed theonConfirm
method fromCampaignModalContentProps
. [1] [2]src/sections/ownership/index.tsx
: Updated the export forOwnershipView
to a named export.