Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Revert "Rename spot-text-field to spot-input-field to allow more types than just text"

Henriette Dargee3b72b3ad84e
diff --git a/frontend/src/app/features/team-planner/team-planner/add-work-packages/add-existing-pane.component.html b/frontend/src/app/features/team-planner/team-planner/add-work-packages/add-existing-pane.component.html
index 4a1b07237a6..505cd6ef496 100644
--- a/frontend/src/app/features/team-planner/team-planner/add-work-packages/add-existing-pane.component.html
+++ b/frontend/src/app/features/team-planner/team-planner/add-work-packages/add-existing-pane.component.html
@@ -1,4 +1,4 @@
-<spot-input-field
+<spot-text-field
[ngModel]="searchString$ | async"
(ngModelChange)="searchString$.next($event)"
data-qa-selector="op-add-existing-pane--search-input"
@@ -8,7 +8,7 @@
slot="before"
class="spot-icon spot-icon_search"
></span>
-</spot-input-field>
+</spot-text-field>
<ng-container
*ngIf="(isLoading$ | async) === false; else loadingTemplate"
diff --git a/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html b/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html
index 2c8063d2282..ed29e896329 100644
--- a/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html
+++ b/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html
@@ -33,7 +33,7 @@
</label>
<div class="form--field-container">
<div class="form--text-field-container op-datepicker-modal--date-container">
- <spot-input-field
+ <spot-text-field
name="startDate"
data-qa-selector="op-datepicker-modal--start-date-field"
class="op-datepicker-modal--date-field"
@@ -43,7 +43,7 @@
[disabled]="!isSchedulable"
[showClearButton]="currentlyActivatedDateField === 'end'"
(focusin)="setCurrentActivatedField('start')"
- ></spot-input-field>
+ ></spot-text-field>
</div>
</div>
<div class="form--field-extra-actions">
@@ -61,7 +61,7 @@
</label>
<div class="form--field-container">
<div class="form--text-field-container op-datepicker-modal--date-container">
- <spot-input-field
+ <spot-text-field
name="endDate"
data-qa-selector="op-datepicker-modal--end-date-field"
class="op-datepicker-modal--date-field"
@@ -71,7 +71,7 @@
[disabled]="!isSchedulable"
[showClearButton]="currentlyActivatedDateField === 'end'"
(focusin)="setCurrentActivatedField('end')"
- ></spot-input-field>
+ ></spot-text-field>
</div>
</div>
<div class="form--field-extra-actions">
@@ -89,7 +89,7 @@
</label>
<div class="form--field-container">
<div class="form--text-field-container op-datepicker-modal--date-container">
- <spot-input-field
+ <spot-text-field
name="duration"
data-qa-selector="op-datepicker-modal--duration-field"
class="op-datepicker-modal--date-field"
@@ -99,7 +99,7 @@
[disabled]="!isSchedulable"
(focusin)="handleDurationFocusIn()"
(focusout)="handleDurationFocusOut()"
- ></spot-input-field>
+ ></spot-text-field>
</div>
</div>
</div>
diff --git a/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html b/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html
index 4c5c66c67fb..650c9afc010 100644
--- a/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html
+++ b/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html
@@ -31,14 +31,14 @@
</label>
<div class="form--field-container">
<div class="form--text-field-container op-datepicker-modal--date-container">
- <spot-input-field
+ <spot-text-field
name="date"
class="op-datepicker-modal--date-field"
[ngClass]="{ 'op-datepicker-modal--date-field_current': this.dateModalScheduling.isSchedulable }"
[(ngModel)]="date"
(ngModelChange)="dateChangedManually$.next()"
[showClearButton]="true"
- ></spot-input-field>
+ ></spot-text-field>
</div>
</div>
<div class="form--field-extra-actions">
diff --git a/frontend/src/app/shared/components/header-project-select/header-project-select.component.html b/frontend/src/app/shared/components/header-project-select/header-project-select.component.html
index 3942151fa30..b13f0896bef 100644
--- a/frontend/src/app/shared/components/header-project-select/header-project-select.component.html
+++ b/frontend/src/app/shared/components/header-project-select/header-project-select.component.html
@@ -32,7 +32,7 @@
class="op-project-list-modal--body spot-container"
*ngIf="projects$ | async as projects"
>
- <spot-input-field
+ <spot-text-field
[placeholder]="text.search_placeholder"
[(ngModel)]="searchableProjectListService.searchText"
[ngModelOptions]="{standalone: true}"
@@ -46,7 +46,7 @@
slot="before"
class="spot-icon spot-icon_search"
></span>
- </spot-input-field>
+ </spot-text-field>
<ng-container *ngIf="(loading$ | async) === false; else loadingTemplate">
<ul
diff --git a/frontend/src/app/shared/components/project-include/project-include.component.html b/frontend/src/app/shared/components/project-include/project-include.component.html
index f78f7cab82a..c7f12a47a9b 100644
--- a/frontend/src/app/shared/components/project-include/project-include.component.html
+++ b/frontend/src/app/shared/components/project-include/project-include.component.html
@@ -34,7 +34,7 @@
class="spot-container op-project-list-modal--body"
*ngIf="projects$ | async as projects"
>
- <spot-input-field
+ <spot-text-field
[placeholder]="text.search_placeholder"
name="project-include-search"
[(ngModel)]="searchableProjectListService.searchText"
@@ -50,7 +50,7 @@
slot="before"
class="spot-icon spot-icon_search"
></span>
- </spot-input-field>
+ </spot-text-field>
<ng-container *ngIf="(loading$ | async) === false; else loadingTemplate">
<ul
diff --git a/frontend/src/app/spot/components/input-field/input-field.component.html b/frontend/src/app/spot/components/text-field/text-field.component.html
similarity index 82%
rename from frontend/src/app/spot/components/input-field/input-field.component.html
rename to frontend/src/app/spot/components/text-field/text-field.component.html
index d837433931e..f4f78fb949d 100644
--- a/frontend/src/app/spot/components/input-field/input-field.component.html
+++ b/frontend/src/app/spot/components/text-field/text-field.component.html
@@ -1,11 +1,10 @@
<ng-content select="[slot=before]"></ng-content>
<input
- class="spot-input-field--input"
+ class="spot-text-field--input"
[attr.name]="name"
[disabled]="disabled"
[placeholder]="placeholder"
[(ngModel)]="value"
- [type]="type"
(focus)="onInputFocus($event)"
(blur)="onInputBlur($event)"
#input
@@ -14,7 +13,7 @@
*ngIf="showClearButton && value !== '' && !disabled"
(click)="value = ''"
type="button"
- class="spot-input-field--clear-button"
+ class="spot-text-field--clear-button"
>
<span class="spot-icon spot-icon_close"></span>
</button>
diff --git a/frontend/src/app/spot/components/input-field/input-field.component.ts b/frontend/src/app/spot/components/text-field/text-field.component.ts
similarity index 70%
rename from frontend/src/app/spot/components/input-field/input-field.component.ts
rename to frontend/src/app/spot/components/text-field/text-field.component.ts
index 2e217e7f535..b594f5d626a 100644
--- a/frontend/src/app/spot/components/input-field/input-field.component.ts
+++ b/frontend/src/app/spot/components/text-field/text-field.component.ts
@@ -11,21 +11,19 @@ import {
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
-type AllowedInputTypes = 'text'|'number';
-
@Component({
- selector: 'spot-input-field',
- templateUrl: './input-field.component.html',
+ selector: 'spot-text-field',
+ templateUrl: './text-field.component.html',
providers: [{
provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => SpotInputFieldComponent),
+ useExisting: forwardRef(() => SpotTextFieldComponent),
multi: true,
}],
})
-export class SpotInputFieldComponent implements ControlValueAccessor {
- @HostBinding('class.spot-input-field') public className = true;
+export class SpotTextFieldComponent implements ControlValueAccessor {
+ @HostBinding('class.spot-text-field') public className = true;
- @HostBinding('class.spot-input-field_focused') public focused = false;
+ @HostBinding('class.spot-text-field_focused') public focused = false;
@HostListener('click') public onParentClick() {
this.input.nativeElement.focus();
@@ -33,16 +31,14 @@ export class SpotInputFieldComponent implements ControlValueAccessor {
@ViewChild('input') public input:ElementRef;
- @Input() name = `spot-input-field-${+(new Date())}`;
+ @Input() name = `spot-text-field-${+(new Date())}`;
- @HostBinding('class.spot-input-field_disabled') @Input() disabled = false;
+ @HostBinding('class.spot-text-field_disabled') @Input() disabled = false;
@Input() showClearButton = true;
@Input() public placeholder = '';
- @Input() public type:AllowedInputTypes = 'text';
-
@Input('value') public _value = '';
get value():string {
diff --git a/frontend/src/app/spot/spot-docs.component.html b/frontend/src/app/spot/spot-docs.component.html
index c2300dc6e5f..6cb86de62fd 100644
--- a/frontend/src/app/spot/spot-docs.component.html
+++ b/frontend/src/app/spot/spot-docs.component.html
@@ -368,31 +368,31 @@ Currently selected value is {{ toggleValue }}
></spot-filter-chip>
</section>
-<h1>Input Field</h1>
+<h1>Text Field</h1>
<section class="space-children">
<input
- class="spot-input-field"
+ class="spot-text-field"
placeholder="Placeholder value"
/>
<input
- class="spot-input-field"
+ class="spot-text-field"
value="Test value"
/>
- <spot-input-field
+ <spot-text-field
placeholder="Placeholder value"
value="Test value"
name="textfield-name"
- ></spot-input-field>
+ ></spot-text-field>
- <spot-input-field
+ <spot-text-field
placeholder="Placeholder value"
[(ngModel)]="textFieldValue"
- ></spot-input-field>
+ ></spot-text-field>
- <spot-input-field
+ <spot-text-field
placeholder="Placeholder value"
[(ngModel)]="textFieldValue"
>
@@ -400,9 +400,9 @@ Currently selected value is {{ toggleValue }}
slot="after"
class="spot-icon spot-icon_bell"
></span>
- </spot-input-field>
+ </spot-text-field>
- <spot-input-field
+ <spot-text-field
placeholder="Placeholder value"
[(ngModel)]="textFieldValue"
>
@@ -414,9 +414,9 @@ Currently selected value is {{ toggleValue }}
slot="after"
class="spot-icon spot-icon_bell"
></span>
- </spot-input-field>
+ </spot-text-field>
- <spot-input-field
+ <spot-text-field
placeholder="Placeholder value"
[(ngModel)]="textFieldValue"
>
@@ -424,15 +424,7 @@ Currently selected value is {{ toggleValue }}
slot="before"
class="spot-icon spot-icon_bell"
></span>
- </spot-input-field>
-
- <spot-input-field
- placeholder="Placeholder number"
- [(ngModel)]="numberFieldValue"
- [type]="'number'"
- >
- </spot-input-field>
-
+ </spot-text-field>
</section>
<h1>Drop Modal</h1>
@@ -467,7 +459,7 @@ Currently selected value is {{ toggleValue }}
<div class="spot-container">
<h1 class="spot-header-small">Test</h1>
- <spot-input-field
+ <spot-text-field
placeholder="Placeholder value"
[(ngModel)]="textFieldValue"
>
@@ -475,7 +467,7 @@ Currently selected value is {{ toggleValue }}
slot="before"
class="spot-icon spot-icon_bell"
></span>
- </spot-input-field>
+ </spot-text-field>
</div>
</ng-container>
</spot-drop-modal>
diff --git a/frontend/src/app/spot/spot-docs.component.ts b/frontend/src/app/spot/spot-docs.component.ts
index 278a06e7ff2..2dff05bcd39 100644
--- a/frontend/src/app/spot/spot-docs.component.ts
+++ b/frontend/src/app/spot/spot-docs.component.ts
@@ -15,8 +15,6 @@ export class SpotDocsComponent {
textFieldValue = 'ngModel value';
- numberFieldValue = 42;
-
dropModalOpen = false;
dropModalAlignment = 'bottom-left';
diff --git a/frontend/src/app/spot/spot.module.ts b/frontend/src/app/spot/spot.module.ts
index 642fc6021a4..0d872fdd554 100644
--- a/frontend/src/app/spot/spot.module.ts
+++ b/frontend/src/app/spot/spot.module.ts
@@ -6,11 +6,11 @@ import { UIRouterModule } from '@uirouter/angular';
import { SPOT_DOCS_ROUTES } from './spot.routes';
import { SpotCheckboxComponent } from './components/checkbox/checkbox.component';
import { SpotToggleComponent } from './components/toggle/toggle.component';
+import { SpotTextFieldComponent } from './components/text-field/text-field.component';
import { SpotFilterChipComponent } from './components/filter-chip/filter-chip.component';
import { SpotDropModalComponent } from './components/drop-modal/drop-modal.component';
import { SpotTooltipComponent } from './components/tooltip/tooltip.component';
import { SpotDocsComponent } from './spot-docs.component';
-import { SpotInputFieldComponent } from 'core-app/spot/components/input-field/input-field.component';
@NgModule({
imports: [
@@ -25,7 +25,7 @@ import { SpotInputFieldComponent } from 'core-app/spot/components/input-field/in
SpotCheckboxComponent,
SpotToggleComponent,
- SpotInputFieldComponent,
+ SpotTextFieldComponent,
SpotFilterChipComponent,
SpotDropModalComponent,
SpotTooltipComponent,
@@ -33,7 +33,7 @@ import { SpotInputFieldComponent } from 'core-app/spot/components/input-field/in
exports: [
SpotCheckboxComponent,
SpotToggleComponent,
- SpotInputFieldComponent,
+ SpotTextFieldComponent,
SpotFilterChipComponent,
SpotDropModalComponent,
SpotTooltipComponent,
diff --git a/frontend/src/app/spot/styles/sass/common/container.sass b/frontend/src/app/spot/styles/sass/common/container.sass
index 82403dea5a9..b2228a7a347 100644
--- a/frontend/src/app/spot/styles/sass/common/container.sass
+++ b/frontend/src/app/spot/styles/sass/common/container.sass
@@ -9,7 +9,7 @@
> .spot-body-big,
> .spot-body-small,
> .spot-caption,
- > .spot-input-field
+ > .spot-text-field
margin: 0 $spot-spacing-1
margin-top: $spot-spacing-1
diff --git a/frontend/src/app/spot/styles/sass/components/index.sass b/frontend/src/app/spot/styles/sass/components/index.sass
index 736cc440cdf..afd751e1241 100644
--- a/frontend/src/app/spot/styles/sass/components/index.sass
+++ b/frontend/src/app/spot/styles/sass/components/index.sass
@@ -4,7 +4,7 @@
@import './link'
@import './toggle'
@import './checkbox'
-@import './input-field'
+@import './text-field'
@import './filter-chip'
@import './drop-modal'
@import './list'
diff --git a/frontend/src/app/spot/styles/sass/components/input-field.sass b/frontend/src/app/spot/styles/sass/components/text-field.sass
similarity index 98%
rename from frontend/src/app/spot/styles/sass/components/input-field.sass
rename to frontend/src/app/spot/styles/sass/components/text-field.sass
index 9d0248c69ba..54a03c409f0 100644
--- a/frontend/src/app/spot/styles/sass/components/input-field.sass
+++ b/frontend/src/app/spot/styles/sass/components/text-field.sass
@@ -1,4 +1,4 @@
-.spot-input-field
+.spot-text-field
@include spot-body-small
border: 1px solid $spot-color-basic-gray-3
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/helpers/_mixins.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/helpers/_mixins.scss
index ccd462fabf0..d016288e9d6 100644
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/helpers/_mixins.scss
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/helpers/_mixins.scss
@@ -120,4 +120,4 @@
clip: auto;
}
-$text-input-selectors: 'input[type="text"]:not(.spot-input-field--input), input[type="password"]:not(.spot-input-field--input), input[type="date"]:not(.spot-input-field--input), input[type="datetime"]:not(.spot-input-field--input), input[type="datetime-local"]:not(.spot-input-field--input), input[type="month"]:not(.spot-input-field--input), input[type="week"]:not(.spot-input-field--input), input[type="email"]:not(.spot-input-field--input), input[type="number"]:not(.spot-input-field--input), input[type="search"]:not(.spot-input-field--input), input[type="tel"]:not(.spot-input-field--input), input[type="time"]:not(.spot-input-field--input), input[type="url"]:not(.spot-input-field--input), input[type="color"]:not(.spot-input-field--input), textarea';
+$text-input-selectors: 'input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="week"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="time"], input[type="url"], input[type="color"], textarea';