Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ type Props = {

const URLAllowListFormModal = ({ newUrlEntry = '', urlType = undefined, onUpdate = () => {} }: Props) => {
const prevNewUrlEntry = useRef<string>();
const [config, setConfig] = useState<AllowListConfig>({ entries: [], disabled: false, enforce_for_notifications: false });
const [config, setConfig] = useState<AllowListConfig>({
entries: [],
disabled: false,
enforce_for_notifications: false,
});
const [isValid, setIsValid] = useState<boolean>(false);
const [newUrlEntryId, setNewUrlEntryId] = useState<string | undefined>();
const [showConfigModal, setShowConfigModal] = useState<boolean>(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ const UrlAllowListConfig = () => {
submitButtonDisabled={!isValid}
submitButtonText="Update configuration">
<h3>Allowlist URLs</h3>
<UrlAllowListForm urls={entries} disabled={disabled} enforceForNotifications={enforceForNotifications} onUpdate={update} />
<UrlAllowListForm
urls={entries}
disabled={disabled}
enforceForNotifications={enforceForNotifications}
onUpdate={update}
/>
</BootstrapModalForm>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ type Props = {
newEntryId?: string;
};

const UrlAllowListForm = ({ urls = [], onUpdate = () => {}, disabled = false, enforceForNotifications = false, newEntryId = undefined }: Props) => {
const UrlAllowListForm = ({
urls = [],
onUpdate = () => {},
disabled = false,
enforceForNotifications = false,
newEntryId = undefined,
}: Props) => {
const productName = useProductName();
const literal = 'literal';
const regex = 'regex';
Expand All @@ -90,7 +96,11 @@ const UrlAllowListForm = ({ urls = [], onUpdate = () => {}, disabled = false, en
];
// eslint-disable-next-line prefer-const
let inputs = {};
const [config, setConfig] = useState<AllowListConfig>({ entries: urls, disabled, enforce_for_notifications: enforceForNotifications });
const [config, setConfig] = useState<AllowListConfig>({
entries: urls,
disabled,
enforce_for_notifications: enforceForNotifications,
});
const [validationState, setValidationState] = useState({ errors: [] });
const isInitialRender = useRef<boolean>(false);

Expand Down
Loading