Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mdc form components #3002

Merged
merged 24 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/src/app/infrastructure/utils/dialog-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const largeDialogSettings = {

/**
* Settings to display a medium dialog.
* `width='750px'`
* `width='804px'`
*/
export const mediumDialogSettings = {
width: `750px`,
width: `804px`,
...generalSettings
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,50 +50,43 @@ <h2>{{ 'Personal information' | translate }}</h2>
<div class="personal-info-area">
<!-- Title -->
<mat-form-field class="form16 force-min-width">
<input type="text" matInput placeholder="{{ 'Title' | translate }}" formControlName="title" />
<mat-label>{{ 'Title' | translate }}</mat-label>
<input type="text" matInput formControlName="title" />
</mat-form-field>
<!-- First name -->
<mat-form-field class="form37 force-min-width">
<input
type="text"
osAutofocus
matInput
placeholder="{{ 'Given name' | translate }}"
formControlName="first_name"
/>
<mat-label>{{ 'Given name' | translate }}</mat-label>
<input type="text" osAutofocus matInput formControlName="first_name" />
</mat-form-field>

<!-- Last name -->
<mat-form-field class="form37 force-min-width">
<input type="text" matInput placeholder="{{ 'Surname' | translate }}" formControlName="last_name" />
<mat-label>{{ 'Surname' | translate }}</mat-label>
<input type="text" matInput formControlName="last_name" />
</mat-form-field>
</div>

<div class="personal-info-area">
<!-- E-Mail -->
<mat-form-field class="width-58p force-min-width">
<input
type="email"
matInput
autocomplete="off"
placeholder="{{ 'Email' | translate }}"
name="email"
formControlName="email"
/>
<mat-label>{{ 'Email' | translate }}</mat-label>
<input type="email" matInput autocomplete="off" name="email" formControlName="email" />
<mat-error *ngIf="personalInfoForm.get('email')?.hasError('email')">
{{ 'Please enter a valid email address!' | translate }}
</mat-error>
</mat-form-field>

<!-- Pronoun -->
<mat-form-field class="width-16p force-min-width">
<input type="text" matInput placeholder="{{ 'Pronoun' | translate }}" formControlName="pronoun" />
<mat-label>{{ 'Pronoun' | translate }}</mat-label>
<input type="text" matInput formControlName="pronoun" />
<mat-error>{{ 'max. 32 characters allowed' | translate }}</mat-error>
</mat-form-field>

<!-- Gender -->
<mat-form-field class="width-16p force-min-width">
<mat-select placeholder="{{ 'Gender' | translate }}" formControlName="gender">
<mat-label>{{ 'Gender' | translate }}</mat-label>
<mat-select formControlName="gender">
<mat-option [value]="null">-</mat-option>
<mat-option *ngFor="let gender of genders" [value]="gender">
{{ gender | translate }}
Expand All @@ -105,7 +98,8 @@ <h2>{{ 'Personal information' | translate }}</h2>
<!-- username -->
<div *ngIf="isAllowed('seePersonal')">
<mat-form-field class="full-width">
<input type="text" matInput placeholder="{{ 'Username' | translate }}" formControlName="username" />
<mat-label>{{ 'Username' | translate }}</mat-label>
<input type="text" matInput formControlName="username" />
<button
*ngIf="isNewUser"
matSuffix
Expand All @@ -124,12 +118,8 @@ <h2>{{ 'Personal information' | translate }}</h2>
<div *ngIf="isAllowed('manage') && !user?.saml_id">
<!-- Initial Password -->
<mat-form-field class="full-width">
<input
matInput
autocomplete="off"
placeholder="{{ 'Initial password' | translate }}"
formControlName="default_password"
/>
<mat-label>{{ 'Initial password' | translate }}</mat-label>
<input matInput autocomplete="off" formControlName="default_password" />
<button
*ngIf="isNewUser && generatePasswordFn"
matSuffix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ <h1>
<br />
<form [formGroup]="adminPasswordForm" (keydown)="onKeyDown($event)">
<mat-form-field>
<input
[type]="hidePassword ? 'password' : 'text'"
matInput
formControlName="newPassword"
placeholder="{{ 'New password' | translate }}"
required
/>
<mat-label>{{ 'New password' | translate }}</mat-label>
<input [type]="hidePassword ? 'password' : 'text'" matInput formControlName="newPassword" required />
<mat-icon
class="pointer"
matSuffix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { MatSelectModule } from '@angular/material/select';
import { MatTooltipModule } from '@angular/material/tooltip';
import { IconContainerModule } from 'src/app/ui/modules/icon-container';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,16 @@ <h1 *ngIf="observables.organization && !observables.meeting">
<ng-template #loginform let-showExtra="showExtra">
<form [formGroup]="loginForm" [ngClass]="{ 'login-container': showExtra }" (ngSubmit)="formLogin()">
<mat-form-field>
<input
matInput
osAutofocus
required
data-cy="loginUsernameInput"
placeholder="{{ 'Username' | translate }}"
formControlName="username"
/>
<mat-label>{{ 'Username' | translate }}</mat-label>
<input matInput osAutofocus required data-cy="loginUsernameInput" formControlName="username" />
</mat-form-field>
<br />
<mat-form-field>
<mat-label>{{ 'Password' | translate }}</mat-label>
<input
matInput
required
data-cy="loginPasswordInput"
placeholder="{{ 'Password' | translate }}"
formControlName="password"
[type]="!hide ? 'password' : 'text'"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { SpinnerModule } from 'src/app/ui/modules/spinner';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
<form [formGroup]="newPasswordForm" (ngSubmit)="submitNewPassword()" autocomplete="off">
<h3>{{ 'Please enter your new password' | translate }}</h3>
<mat-form-field>
<input
matInput
autocomplete="off"
required
placeholder="{{ 'New password' | translate }}"
formControlName="password"
type="password"
/>
<mat-label>{{ 'New password' | translate }}</mat-label>
<input matInput autocomplete="off" required formControlName="password" type="password" />
<mat-error *ngIf="newPasswordForm.get('password')?.hasError('required')">
{{ 'A password is required' | translate }}
</mat-error>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';

import { ResetPasswordConfirmComponent } from './components/reset-password-confirm/reset-password-confirm.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
<form [formGroup]="resetPasswordForm" (ngSubmit)="resetPassword()" autocomplete="off">
<h3>{{ 'Enter your email to send the password reset link' | translate }}</h3>
<mat-form-field>
<input
matInput
osAutofocus
required
placeholder="{{ 'Email' | translate }}"
formControlName="email"
type="email"
autocomplete="off"
/>
<mat-label>{{ 'Email' | translate }}</mat-label>
<input matInput osAutofocus required formControlName="email" type="email" autocomplete="off" />
<mat-error *ngIf="resetPasswordForm.get('email')?.invalid">
{{ 'Please enter a valid email address!' | translate }}
</mat-error>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyListModule as MatListModule } from '@angular/material/legacy-list';
import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
import { MatTooltipModule } from '@angular/material/tooltip';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.edit-form {
width: 100%;
.mat-form-field {
.mat-mdc-form-field {
width: 100%;
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { MatSelectModule } from '@angular/material/select';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';

import { PointOfOrderDialogComponent } from './components/point-of-order-dialog/point-of-order-dialog.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { MatSelectModule } from '@angular/material/select';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { SearchSelectorModule } from 'src/app/ui/modules/search-selector';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<!-- Visibility -->
<div>
<mat-form-field [formGroup]="form">
<mat-select formControlName="agenda_type" placeholder="{{ 'Agenda visibility' | translate }}">
<mat-label>{{ 'Agenda visibility' | translate }}</mat-label>
<mat-select formControlName="agenda_type">
<mat-option *ngFor="let type of itemVisibilityChoices" [value]="type.key">
<span>{{ type.name | translate }}</span>
</mat-option>
Expand All @@ -23,11 +24,11 @@
<!-- Parent item -->
<div *ngIf="hasItemsObservable | async" [formGroup]="form">
<mat-form-field>
<mat-label>{{ 'Parent agenda item' | translate }}</mat-label>
<os-list-search-selector
formControlName="agenda_parent_id"
[multiple]="false"
[includeNone]="true"
placeholder="{{ 'Parent agenda item' | translate }}"
[inputListValues]="itemObserver"
></os-list-search-selector>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { MediaUploadContentModule } from 'src/app/ui/modules/media-upload-content/media-upload-content.module';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="attachment-container" *ngIf="contentForm">
<form [formGroup]="formGroup">
<mat-form-field>
<mat-label>{{ 'Attachments' | translate }}</mat-label>
<os-repo-search-selector
class="selector"
[multiple]="true"
placeholder="{{ 'Attachments' | translate }}"
formControlName="mediafile_ids"
[repo]="repo"
[pipeFn]="getMediafilesPipeFn()"
Expand Down Expand Up @@ -34,11 +34,11 @@ <h1 mat-dialog-title>
>
<div *osScrollingTableCell="'access_groups'; row as file" class="cell-slot">
<form [formGroup]="file.form">
<mat-form-field>
<mat-form-field subscriptSizing="dynamic">
<mat-label>{{ 'Access groups' | translate }}</mat-label>
<os-list-search-selector
formControlName="access_group_ids"
[multiple]="true"
placeholder="{{ 'Access groups' | translate }}"
[inputListValues]="availableGroups"
></os-list-search-selector>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<form [formGroup]="usersForm">
<mat-form-field class="search-users-field full-width">
<mat-label>{{ placeholder }}</mat-label>
<os-list-search-selector
class="search-users"
formControlName="userId"
[excludeIds]="true"
[multiple]="false"
placeholder="{{ placeholder | translate }}"
[inputListValues]="filteredUsersSubject"
[sortFn]="false"
(clickNotFound)="createNewSelectedUser($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.search-users {
display: grid;

.mat-form-field {
.mat-mdc-form-field {
width: 100%;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { SearchSelectorModule } from 'src/app/ui/modules/search-selector';
Expand Down
Loading