[MM-57719] Convert form_error.tsx to function component (#27914)
* solve conflicts * update snapshots * Fix types * update snapshots
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5030e2cdb2
Коммит
60ffd00d30
@@ -46,8 +46,7 @@ exports[`components/SettingItemMin should match snapshot with active Save button
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -151,8 +150,7 @@ exports[`components/SettingItemMin should match snapshot with active Save button
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -266,8 +264,7 @@ exports[`components/SettingItemMin should match snapshot, on loading picture 1`]
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -393,8 +390,7 @@ exports[`components/SettingItemMin should match snapshot, profile picture on fil
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -508,8 +504,7 @@ exports[`components/SettingItemMin should match snapshot, profile picture on sou
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -635,8 +630,7 @@ exports[`components/SettingItemMin should match snapshot, team icon on file 1`]
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -790,8 +784,7 @@ exports[`components/SettingItemMin should match snapshot, team icon on source 1`
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -945,8 +938,7 @@ exports[`components/SettingItemMin should match snapshot, user icon on source 1`
|
|||||||
className="setting-list-item"
|
className="setting-list-item"
|
||||||
>
|
>
|
||||||
<hr />
|
<hr />
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -193,9 +193,8 @@ exports[`components/BleveSettings should match snapshot, disabled 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -395,9 +394,8 @@ exports[`components/BleveSettings should match snapshot, enabled 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -197,9 +197,8 @@ exports[`components/ClusterSettings should match snapshot, compression disabled
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -405,9 +404,8 @@ exports[`components/ClusterSettings should match snapshot, compression enabled 1
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -613,9 +611,8 @@ exports[`components/ClusterSettings should match snapshot, encryption disabled 1
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -821,9 +818,8 @@ exports[`components/ClusterSettings should match snapshot, encryption enabled 1`
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -421,9 +421,8 @@ exports[`components/DatabaseSettings should match snapshot 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -492,9 +492,8 @@ exports[`components/ElasticSearchSettings should match snapshot, disabled 1`] =
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -994,9 +993,8 @@ exports[`components/ElasticSearchSettings should match snapshot, enabled 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -146,9 +146,8 @@ exports[`components/MessageExportSettings should match snapshot, disabled, actia
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -417,9 +416,8 @@ exports[`components/MessageExportSettings should match snapshot, disabled, globa
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -574,9 +572,8 @@ exports[`components/MessageExportSettings should match snapshot, enabled, actian
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -845,9 +842,8 @@ exports[`components/MessageExportSettings should match snapshot, enabled, global
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -179,9 +179,8 @@ exports[`components/PushSettings should match snapshot, licensed 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -313,9 +312,8 @@ exports[`components/PushSettings should match snapshot, unlicensed 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -683,15 +683,13 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
|
|||||||
className="error-message"
|
className="error-message"
|
||||||
data-testid="errorMessage"
|
data-testid="errorMessage"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error=""
|
error=""
|
||||||
errors={Array []}
|
|
||||||
iconClassName="fa-exclamation-triangle"
|
iconClassName="fa-exclamation-triangle"
|
||||||
textClassName="has-warning"
|
textClassName="has-warning"
|
||||||
/>
|
/>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -188,15 +188,13 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
|
|||||||
className="error-message"
|
className="error-message"
|
||||||
data-testid="errorMessage"
|
data-testid="errorMessage"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error=""
|
error=""
|
||||||
errors={Array []}
|
|
||||||
iconClassName="fa-exclamation-triangle"
|
iconClassName="fa-exclamation-triangle"
|
||||||
textClassName="has-warning"
|
textClassName="has-warning"
|
||||||
/>
|
/>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -242,15 +240,13 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
|
|||||||
className="error-message"
|
className="error-message"
|
||||||
data-testid="errorMessage"
|
data-testid="errorMessage"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error=""
|
error=""
|
||||||
errors={Array []}
|
|
||||||
iconClassName="fa-exclamation-triangle"
|
iconClassName="fa-exclamation-triangle"
|
||||||
textClassName="has-warning"
|
textClassName="has-warning"
|
||||||
/>
|
/>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -446,15 +442,13 @@ exports[`components/admin_console/CustomPluginSettings should match snapshot wit
|
|||||||
className="error-message"
|
className="error-message"
|
||||||
data-testid="errorMessage"
|
data-testid="errorMessage"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error=""
|
error=""
|
||||||
errors={Array []}
|
|
||||||
iconClassName="fa-exclamation-triangle"
|
iconClassName="fa-exclamation-triangle"
|
||||||
textClassName="has-warning"
|
textClassName="has-warning"
|
||||||
/>
|
/>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ exports[`components/admin_console/CustomTermsOfServiceSettings should match snap
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -87,9 +86,8 @@ exports[`components/admin_console/CustomTermsOfServiceSettings should match snap
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -136,9 +134,8 @@ exports[`components/admin_console/CustomTermsOfServiceSettings should match snap
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -185,9 +182,8 @@ exports[`components/admin_console/CustomTermsOfServiceSettings should match snap
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -50,10 +50,7 @@ exports[`components/OpenIdConvert should match snapshot 1`] = `
|
|||||||
className="error-message"
|
className="error-message"
|
||||||
data-testid="errorMessage"
|
data-testid="errorMessage"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError) />
|
||||||
error={null}
|
|
||||||
errors={Array []}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -459,9 +459,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_system_
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -810,9 +809,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_system_
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1161,9 +1159,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_system_
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1512,9 +1509,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_system_
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -336,9 +336,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_team_sc
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -727,9 +726,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_team_sc
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1120,9 +1118,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_team_sc
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1579,9 +1576,8 @@ exports[`components/admin_console/permission_schemes_settings/permission_team_sc
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -266,9 +266,8 @@ exports[`components/PluginManagement should match snapshot 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -543,9 +542,8 @@ exports[`components/PluginManagement should match snapshot when \`Enable Marketp
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -629,9 +627,8 @@ exports[`components/PluginManagement should match snapshot when \`Enable Plugins
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -906,9 +903,8 @@ exports[`components/PluginManagement should match snapshot when \`Enable Remote
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -1185,9 +1181,8 @@ exports[`components/PluginManagement should match snapshot when \`Require Signat
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -1466,9 +1461,8 @@ exports[`components/PluginManagement should match snapshot, No installed plugins
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -1743,9 +1737,8 @@ exports[`components/PluginManagement should match snapshot, allow insecure URL e
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -1997,9 +1990,8 @@ exports[`components/PluginManagement should match snapshot, disabled 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -2274,9 +2266,8 @@ exports[`components/PluginManagement should match snapshot, text entered into th
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -2558,9 +2549,8 @@ exports[`components/PluginManagement should match snapshot, upload disabled 1`]
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -2898,9 +2888,8 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -3206,9 +3195,8 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -3514,9 +3502,8 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -3822,9 +3809,8 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
@@ -4162,9 +4148,8 @@ exports[`components/PluginManagement should match snapshot, with installed plugi
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
|
|||||||
@@ -138,9 +138,8 @@ exports[`SystemUserDetail should match default snapshot 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -330,9 +329,8 @@ exports[`SystemUserDetail should match snapshot if MFA is enabled 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -522,9 +520,8 @@ exports[`SystemUserDetail should not show manage user settings button when user
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -723,9 +720,8 @@ exports[`SystemUserDetail should show manage user settings button as activated 1
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -915,9 +911,8 @@ exports[`SystemUserDetail should show manage user settings button as disabled wh
|
|||||||
<div
|
<div
|
||||||
className="error-message"
|
className="error-message"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -107,9 +107,8 @@ exports[`components/emoji/components/AddEmoji should match snapshot 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
type="backstage"
|
type="backstage"
|
||||||
/>
|
/>
|
||||||
<Link
|
<Link
|
||||||
@@ -283,9 +282,8 @@ exports[`components/emoji/components/AddEmoji should select a file and match sna
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
type="backstage"
|
type="backstage"
|
||||||
/>
|
/>
|
||||||
<Link
|
<Link
|
||||||
@@ -423,9 +421,8 @@ exports[`components/emoji/components/AddEmoji should update emoji name and match
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
error={null}
|
||||||
errors={Array []}
|
|
||||||
type="backstage"
|
type="backstage"
|
||||||
/>
|
/>
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
const TYPE_MODAL = 'modal';
|
||||||
|
const TYPE_BACKSTAGE = 'backstage';
|
||||||
|
|
||||||
// accepts either a single error or an array of errors
|
// accepts either a single error or an array of errors
|
||||||
type Props = {
|
type Props = {
|
||||||
type?: React.ReactNode;
|
type?: React.ReactNode;
|
||||||
@@ -11,71 +14,71 @@ type Props = {
|
|||||||
iconClassName?: string;
|
iconClassName?: string;
|
||||||
margin?: boolean;
|
margin?: boolean;
|
||||||
errors?: React.ReactNode[];
|
errors?: React.ReactNode[];
|
||||||
}
|
};
|
||||||
|
|
||||||
export default class FormError extends React.PureComponent<Props> {
|
const EMPTY_ERROR_LIST: React.ReactNode[] = [];
|
||||||
public static defaultProps = {
|
|
||||||
error: null,
|
|
||||||
errors: [],
|
|
||||||
};
|
|
||||||
public render() {
|
|
||||||
const {error = null, errors = [], iconClassName, margin, textClassName, type} = this.props;
|
|
||||||
|
|
||||||
if (!error && errors.length === 0) {
|
const FormError: React.FC<Props> = ({
|
||||||
return null;
|
error = null,
|
||||||
}
|
errors = EMPTY_ERROR_LIST,
|
||||||
|
iconClassName,
|
||||||
|
margin,
|
||||||
|
textClassName,
|
||||||
|
type,
|
||||||
|
}) => {
|
||||||
|
if (!error && errors.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// look for the first truthy error to display
|
// look for the first truthy error to display
|
||||||
let message = error;
|
let message = error;
|
||||||
|
|
||||||
if (!message) {
|
if (!message) {
|
||||||
for (const err of errors) {
|
for (const err of errors) {
|
||||||
if (err) {
|
if (err) {
|
||||||
message = err;
|
message = err;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!message) {
|
if (!message) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'modal') {
|
|
||||||
return (
|
|
||||||
<div className='form-group'>
|
|
||||||
<label className='col-sm-12 has-error'>
|
|
||||||
{message}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type === 'backstage') {
|
|
||||||
return (
|
|
||||||
<div className='pull-left has-error'>
|
|
||||||
<label className='control-label'>
|
|
||||||
{message}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (margin) {
|
|
||||||
return (
|
|
||||||
<div className='form-group has-error'>
|
|
||||||
<label className='control-label'>
|
|
||||||
{message}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (type === TYPE_MODAL) {
|
||||||
return (
|
return (
|
||||||
<div className={`col-sm-12 ${textClassName || 'has-error'}`}>
|
<div className='form-group'>
|
||||||
<label className='control-label'>
|
<label className='col-sm-12 has-error'>{message}</label>
|
||||||
<i className={`fa ${iconClassName || 'fa-exclamation-circle'}`}/> {message}
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (type === TYPE_BACKSTAGE) {
|
||||||
|
return (
|
||||||
|
<div className='pull-left has-error'>
|
||||||
|
<label className='control-label'>{message}</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (margin) {
|
||||||
|
return (
|
||||||
|
<div className='form-group has-error'>
|
||||||
|
<label className='control-label'>{message}</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`col-sm-12 ${textClassName || 'has-error'}`}>
|
||||||
|
<label className='control-label'>
|
||||||
|
<i
|
||||||
|
className={`fa ${iconClassName || 'fa-exclamation-circle'}`}
|
||||||
|
/>{' '}
|
||||||
|
{message}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default React.memo(FormError);
|
||||||
|
|||||||
@@ -409,8 +409,7 @@ exports[`components/integrations/AbstractCommand should match snapshot 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -858,8 +857,7 @@ exports[`components/integrations/AbstractCommand should match snapshot when head
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -1307,8 +1305,7 @@ exports[`components/integrations/AbstractCommand should match snapshot, displays
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"server error",
|
"server error",
|
||||||
|
|||||||
@@ -223,8 +223,7 @@ exports[`components/integrations/AbstractIncomingWebhook should call action func
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -484,8 +483,7 @@ exports[`components/integrations/AbstractIncomingWebhook should match snapshot 1
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -745,8 +743,7 @@ exports[`components/integrations/AbstractIncomingWebhook should match snapshot,
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -976,8 +973,7 @@ exports[`components/integrations/AbstractIncomingWebhook should match snapshot,
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -1204,8 +1200,7 @@ exports[`components/integrations/AbstractIncomingWebhook should match snapshot,
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -1465,8 +1460,7 @@ exports[`components/integrations/AbstractIncomingWebhook should match snapshot,
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"serverError",
|
"serverError",
|
||||||
|
|||||||
@@ -264,8 +264,7 @@ https://test.com/callback2"
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -568,8 +567,7 @@ exports[`components/integrations/AbstractOAuthApp should match snapshot, display
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"serverError",
|
"serverError",
|
||||||
|
|||||||
@@ -309,8 +309,7 @@ callbackUrl2.com
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -320,8 +320,7 @@ exports[`components/integrations/bots/AddBot blank 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -298,9 +298,8 @@ exports[`components/integrations/InstalledOAuthApp should match snapshot, on err
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error="error"
|
error="error"
|
||||||
errors={Array []}
|
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className="item-details__row"
|
className="item-details__row"
|
||||||
|
|||||||
@@ -392,8 +392,7 @@ exports[`components/integrations/AbstractOutgoingOAuthConnection should match sn
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -960,8 +959,7 @@ exports[`components/integrations/AbstractOutgoingOAuthConnection should match sn
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"serverError",
|
"serverError",
|
||||||
@@ -989,7 +987,7 @@ exports[`components/integrations/AbstractOutgoingOAuthConnection should match sn
|
|||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</FormError>
|
</Memo(FormError)>
|
||||||
<Link
|
<Link
|
||||||
className="btn btn-tertiary"
|
className="btn btn-tertiary"
|
||||||
to="/test/integrations/outgoing-oauth2-connections"
|
to="/test/integrations/outgoing-oauth2-connections"
|
||||||
|
|||||||
@@ -384,8 +384,7 @@ exports[`components/integrations/AddOutgoingOAuthConnection should match snapsho
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -459,8 +459,7 @@ https://myothersite.com/api/v2"
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -1180,8 +1179,7 @@ https://myothersite.com/api/v2"
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
@@ -1900,8 +1898,7 @@ https://myothersite.com/api/v2"
|
|||||||
<div
|
<div
|
||||||
className="backstage-form__footer"
|
className="backstage-form__footer"
|
||||||
>
|
>
|
||||||
<FormError
|
<Memo(FormError)
|
||||||
error={null}
|
|
||||||
errors={
|
errors={
|
||||||
Array [
|
Array [
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ describe('components/integrations/AbstractOutgoingOAuthConnection', () => {
|
|||||||
|
|
||||||
expect(submitAction).not.toBeCalled();
|
expect(submitAction).not.toBeCalled();
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
expect(wrapper.find('FormError').exists()).toBe(true);
|
expect(wrapper.find('Memo(FormError)').exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should call action function', async () => {
|
test('should call action function', async () => {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user