feat(cms): Add CMS table with delete and edit functionality

- Implement CMS table with row listing and pagination
- Add delete functionality for CMS entries with confirmation modal
- Introduce edit button to navigate to edit page for specific CMS entry
- Update page type form to include new 'key' field for CMS entries
- Modify CMS service and types to support new data structure
- Enhance table presenter with additional actions and state management
Resolves data management and user interaction improvements for CMS module
This commit is contained in:
AmirReza Jamali
2025-11-11 10:12:21 +03:30
parent 2b9eaa0495
commit b444f6a08f
7 changed files with 178 additions and 11 deletions
+21 -2
View File
@@ -24,6 +24,7 @@ interface IPageTypeFields {
language?: string;
company_name?: string;
country?: string;
key: string;
}
const Marketing = () => {
@@ -152,7 +153,8 @@ const Marketing = () => {
const finalData = {
...allData,
page_type: pageTypeData.type,
type: pageTypeData.type,
key: pageTypeData.key,
...(pageTypeData.type === "company" && {
language: pageTypeData.language,
company_name: pageTypeData.company_name,
@@ -229,7 +231,7 @@ const Marketing = () => {
{...registerPageType("type", {
required: { message: FormErrorMessages.required, value: true },
})}
name="page_type"
name="type"
label="Page Type"
required
items={[
@@ -310,6 +312,23 @@ const Marketing = () => {
{pageTypeErrors.country.message}
</p>
)}
<InputGroup
{...registerPageType("key", {
required: {
value: true,
message: FormErrorMessages.required,
},
})}
label="Page key"
name="key"
placeholder="Please enter page key"
type="text"
/>
{pageTypeErrors.key && (
<p className="mt-1 text-sm text-red-500">
{pageTypeErrors.key.message}
</p>
)}
</div>
</div>