/**
* External dependencies
*/
import { map } from 'lodash';
/**
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import {
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalInputControl as InputControl,
BaseControl,
Flex,
FlexBlock,
FlexItem,
VisuallyHidden,
} from '@wordpress/components';
import { useInstanceId, useViewportMatch } from '@wordpress/compose';
import { closeSmall as removeIcon } from '@wordpress/icons';
/**
* Solid dependencies
*/
import { Heading, TextWeight } from '@ithemes/ui';
/**
* Internal dependencies
*/
import { Select, CreatableSelect } from '@ithemes/security-ui';
import { StyledRuleAction, halfFlexBasis } from './styles';
const DEFAULT = {
inclusive: true,
};
export default function RuleForm( { value, onChange, className } ) {
const id = useInstanceId( RuleForm, 'solid-rule-form' );
const { config = { rules: [ DEFAULT ] } } = value;
const onAndRule = ( after ) => () => {
onChange( {
...value,
config: {
...config,
rules: config.rules.toSpliced( after + 1, 0, DEFAULT ),
},
} );
};
return (
onChange( { ...value, name: next } ) }
label={ __( 'Rule Name', 'better-wp-security' ) }
required
__next36pxDefaultSize
/>
{ config.rules.map( ( rule, i ) => (
onChange( {
...value,
config: {
...config,
rules: config.rules.map( ( oldRule, j ) => j === i ? newRule : oldRule ),
},
} ) }
onDelete={ config.rules.length === 1 ? null : () => onChange( {
...value,
config: {
...config,
rules: config.rules.toSpliced( i, 1 ),
},
} ) }
/>
) ) }
action.value === config.type ) }
onChange={ ( next ) => onChange( {
...value,
config: {
...config,
type: next.value,
type_params: '',
},
} ) }
/>
{ config.type === 'REDIRECT' && (
onChange( {
...value,
config: {
...config,
type_params: next,
},
} ) }
type="url"
label={ __( 'Redirect Location', 'better-wp-security' ) }
__next36pxDefaultSize
/>
) }
);
}
function Rule( { idx, value, onChange, onDelete, onAndRule } ) {
const isLarge = useViewportMatch( 'large' );
const id = useInstanceId( Rule, 'solid-rule-form-rule' );
const selectedField = value.parameter &&
FIELDS.find( ( field ) => isField( value.parameter, field ) );
const allowedOperators = OPERATORS
.filter( ( operator ) => selectedField?.operators === true || selectedField?.operators.includes( operator.value ) );
const selectedOperator = value.match?.type &&
allowedOperators.find( ( operator ) => operator.value === value.match?.type );
return (
{ sprintf(
/* translators: Which number rule is this in the list. */
__( 'Rule %d', 'better-wp-security' ), idx + 1
) }
{ selectedField?.allowSubFields && (
) }
{ onDelete && (
) }
);
}
function FieldControl( { id, field, value, onChange } ) {
return (
onChange( {
...value,
parameter: next.value,
match: {
type: 'equals',
},
} ) }
isOptionSelected={ ( maybeOption, selected ) => selected.some( ( selectedOption ) => isField( maybeOption.value, selectedOption ) ) }
required
/>
);
}
function SubFieldControl( { field, value, onChange } ) {
const { example, sanitize, display } = field.allowSubFields;
return (
onChange( {
...value,
parameter: field.value + sanitize( next ),
} ) }
required
__next36pxDefaultSize
/>
);
}
function OperatorControl( { id, operator, allowedOperators, value, onChange } ) {
return (
onChange( {
...value,
match: {
...( value.match || {} ),
type: next.value,
value: ( () => {
const current = value.match?.value;
if ( ! current ) {
return next.isList ? [] : '';
}
if ( next.isList ) {
return Array.isArray( current ) ? current : [ current ];
}
return Array.isArray( current ) ? current[ 0 ] : current;
} )(),
},
} ) }
isDisabled={ ! allowedOperators.length }
required
/>
);
}
function ValueControl( { id, field, operator, value, onChange } ) {
if ( operator?.isList ) {
return (
( {
value: option,
label: option,
} ) ) }
value={ value.match?.value?.map( ( option ) => ( {
value: option,
label: option,
} ) ) }
onChange={ ( next ) => onChange( {
...value,
match: {
...( value.match || {} ),
value: map( next, 'value' ),
},
} ) }
isMulti
isClearable
required
/>
);
}
if ( field?.listOptions ) {
return (
( {
value: option,
label: option,
} ) ) }
value={ { value: value.match?.value ?? '', label: value.match?.value ?? '' } }
onChange={ ( next ) => onChange( {
...value,
match: {
...( value.match || {} ),
value: next.value,
},
} ) }
isClearable
required
/>
);
}
return (
onChange( {
...value,
match: {
...( value.match || {} ),
value: next,
},
} ) }
disabled={ ! field }
required
__next36pxDefaultSize
/>
);
}
function isField( value, maybeField ) {
if ( maybeField.value === value ) {
return true;
}
if ( maybeField.allowSubFields && value.startsWith( maybeField.value ) ) {
return true;
}
return false;
}
const FIELDS = [
{
value: 'server.REQUEST_URI',
label: __( 'URI', 'better-wp-security' ),
operators: [ 'equals', 'contains', 'not_contains' ],
example: '/test?param=value',
},
{
value: 'server.REQUEST_METHOD',
label: __( 'Request Method', 'better-wp-security' ),
operators: true,
listOptions: [
'GET',
'HEAD',
'POST',
'PUT',
'PATCH',
'DELETE',
'OPTIONS',
],
},
{
value: 'server.CONTENT_TYPE',
label: __( 'Content Type', 'better-wp-security' ),
operators: true,
},
{
value: 'server.HTTP_',
label: __( 'Header', 'better-wp-security' ),
operators: true,
allowSubFields: {
example: 'user-agent',
sanitize( value ) {
return value.toUpperCase().replace( '-', '_' );
},
display( value ) {
return value.toLowerCase().replace( '_', '-' );
},
},
},
{
value: 'cookie.',
label: __( 'Cookie', 'better-wp-security' ),
operators: true,
allowSubFields: {
example: 'my-cookie',
sanitize( value ) {
return value.replace( '.', '_' );
},
display( value ) {
return value;
},
},
},
{
value: 'server.ip',
label: __( 'IP Address' ),
operators: [ 'equals', 'in_array', 'not_in_array' ],
example: '127.0.0.1',
},
];
const OPERATORS = [
{
value: 'equals',
label: __( 'equals', 'better-wp-security' ),
},
{
value: 'contains',
label: __( 'contains', 'better-wp-security' ),
},
{
value: 'not_contains',
label: __( 'does not contain', 'better-wp-security' ),
},
{
value: 'in_array',
label: __( 'is in', 'better-wp-security' ),
isList: true,
},
{
value: 'not_in_array',
label: __( 'is not in', 'better-wp-security' ),
isList: true,
},
];
const ACTIONS = [
{
value: 'BLOCK',
label: __( 'Block', 'better-wp-security' ),
},
{
value: 'REDIRECT',
label: __( 'Redirect', 'better-wp-security' ),
},
{
value: 'LOG',
label: __( 'Log only', 'better-wp-security' ),
},
{
value: 'WHITELIST',
label: __( 'Allow', 'better-wp-security' ),
},
];
Moradias Banda/Gaveto de distinção – Marcio Imoveis
Moradias Banda/Gaveto de distinção
Banda - 310,000 €
Real, Braga
Adicionar favoritos
Imprimir
Resultados da pesquisa
Moradias de luxo mesmo á entrada da cidade.
Localização de excelência e próximas de tudo.
Qualidade de construção e acabamentos de referencia, um projeto pensado e criado tendo atenção a todos os pormenores para satisfazer mesmo o cliente mais exigente que anseia comprar além da moradia dos seus sonhos uma moradia que lhe proporcione o máximo de conforto e bem estar.
Moradias que contam com 3 quartos todos eles Suite tendo 1 dos mesmos closet para lhe garantir todo o espaço que necessita para arrumação,etc.
Escritório no andar inferir com 32m2.
Moradias Banda- 310.000€
Marque visita!
Morada: Real
país: Portugal
ID: 19763
Price: Banda - 310,000 €
Property Size: 294 m2
Área : 190 m2
quartos: 3
C. banho: 4
Gás natural
Quintal cercado
Ar condicionado
Varanda
Aspiração central
Estores elétricos
Bomba de calor
Tetos falsos
Soalho flutuante
Churrasqueira
Cozinha equipada
Fibra óptica
Recuperador de calor
Escritório
Garagem Box (2 carros)
Suite
portão de garagem com automatismo
Veja mais
LOCALIZAÇÃO DE SONHO 350,000 €
geralmarcioimoveis-pt
Julho 29, 2022
COMPROJETO APROVADO 74,500 €
geralmarcioimoveis-pt
Março 7, 2022
Investimento 150,000 € para remodelação
geralmarcioimoveis-pt
Setembro 24, 2021