Update SettingsObjectAboutSection.tsx changed "Disable" CTA to "Deact… (#4175)
* Update SettingsObjectAboutSection.tsx changed "Disable" CTA to "Deactivate" * Update SettingsObjects.tsx Additional changes: Disabled sections to inactive * Update SettingsObjectAboutSection.tsx I think you meant changing Disable to Deactivate * Update and rename SettingsObjectDisabledMenuDropDown.tsx to SettingsObjectInactiveMenuDropDown.tsx additional changes to #4153 * Update SettingsObjects.tsx * Update and rename SettingsObjectDisabledMenuDropDown.stories.tsx to SettingsObjectInactiveMenuDropDown.stories.tsx * fix typescript errors * respect issue requirements --------- Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
This commit is contained in:
@ -16,7 +16,7 @@ export const useObjectMetadataItemForSettings = () => {
|
||||
const activeObjectMetadataItems = objectMetadataItems.filter(
|
||||
({ isActive, isSystem }) => isActive && !isSystem,
|
||||
);
|
||||
const disabledObjectMetadataItems = objectMetadataItems.filter(
|
||||
const inactiveObjectMetadataItems = objectMetadataItems.filter(
|
||||
({ isActive, isSystem }) => !isActive && !isSystem,
|
||||
);
|
||||
|
||||
@ -88,7 +88,7 @@ export const useObjectMetadataItemForSettings = () => {
|
||||
activateObjectMetadataItem,
|
||||
activeObjectMetadataItems,
|
||||
createObjectMetadataItem,
|
||||
disabledObjectMetadataItems,
|
||||
inactiveObjectMetadataItems,
|
||||
disableObjectMetadataItem,
|
||||
editObjectMetadataItem,
|
||||
eraseObjectMetadataItem,
|
||||
|
||||
@ -19,7 +19,7 @@ type SettingsAboutSectionProps = {
|
||||
iconKey?: string;
|
||||
isCustom: boolean;
|
||||
name: string;
|
||||
onDisable: () => void;
|
||||
onDeactivate: () => void;
|
||||
onEdit: () => void;
|
||||
};
|
||||
|
||||
@ -49,7 +49,7 @@ export const SettingsAboutSection = ({
|
||||
iconKey = '',
|
||||
isCustom,
|
||||
name,
|
||||
onDisable,
|
||||
onDeactivate,
|
||||
onEdit,
|
||||
}: SettingsAboutSectionProps) => {
|
||||
const theme = useTheme();
|
||||
@ -63,8 +63,8 @@ export const SettingsAboutSection = ({
|
||||
closeDropdown();
|
||||
};
|
||||
|
||||
const handleDisable = () => {
|
||||
onDisable();
|
||||
const handleDeactivate = () => {
|
||||
onDeactivate();
|
||||
closeDropdown();
|
||||
};
|
||||
|
||||
@ -92,9 +92,9 @@ export const SettingsAboutSection = ({
|
||||
onClick={handleEdit}
|
||||
/>
|
||||
<MenuItem
|
||||
text="Disable"
|
||||
text="Deactivate"
|
||||
LeftIcon={IconArchive}
|
||||
onClick={handleDisable}
|
||||
onClick={handleDeactivate}
|
||||
/>
|
||||
</DropdownMenuItemsContainer>
|
||||
</DropdownMenu>
|
||||
|
||||
@ -14,7 +14,7 @@ import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||
|
||||
type SettingsObjectFieldActiveActionDropdownProps = {
|
||||
isCustomField?: boolean;
|
||||
onDisable?: () => void;
|
||||
onDeactivate?: () => void;
|
||||
onEdit: () => void;
|
||||
onSetAsLabelIdentifier?: () => void;
|
||||
scopeKey: string;
|
||||
@ -22,7 +22,7 @@ type SettingsObjectFieldActiveActionDropdownProps = {
|
||||
|
||||
export const SettingsObjectFieldActiveActionDropdown = ({
|
||||
isCustomField,
|
||||
onDisable,
|
||||
onDeactivate,
|
||||
onEdit,
|
||||
onSetAsLabelIdentifier,
|
||||
scopeKey,
|
||||
@ -36,8 +36,8 @@ export const SettingsObjectFieldActiveActionDropdown = ({
|
||||
closeDropdown();
|
||||
};
|
||||
|
||||
const handleDisable = () => {
|
||||
onDisable?.();
|
||||
const handleDeactivate = () => {
|
||||
onDeactivate?.();
|
||||
closeDropdown();
|
||||
};
|
||||
|
||||
@ -67,11 +67,11 @@ export const SettingsObjectFieldActiveActionDropdown = ({
|
||||
onClick={handleSetAsLabelIdentifier}
|
||||
/>
|
||||
)}
|
||||
{!!onDisable && (
|
||||
{!!onDeactivate && (
|
||||
<MenuItem
|
||||
text="Disable"
|
||||
text="Deactivate"
|
||||
LeftIcon={IconArchive}
|
||||
onClick={handleDisable}
|
||||
onClick={handleDeactivate}
|
||||
/>
|
||||
)}
|
||||
</DropdownMenuItemsContainer>
|
||||
|
||||
@ -6,17 +6,17 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
|
||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||
|
||||
type SettingsObjectFieldDisabledActionDropdownProps = {
|
||||
type SettingsObjectFieldInactiveActionDropdownProps = {
|
||||
isCustomField?: boolean;
|
||||
onActivate: () => void;
|
||||
onErase: () => void;
|
||||
scopeKey: string;
|
||||
};
|
||||
|
||||
export const SettingsObjectFieldDisabledActionDropdown = ({
|
||||
export const SettingsObjectFieldInactiveActionDropdown = ({
|
||||
onActivate,
|
||||
scopeKey,
|
||||
}: SettingsObjectFieldDisabledActionDropdownProps) => {
|
||||
}: SettingsObjectFieldInactiveActionDropdownProps) => {
|
||||
const dropdownId = `${scopeKey}-settings-field-disabled-action-dropdown`;
|
||||
|
||||
const { closeDropdown } = useDropdown(dropdownId);
|
||||
|
||||
@ -6,20 +6,20 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
|
||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||
|
||||
type SettingsObjectDisabledMenuDropDownProps = {
|
||||
type SettingsObjectInactiveMenuDropDownProps = {
|
||||
isCustomObject: boolean;
|
||||
onActivate: () => void;
|
||||
onErase: () => void;
|
||||
scopeKey: string;
|
||||
};
|
||||
|
||||
export const SettingsObjectDisabledMenuDropDown = ({
|
||||
export const SettingsObjectInactiveMenuDropDown = ({
|
||||
onActivate,
|
||||
scopeKey,
|
||||
onErase,
|
||||
isCustomObject,
|
||||
}: SettingsObjectDisabledMenuDropDownProps) => {
|
||||
const dropdownId = `${scopeKey}-settings-object-disabled-menu-dropdown`;
|
||||
}: SettingsObjectInactiveMenuDropDownProps) => {
|
||||
const dropdownId = `${scopeKey}-settings-object-inactive-menu-dropdown`;
|
||||
|
||||
const { closeDropdown } = useDropdown(dropdownId);
|
||||
|
||||
@ -3,7 +3,7 @@ import { expect, fn, userEvent, within } from '@storybook/test';
|
||||
|
||||
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
|
||||
|
||||
import { SettingsObjectDisabledMenuDropDown } from '../SettingsObjectDisabledMenuDropDown';
|
||||
import { SettingsObjectInactiveMenuDropDown } from '../SettingsObjectInactiveMenuDropDown';
|
||||
|
||||
const handleActivateMockFunction = fn();
|
||||
const handleEraseMockFunction = fn();
|
||||
@ -16,11 +16,11 @@ const ClearMocksDecorator: Decorator = (Story, context) => {
|
||||
return <Story />;
|
||||
};
|
||||
|
||||
const meta: Meta<typeof SettingsObjectDisabledMenuDropDown> = {
|
||||
title: 'Modules/Settings/DataModel/SettingsObjectDisabledMenuDropDown',
|
||||
component: SettingsObjectDisabledMenuDropDown,
|
||||
const meta: Meta<typeof SettingsObjectInactiveMenuDropDown> = {
|
||||
title: 'Modules/Settings/DataModel/SettingsObjectInactiveMenuDropDown',
|
||||
component: SettingsObjectInactiveMenuDropDown,
|
||||
args: {
|
||||
scopeKey: 'settings-object-disabled-menu-dropdown',
|
||||
scopeKey: 'settings-object-inactive-menu-dropdown',
|
||||
onActivate: handleActivateMockFunction,
|
||||
onErase: handleEraseMockFunction,
|
||||
},
|
||||
@ -31,7 +31,7 @@ const meta: Meta<typeof SettingsObjectDisabledMenuDropDown> = {
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof SettingsObjectDisabledMenuDropDown>;
|
||||
type Story = StoryObj<typeof SettingsObjectInactiveMenuDropDown>;
|
||||
|
||||
export const Default: Story = {};
|
||||
|
||||
Reference in New Issue
Block a user