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

Configurable styles #1953

Merged
merged 70 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5c77d5b
added button to change styles
TheSlimvReal Aug 1, 2023
121d9c9
added favicon replace
TheSlimvReal Aug 2, 2023
bad6211
removed duplicate providers
TheSlimvReal Aug 2, 2023
5c4fd60
moved settings to own entity and serice
TheSlimvReal Aug 2, 2023
6e041bf
created directive that automatically show a image of an entity
TheSlimvReal Aug 3, 2023
607ae32
using child element to show image
TheSlimvReal Aug 3, 2023
a0f18fa
using component instead of directive
TheSlimvReal Aug 3, 2023
bce9340
using display image component for app logo
TheSlimvReal Aug 3, 2023
4254f6b
icon can be changed
TheSlimvReal Aug 3, 2023
94fc2c7
primary color palette can be changed
TheSlimvReal Aug 4, 2023
eb27683
added option to change font, secondary and warning color
TheSlimvReal Aug 4, 2023
8727e4c
added todos
TheSlimvReal Aug 4, 2023
4fa9b65
removed prototype code
TheSlimvReal Aug 4, 2023
90fc418
Merge remote-tracking branch 'origin/master' into configurable_styles
TheSlimvReal Aug 14, 2023
88ce433
added todo
TheSlimvReal Aug 16, 2023
947f79d
added overwrite for fab button contrast color
TheSlimvReal Aug 22, 2023
f443bb8
added overwrite for progress bar and normal accent buttons
TheSlimvReal Aug 22, 2023
fb63d0e
Merge remote-tracking branch 'origin/master' into configurable_styles
TheSlimvReal Aug 22, 2023
99b29ad
some review adjustments
TheSlimvReal Aug 22, 2023
e6ae8fa
finished comment
TheSlimvReal Aug 22, 2023
d05d781
app logo component has ngIf
TheSlimvReal Aug 22, 2023
370810b
using a fixed ID for site settings
TheSlimvReal Aug 23, 2023
4f5f3d5
file service only listens for removed docs once the sync has been com…
TheSlimvReal Aug 23, 2023
4b55dfa
removed unnecessary blob conversion
TheSlimvReal Aug 23, 2023
615915c
images are only requested if the property has a value
TheSlimvReal Aug 23, 2023
32022dc
Merge remote-tracking branch 'origin/master' into configurable_styles
TheSlimvReal Aug 24, 2023
5a6ec92
fixed style for checkbox checkmark
TheSlimvReal Aug 24, 2023
a1c6747
fixed config for site settings
TheSlimvReal Aug 24, 2023
0cd5052
abstracting latest entity logic to class
TheSlimvReal Aug 24, 2023
22aa9ab
fix: removed migration for configurable enums
TheSlimvReal Aug 24, 2023
5b9076c
Merge branch 'remove_enum_migration' into configurable_styles
TheSlimvReal Aug 24, 2023
3a9bb24
fix: removed migration for configurable enums
TheSlimvReal Aug 24, 2023
65513b2
Merge branch 'remove_enum_migration' into configurable_styles
TheSlimvReal Aug 24, 2023
eeab1fd
fixed testing config service
TheSlimvReal Aug 24, 2023
f223304
using LatestEntity in ability service
TheSlimvReal Aug 24, 2023
f0142d5
fixed tests for analytics service
TheSlimvReal Aug 24, 2023
b7cdeb7
fixed all tests
TheSlimvReal Aug 24, 2023
874609a
Merge branch 'master' into configurable_styles
TheSlimvReal Aug 24, 2023
a18c20e
fix(forms): display label for photo fields
sleidig Aug 24, 2023
a1e8f88
Merge remote-tracking branch 'origin/master' into configurable_styles
TheSlimvReal Aug 28, 2023
6afefbd
favicon is automatically reset if icon is removed
TheSlimvReal Aug 28, 2023
a0efb58
made compression of images configurable
TheSlimvReal Aug 28, 2023
99c015e
added context typing to configurable enum directive
TheSlimvReal Aug 28, 2023
3e03bbf
adjusted ConfigurableEnumInterface to only allows a fixed set of prop…
TheSlimvReal Aug 28, 2023
d2a68df
refactored locales to be a statically created configurable enum
TheSlimvReal Aug 28, 2023
c6d74cb
fixed tests
TheSlimvReal Aug 28, 2023
90d8748
removed logo as icon property
TheSlimvReal Aug 28, 2023
819e3ba
showing label below picture
TheSlimvReal Aug 28, 2023
81cfb94
Merge branch 'photo-field-label' into configurable_styles
TheSlimvReal Aug 28, 2023
5813fa4
added tests for site settings
TheSlimvReal Aug 28, 2023
fb5fe99
removed unnecessary code
TheSlimvReal Aug 28, 2023
ad6b406
some review changes
TheSlimvReal Aug 28, 2023
c438a78
removed unused prop
TheSlimvReal Sep 5, 2023
feabdff
Merge branch 'master' into configurable_styles
sleidig Sep 6, 2023
ccd015a
Update src/app/core/config/config-fix.ts
sleidig Sep 7, 2023
79fb62b
Update src/app/core/site-settings/demo-site-settings-generator.servic…
sleidig Sep 7, 2023
9e8009a
Update src/app/core/site-settings/site-settings.service.ts
sleidig Sep 7, 2023
4e8fb19
Update src/app/core/site-settings/demo-site-settings-generator.servic…
sleidig Sep 7, 2023
50e9275
Update src/app/core/site-settings/site-settings.ts
sleidig Sep 7, 2023
19c6fa9
cleanup
sleidig Sep 7, 2023
39b2fc6
naming and docs for latest-entity
sleidig Sep 7, 2023
c461b3c
remove test code duplication
sleidig Sep 7, 2023
6341712
use hostname for analytics org rather than the (user-editable) site t…
sleidig Sep 7, 2023
edced57
use background color in import component sticky header
sleidig Sep 7, 2023
f05040f
added code for storing and loading settings
TheSlimvReal Sep 8, 2023
51014fd
Merge remote-tracking branch 'origin/configurable_styles' into config…
TheSlimvReal Sep 8, 2023
d8158a7
fix(core): correctly check permissions for menu items to details pages
sleidig Sep 8, 2023
ffdf141
cache settings in localStorage
sleidig Sep 8, 2023
eae0b78
cleanup
sleidig Sep 8, 2023
70b12bb
Merge branch 'master' into configurable_styles
sleidig Sep 8, 2023
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
Prev Previous commit
Next Next commit
fix(forms): display label for photo fields
sleidig committed Aug 24, 2023

