2 <cdx-field :is-fieldset="true">
4 v-if="autoBlockVisible"
6 input-value="wpAutoBlock"
8 {{ $i18n( 'ipbenableautoblock', autoBlockExpiry ) }}
11 v-if="hideNameVisible"
13 input-value="wpHideUser"
14 class="mw-block-hideuser"
16 {{ $i18n( 'ipbhidename' ) }}
22 {{ $i18n( 'ipbwatchuser' ) }}
25 v-if="hardBlockVisible"
27 input-value="wpHardBlock"
28 class="mw-block-hardblock"
30 {{ $i18n( 'ipb-hardblock' ) }}
33 {{ $i18n( 'block-options' ).text() }}
34 <span class="cdx-label__label__optional-flag">
35 {{ $i18n( 'htmlform-optional-flag' ).text() }}
42 const { computed, defineComponent } = require( 'vue' );
43 const { storeToRefs } = require( 'pinia' );
44 const { CdxCheckbox, CdxField } = require( '@wikimedia/codex' );
45 const useBlockStore = require( '../stores/block.js' );
48 * The 'additional details' (aka 'block options') section contains:
49 * - AutoBlock (if the target is not an IP)
50 * - HideUser/HideName (if the user has the hideuser right, and the target is not an IP)
51 * - Watch (if the user is logged in)
52 * - HardBlock (if the target is an IP)
55 module.exports = exports = defineComponent( {
56 name: 'AdditionalDetailsField',
57 components: { CdxCheckbox, CdxField },
59 const store = useBlockStore();
66 } = storeToRefs( store );
67 const autoBlockExpiry = mw.config.get( 'blockAutoblockExpiry' ) || '';
68 const autoBlockVisible = computed(
69 () => !mw.util.isIPAddress( store.targetUser, true )
71 const hardBlockVisible = computed(
72 () => mw.util.isIPAddress( store.targetUser, true ) || false