Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
asimonok committed Jun 20, 2024
1 parent 9c59c51 commit a251d8d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/FormPanel/FormPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import {
import React, { useCallback, useEffect, useMemo, useState } from 'react';

import {
ConfirmationElementDisplayMode,
ContentType,
DisplayedModalElements,
FormElementType,
LayoutOrientation,
LayoutVariant,
Expand Down Expand Up @@ -1082,7 +1082,7 @@ export const FormPanel: React.FC<Props> = ({
*/
if (
element.value === initial[element.id] &&
options.confirmModal.displayedModalElements !== DisplayedModalElements.ALL
options.confirmModal.elementDisplayMode !== ConfirmationElementDisplayMode.ALL
) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/constants/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '../types';
import { CODE_EDITOR_CONFIG } from './code-editor';
import { FormElementType, OptionsSource } from './form-element';
import { ConfirmationElementDisplayMode } from './request';

/**
* Initial Request
Expand Down Expand Up @@ -195,5 +196,5 @@ export const CONFIRM_MODAL_DEFAULT: ModalOptions = {
},
confirm: 'Confirm',
cancel: 'Cancel',
displayedModalElements: 'modified',
elementDisplayMode: ConfirmationElementDisplayMode.MODIFIED,
};
12 changes: 6 additions & 6 deletions src/constants/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ export const UPDATE_ENABLED_OPTIONS = [
];

/**
* Displayed Modal Elements
* Confirmation Element Display Mode
*/
export const enum DisplayedModalElements {
export const enum ConfirmationElementDisplayMode {
ALL = 'all',
MODIFIED = 'modified',
}

/**
* Modified modal elements Options
* Confirmation Element Display Mode Options
*/
export const DISPLAYED_MODAL_ELEMENTS_OPTIONS = [
{ label: 'All Elements', value: DisplayedModalElements.ALL },
{ label: 'Modified Elements', value: DisplayedModalElements.MODIFIED },
export const CONFIRMATION_ELEMENT_DISPLAY_MODE_OPTIONS = [
{ label: 'All Elements', value: ConfirmationElementDisplayMode.ALL },
{ label: 'Modified Elements', value: ConfirmationElementDisplayMode.MODIFIED },
];
8 changes: 4 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import {
BUTTON_VARIANT_OPTIONS,
CONFIRM_MODAL_COLUMNS_INCLUDE_OPTIONS,
CONFIRM_MODAL_DEFAULT,
CONFIRMATION_ELEMENT_DISPLAY_MODE_OPTIONS,
ConfirmationElementDisplayMode,
CONTENT_TYPE_OPTIONS,
ContentType,
DATA_SYNC_OPTIONS,
DISPLAYED_MODAL_ELEMENTS_OPTIONS,
DisplayedModalElements,
INITIAL_CODE_DEFAULT,
INITIAL_HIGHLIGHT_COLOR_DEFAULT,
INITIAL_PAYLOAD_DEFAULT,
Expand Down Expand Up @@ -469,9 +469,9 @@ export const plugin = new PanelPlugin<PanelOptions>(FormPanel)
description: 'Choose what elements will be displayed in modal window.',
category: ['Update Confirmation Window'],
settings: {
options: DISPLAYED_MODAL_ELEMENTS_OPTIONS,
options: CONFIRMATION_ELEMENT_DISPLAY_MODE_OPTIONS,
},
defaultValue: DisplayedModalElements.MODIFIED,
defaultValue: ConfirmationElementDisplayMode.MODIFIED,
})
.addTextInput({
path: 'confirmModal.body',
Expand Down
6 changes: 4 additions & 2 deletions src/types/modal.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ConfirmationElementDisplayMode } from '../constants';

/**
* Modal Column Name
*/
Expand Down Expand Up @@ -73,9 +75,9 @@ export interface ModalOptions {
cancel: string;

/**
* Displayed modal elements
* Element Display Mode
*
* @type {string}
*/
displayedModalElements: string;
elementDisplayMode: ConfirmationElementDisplayMode;
}

0 comments on commit a251d8d

Please sign in to comment.