|
|
@@ -158,6 +158,13 @@ export const ManageByUserScreen: React.FC<IManageByUserScreenProps> = ({ api, di
|
|
|
|
const checkedLiveRows = liveRows.filter(r => checkedLiveKeys.has(liveRowKey(r)));
|
|
|
|
const checkedLiveRows = liveRows.filter(r => checkedLiveKeys.has(liveRowKey(r)));
|
|
|
|
const checkedTemplateRows = templateRows.filter(r => checkedTemplateIds.has(r.id));
|
|
|
|
const checkedTemplateRows = templateRows.filter(r => checkedTemplateIds.has(r.id));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const allLiveChecked = liveRows.length > 0 && checkedLiveRows.length === liveRows.length;
|
|
|
|
|
|
|
|
const toggleAllLive = (): void => setCheckedLiveKeys(allLiveChecked ? new Set() : new Set(liveRows.map(liveRowKey)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const allTemplatesChecked = templateRows.length > 0 && checkedTemplateRows.length === templateRows.length;
|
|
|
|
|
|
|
|
const toggleAllTemplates = (): void =>
|
|
|
|
|
|
|
|
setCheckedTemplateIds(allTemplatesChecked ? new Set() : new Set(templateRows.map(r => r.id)));
|
|
|
|
|
|
|
|
|
|
|
|
const [replaceScope, setReplaceScope] = React.useState<IReplaceScope | undefined>();
|
|
|
|
const [replaceScope, setReplaceScope] = React.useState<IReplaceScope | undefined>();
|
|
|
|
const [resultToast, setResultToast] = React.useState<{ message: string; kind: 'ok' | 'err' } | undefined>();
|
|
|
|
const [resultToast, setResultToast] = React.useState<{ message: string; kind: 'ok' | 'err' } | undefined>();
|
|
|
|
|
|
|
|
|
|
|
@@ -297,6 +304,10 @@ export const ManageByUserScreen: React.FC<IManageByUserScreenProps> = ({ api, di
|
|
|
|
<Panel>
|
|
|
|
<Panel>
|
|
|
|
<div className={styles.panelHeader}>
|
|
|
|
<div className={styles.panelHeader}>
|
|
|
|
<div className={styles.panelTitle}>{`${texts.manageByUser.liveTitle} (${liveRows.length})`}</div>
|
|
|
|
<div className={styles.panelTitle}>{`${texts.manageByUser.liveTitle} (${liveRows.length})`}</div>
|
|
|
|
|
|
|
|
<div className={styles.panelActions}>
|
|
|
|
|
|
|
|
<Button variant="ghost" size="sm" disabled={liveRows.length === 0} onClick={toggleAllLive}>
|
|
|
|
|
|
|
|
{allLiveChecked ? texts.manageByUser.deselectAll : texts.manageByUser.selectAll}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
variant="secondary"
|
|
|
|
variant="secondary"
|
|
|
|
size="sm"
|
|
|
|
size="sm"
|
|
|
@@ -306,6 +317,7 @@ export const ManageByUserScreen: React.FC<IManageByUserScreenProps> = ({ api, di
|
|
|
|
{texts.manageByUser.replaceSelected(checkedLiveRows.length)}
|
|
|
|
{texts.manageByUser.replaceSelected(checkedLiveRows.length)}
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{liveError && <Alert kind="err">{`${texts.manageByUser.liveLoadError}: ${liveError}`}</Alert>}
|
|
|
|
{liveError && <Alert kind="err">{`${texts.manageByUser.liveLoadError}: ${liveError}`}</Alert>}
|
|
|
|
{liveLoading && <div>{texts.common.loading}</div>}
|
|
|
|
{liveLoading && <div>{texts.common.loading}</div>}
|
|
|
|
{!liveLoading && !liveError && (
|
|
|
|
{!liveLoading && !liveError && (
|
|
|
@@ -318,6 +330,10 @@ export const ManageByUserScreen: React.FC<IManageByUserScreenProps> = ({ api, di
|
|
|
|
<Panel>
|
|
|
|
<Panel>
|
|
|
|
<div className={styles.panelHeader}>
|
|
|
|
<div className={styles.panelHeader}>
|
|
|
|
<div className={styles.panelTitle}>{`${texts.manageByUser.templatesTitle} (${templateRows.length})`}</div>
|
|
|
|
<div className={styles.panelTitle}>{`${texts.manageByUser.templatesTitle} (${templateRows.length})`}</div>
|
|
|
|
|
|
|
|
<div className={styles.panelActions}>
|
|
|
|
|
|
|
|
<Button variant="ghost" size="sm" disabled={templateRows.length === 0} onClick={toggleAllTemplates}>
|
|
|
|
|
|
|
|
{allTemplatesChecked ? texts.manageByUser.deselectAll : texts.manageByUser.selectAll}
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
variant="secondary"
|
|
|
|
variant="secondary"
|
|
|
|
size="sm"
|
|
|
|
size="sm"
|
|
|
@@ -327,6 +343,7 @@ export const ManageByUserScreen: React.FC<IManageByUserScreenProps> = ({ api, di
|
|
|
|
{texts.manageByUser.replaceSelected(checkedTemplateRows.length)}
|
|
|
|
{texts.manageByUser.replaceSelected(checkedTemplateRows.length)}
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{templateSteps.error && <Alert kind="err">{`${texts.manageByUser.templatesLoadError}: ${templateSteps.error}`}</Alert>}
|
|
|
|
{templateSteps.error && <Alert kind="err">{`${texts.manageByUser.templatesLoadError}: ${templateSteps.error}`}</Alert>}
|
|
|
|
{templateSteps.isLoading && <div>{texts.common.loading}</div>}
|
|
|
|
{templateSteps.isLoading && <div>{texts.common.loading}</div>}
|
|
|
|
{!templateSteps.isLoading && !templateSteps.error && (
|
|
|
|
{!templateSteps.isLoading && !templateSteps.error && (
|
|
|
|