More renames from 'visible' to 'open'. (#2290)
This commit is contained in:
@@ -60,10 +60,10 @@ function convertScopeStringToTag(scopeString: string) {
|
||||
interface Props {
|
||||
onCancel: () => void;
|
||||
onOk: any; // todo: make better type
|
||||
visible: boolean;
|
||||
open: boolean;
|
||||
}
|
||||
const NewTokenModal = (props: Props) => {
|
||||
const { onOk, onCancel, visible } = props;
|
||||
const { onOk, onCancel, open } = props;
|
||||
const [selectedScopes, setSelectedScopes] = useState([]);
|
||||
const [name, setName] = useState('');
|
||||
|
||||
@@ -100,7 +100,7 @@ const NewTokenModal = (props: Props) => {
|
||||
return (
|
||||
<Modal
|
||||
title="Create New Access token"
|
||||
visible={visible}
|
||||
open={open}
|
||||
onOk={saveToken}
|
||||
onCancel={onCancel}
|
||||
okButtonProps={okButtonProps}
|
||||
@@ -135,7 +135,7 @@ const NewTokenModal = (props: Props) => {
|
||||
|
||||
const AccessTokens = () => {
|
||||
const [tokens, setTokens] = useState([]);
|
||||
const [isTokenModalVisible, setIsTokenModalVisible] = useState(false);
|
||||
const [isTokenModalOpen, setIsTokenModalOpen] = useState(false);
|
||||
|
||||
function handleError(error) {
|
||||
console.error('error', error);
|
||||
@@ -220,16 +220,16 @@ const AccessTokens = () => {
|
||||
];
|
||||
|
||||
const showCreateTokenModal = () => {
|
||||
setIsTokenModalVisible(true);
|
||||
setIsTokenModalOpen(true);
|
||||
};
|
||||
|
||||
const handleTokenModalSaveButton = (name, scopes) => {
|
||||
setIsTokenModalVisible(false);
|
||||
setIsTokenModalOpen(false);
|
||||
handleSaveToken(name, scopes);
|
||||
};
|
||||
|
||||
const handleTokenModalCancel = () => {
|
||||
setIsTokenModalVisible(false);
|
||||
setIsTokenModalOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -258,7 +258,7 @@ const AccessTokens = () => {
|
||||
Create Access Token
|
||||
</Button>
|
||||
<NewTokenModal
|
||||
visible={isTokenModalVisible}
|
||||
open={isTokenModalOpen}
|
||||
onOk={handleTokenModalSaveButton}
|
||||
onCancel={handleTokenModalCancel}
|
||||
/>
|
||||
|
||||
@@ -17,11 +17,11 @@ let resetTimer = null;
|
||||
interface Props {
|
||||
onCancel: () => void;
|
||||
onOk: any; // todo: make better type
|
||||
visible: boolean;
|
||||
open: boolean;
|
||||
}
|
||||
|
||||
const NewActionModal = (props: Props) => {
|
||||
const { onOk, onCancel, visible } = props;
|
||||
const { onOk, onCancel, open } = props;
|
||||
|
||||
const [actionUrl, setActionUrl] = useState('');
|
||||
const [actionTitle, setActionTitle] = useState('');
|
||||
@@ -64,7 +64,7 @@ const NewActionModal = (props: Props) => {
|
||||
return (
|
||||
<Modal
|
||||
title="Create New Action"
|
||||
visible={visible}
|
||||
open={open}
|
||||
onOk={save}
|
||||
onCancel={onCancel}
|
||||
okButtonProps={okButtonProps}
|
||||
@@ -138,7 +138,7 @@ const Actions = () => {
|
||||
const { serverConfig, setFieldInConfigState } = serverStatusData || {};
|
||||
const { externalActions } = serverConfig;
|
||||
const [actions, setActions] = useState([]);
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [submitStatus, setSubmitStatus] = useState(null);
|
||||
|
||||
const resetStates = () => {
|
||||
@@ -207,7 +207,7 @@ const Actions = () => {
|
||||
}
|
||||
|
||||
const showCreateModal = () => {
|
||||
setIsModalVisible(true);
|
||||
setIsModalOpen(true);
|
||||
};
|
||||
|
||||
const handleModalSaveButton = (
|
||||
@@ -218,12 +218,12 @@ const Actions = () => {
|
||||
actionColor: string,
|
||||
openExternally: boolean,
|
||||
) => {
|
||||
setIsModalVisible(false);
|
||||
setIsModalOpen(false);
|
||||
handleSave(actionUrl, actionTitle, actionDescription, actionIcon, actionColor, openExternally);
|
||||
};
|
||||
|
||||
const handleModalCancelButton = () => {
|
||||
setIsModalVisible(false);
|
||||
setIsModalOpen(false);
|
||||
};
|
||||
|
||||
const columns = [
|
||||
@@ -304,7 +304,7 @@ const Actions = () => {
|
||||
<FormStatusIndicator status={submitStatus} />
|
||||
|
||||
<NewActionModal
|
||||
visible={isModalVisible}
|
||||
open={isModalOpen}
|
||||
onOk={handleModalSaveButton}
|
||||
onCancel={handleModalCancelButton}
|
||||
/>
|
||||
|
||||
@@ -52,11 +52,11 @@ function convertEventStringToTag(eventString: string) {
|
||||
interface Props {
|
||||
onCancel: () => void;
|
||||
onOk: any; // todo: make better type
|
||||
visible: boolean;
|
||||
open: boolean;
|
||||
}
|
||||
|
||||
const NewWebhookModal = (props: Props) => {
|
||||
const { onOk, onCancel, visible } = props;
|
||||
const { onOk, onCancel, open } = props;
|
||||
|
||||
const [selectedEvents, setSelectedEvents] = useState([]);
|
||||
const [webhookUrl, setWebhookUrl] = useState('');
|
||||
@@ -95,7 +95,7 @@ const NewWebhookModal = (props: Props) => {
|
||||
return (
|
||||
<Modal
|
||||
title="Create New Webhook"
|
||||
visible={visible}
|
||||
open={open}
|
||||
onOk={save}
|
||||
onCancel={onCancel}
|
||||
okButtonProps={okButtonProps}
|
||||
@@ -125,7 +125,7 @@ const NewWebhookModal = (props: Props) => {
|
||||
|
||||
const Webhooks = () => {
|
||||
const [webhooks, setWebhooks] = useState([]);
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
function handleError(error) {
|
||||
console.error('error', error);
|
||||
@@ -166,16 +166,16 @@ const Webhooks = () => {
|
||||
}
|
||||
|
||||
const showCreateModal = () => {
|
||||
setIsModalVisible(true);
|
||||
setIsModalOpen(true);
|
||||
};
|
||||
|
||||
const handleModalSaveButton = (url, events) => {
|
||||
setIsModalVisible(false);
|
||||
setIsModalOpen(false);
|
||||
handleSave(url, events);
|
||||
};
|
||||
|
||||
const handleModalCancelButton = () => {
|
||||
setIsModalVisible(false);
|
||||
setIsModalOpen(false);
|
||||
};
|
||||
|
||||
const columns = [
|
||||
@@ -241,7 +241,7 @@ const Webhooks = () => {
|
||||
Create Webhook
|
||||
</Button>
|
||||
<NewWebhookModal
|
||||
visible={isModalVisible}
|
||||
open={isModalOpen}
|
||||
onOk={handleModalSaveButton}
|
||||
onCancel={handleModalCancelButton}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user