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

Fix add and remove button styles on work modal #1128

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 28 additions & 23 deletions src/app/record/components/work-modal/work-modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,28 +177,31 @@
</mat-form-field>
</div>
<!-- SHOW-HIDE translated title button -->
<div>
<div
class="row align-icon"
<div class="row">
<a
class="col add-more no-gutters"
*ngIf="!showTranslationTitle"
(click)="showTranslationTitle = !showTranslationTitle"
>
<button mat-icon-button color="primary">
<mat-icon>add</mat-icon>
</button>
<a i18n="@@works.addTranslatedTitle">add translated title</a>
</div>

<div
class="row align-icon"
<mat-icon class="large-material-icon">add_circle_outline</mat-icon>
<span class="mat-body-1">
<ng-container i18n="@@works.addTranslatedTitle">
Add translated title
</ng-container>
</span>
</a>
<a
class="col add-more no-gutters"
*ngIf="showTranslationTitle"
(click)="showTranslationTitle = !showTranslationTitle"
>
<button mat-icon-button color="primary">
<mat-icon>add</mat-icon>
</button>
<a i18n="@@works.hideTranslatedTitle">hide translation title</a>
</div>
<mat-icon class="large-material-icon">remove_circle_outline</mat-icon>
<span class="mat-body-1">
<ng-container i18n="@@works.hideTranslatedTitle">
Hide translation title
</ng-container>
</span>
</a>
</div>

<!-- Work translations title -->
Expand Down Expand Up @@ -759,13 +762,15 @@
</ng-container>

<!-- Add other identifier -->
<div
class="row align-icon"
*ngIf="!showTranslationTitle"
(click)="addOtherWorkId()"
>
<button mat-icon-button><mat-icon>add</mat-icon></button>
<a i18n="@@works.addAnotherId">Add other identifier</a>
<div class="row">
<a class="col add-more no-gutters" (click)="addOtherWorkId()">
<mat-icon class="large-material-icon">add_circle_outline</mat-icon>
<span class="mat-body-1">
<ng-container i18n="@@works.addAnotherId">
Add other identifier
</ng-container>
</span>
</a>
</div>
</div>

Expand Down
10 changes: 10 additions & 0 deletions src/app/record/components/work-modal/work-modal.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ mat-radio-group {
padding-bottom: 1.475em;
padding-left: 0;
}

.add-more {
margin-top: 16px;
margin-bottom: 16px;
mat-icon {
padding-inline-end: 8px;
}
display: flex;
align-items: center;
}
14 changes: 12 additions & 2 deletions src/app/record/components/work-modal/work-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ export class WorkModalComponent implements OnInit {
[],
],
})
if (
currentWork?.translatedTitle?.content ||
currentWork?.translatedTitle?.languageCode
) {
this.showTranslationTitle = true
}
this.workIdentifiersFormArray = this.workForm.controls
.workIdentifiers as FormArray

Expand Down Expand Up @@ -365,8 +371,12 @@ export class WorkModalComponent implements OnInit {
value: this.workForm.value.subtitle,
},
translatedTitle: {
content: this.workForm.value.translatedTitleContent,
languageCode: this.workForm.value.translatedTitleLanguage,
content: this.showTranslationTitle
? this.workForm.value.translatedTitleContent
: '',
languageCode: this.showTranslationTitle
? this.workForm.value.translatedTitleLanguage
: '',
},
workCategory: {
value: this.workForm.value.workCategory,
Expand Down
4 changes: 2 additions & 2 deletions src/locale/properties/works/works.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ works.selectACategory=Select a work category
works.workType=Work type
works.selectWorkType=Select a work type
works.setAWorkTitle=Set a work title
works.addTranslatedTitle=add translated title
works.hideTranslatedTitle=hide translation title
works.addTranslatedTitle=Add translated title
works.hideTranslatedTitle=Hide translation title
works.translatedTitle=Work translated title
works.subtitle=Work Subtitle
works.invalidUrl=Invalid url
Expand Down