Verified

This commit was signed with the committer’s verified signature.
lann Lann
commit a18c20ea32fb3d113a68dffc350098b4019b8442
2 changes: 1 addition & 1 deletion src/app/child-dev-project/children/model/child.ts
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ export class Child extends Entity {

@DatabaseField({
dataType: "file",
label: $localize`:Label for the filename of a photo of a child:Photo Filename`,
label: $localize`:Label for the file field of a photo of a child:Photo`,
editComponent: "EditPhoto",
})
photo: string;
29 changes: 21 additions & 8 deletions src/app/features/file/edit-photo/edit-photo.component.html
Original file line number Diff line number Diff line change
@@ -5,13 +5,22 @@
accept="image/*"
#fileUpload
/>
<img
[src]="imgPath"
alt="profile photo"
class="child-pic"
(click)="openPopup()"
/>
<div>

<mat-form-field
floatLabel="always"
[class.form-field-disabled]="!formControl.enabled"
>
<mat-label>{{ label }}</mat-label>

<img
[src]="imgPath"
alt="profile photo"
class="image"
(click)="openPopup()"
/>
<input matInput readonly style="display: none" [formControl]="formControl" />

<!-- edit mode -->
<button
*ngIf="formControl.value && formControl.enabled"
type="button"
@@ -32,4 +41,8 @@
>
<fa-icon icon="upload"></fa-icon>
</button>
</div>

<mat-error>
<app-error-hint [form]="formControl"></app-error-hint>
</mat-error>
</mat-form-field>
11 changes: 6 additions & 5 deletions src/app/features/file/edit-photo/edit-photo.component.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.child-pic {
.image {
width: 150px;
height: 150px;
border-radius: 50%;
object-fit: cover;
cursor: pointer;
background: lightgrey;
display: block;
}

:host {
display: flex;
flex-direction: column;
align-items: center;
:host .form-field-disabled ::ng-deep .mat-mdc-text-field-wrapper {
// hide form-field bottom line if not in edit mode
--mdc-filled-text-field-active-indicator-height: 0;
}
16 changes: 15 additions & 1 deletion src/app/features/file/edit-photo/edit-photo.component.ts
Original file line number Diff line number Diff line change
@@ -13,13 +13,27 @@ import { MatButtonModule } from "@angular/material/button";
import { resizeImage } from "../file-utils";
import { MatDialog } from "@angular/material/dialog";
import { ImagePopupComponent } from "./image-popup/image-popup.component";
import { MatFormFieldModule } from "@angular/material/form-field";
import { MatInputModule } from "@angular/material/input";
import { ReactiveFormsModule } from "@angular/forms";
import { ErrorHintComponent } from "../../../core/common-components/error-hint/error-hint.component";

@DynamicComponent("EditPhoto")
@Component({
selector: "app-edit-photo",
templateUrl: "./edit-photo.component.html",
styleUrls: ["./edit-photo.component.scss"],
imports: [MatButtonModule, MatTooltipModule, FontAwesomeModule, NgIf],
imports: [
MatButtonModule,
MatTooltipModule,
FontAwesomeModule,
NgIf,
MatFormFieldModule,
MatInputModule,
ReactiveFormsModule,
EditFileComponent,
ErrorHintComponent,
],
standalone: true,
})
export class EditPhotoComponent extends EditFileComponent implements OnInit {