All files / app/features/picture/components/replace-file-dialog replace-file-dialog.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 681x                                                                                                                                      
<div class="replace-file-dialog">
    <h2
        class="replace-file-dialog__title"
        data-testid="replace-file-dialog-title"
    >
        Замена файла
    </h2>
 
    <div class="replace-file-dialog__preview">
        <img
            class="replace-file-dialog__image"
            [src]="previewUrl"
            alt="Превью нового файла"
            data-testid="replace-file-dialog-preview"
        />
    </div>
 
    <div class="replace-file-dialog__field">
        <label
            class="replace-file-dialog__label"
            for="replace-file-title"
        >
            Описание
        </label>
        <textarea
            id="replace-file-title"
            class="replace-file-dialog__input"
            rows="3"
            [formControl]="titleControl"
            data-testid="replace-file-dialog-title-input"
        ></textarea>
        @if (titleControl.invalid && titleControl.dirty) {
            <div
                class="replace-file-dialog__error"
                data-testid="replace-file-dialog-title-error"
            >
                @if (titleControl.hasError('required') || titleControl.hasError('minlength')) {
                    Минимум 5 символов
                } @else if (titleControl.hasError('maxlength')) {
                    Максимум 500 символов
                }
            </div>
        }
    </div>
 
    <div class="replace-file-dialog__actions">
        <ui-button
            variant="outlined"
            accent="secondary"
            [fullWidth]="true"
            (click)="cancel()"
            data-testid="replace-file-dialog-cancel"
        >
            Отмена
        </ui-button>
        <ui-button
            variant="filled"
            accent="primary"
            [fullWidth]="true"
            [disabled]="titleControl.invalid"
            (click)="confirm()"
            data-testid="replace-file-dialog-confirm"
        >
            Заменить
        </ui-button>
    </div>
</div>