fix: Bookdrop responsive UI (#2070)
This commit is contained in:
+311
-135
@@ -2,13 +2,12 @@
|
|||||||
<form [formGroup]="metadataForm" class="metapicker flex flex-col w-full">
|
<form [formGroup]="metadataForm" class="metapicker flex flex-col w-full">
|
||||||
<div class="flex-grow overflow-auto">
|
<div class="flex-grow overflow-auto">
|
||||||
<div class="metaheader relative flex items-center">
|
<div class="metaheader relative flex items-center">
|
||||||
<label class="md:w-[8rem]"></label>
|
<label class="md:w-[8rem] text-sm"></label>
|
||||||
<div class="flex w-full items-center">
|
<div class="flex w-full items-center">
|
||||||
<p class="w-1/2 pr-3" style="text-align:right">File Metadata</p>
|
<p class="w-1/2">File Data</p>
|
||||||
<div class="midbuttons">
|
<div class="midbuttons">
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
severity="success"
|
|
||||||
icon="pi pi-angle-left"
|
icon="pi pi-angle-left"
|
||||||
class="mx-2"
|
class="mx-2"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
@@ -18,7 +17,6 @@
|
|||||||
></p-button>
|
></p-button>
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
severity="success"
|
|
||||||
icon="pi pi-angle-double-left"
|
icon="pi pi-angle-double-left"
|
||||||
class="mx-2"
|
class="mx-2"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
@@ -26,89 +24,163 @@
|
|||||||
tooltipPosition="bottom"
|
tooltipPosition="bottom"
|
||||||
(onClick)="copyAll()"
|
(onClick)="copyAll()"
|
||||||
></p-button>
|
></p-button>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
severity="warn"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
class="mx-2"
|
||||||
|
[outlined]="true"
|
||||||
|
pTooltip="Reset all fields to original values"
|
||||||
|
tooltipPosition="bottom"
|
||||||
|
(onClick)="confirmReset()"
|
||||||
|
></p-button>
|
||||||
</div>
|
</div>
|
||||||
<p class="w-1/2 pl-3">Fetched</p>
|
<p class="w-1/2">Fetched Data</p>
|
||||||
</div>
|
|
||||||
<div class="ml-auto absolute" style="right:1rem">
|
|
||||||
<p-button
|
|
||||||
size="small"
|
|
||||||
severity="warn"
|
|
||||||
icon="pi pi-refresh"
|
|
||||||
[outlined]="true"
|
|
||||||
pTooltip="Reset all fields to original values"
|
|
||||||
tooltipPosition="left"
|
|
||||||
(onClick)="confirmReset()"
|
|
||||||
></p-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="metacontent">
|
<div class="metacontent">
|
||||||
<div class="meta-row flex items-center">
|
<div class="meta-row field-thumbnail">
|
||||||
<label class="md:w-[8rem] text-sm">Cover</label>
|
<label class="md:w-[8rem] text-sm"></label>
|
||||||
<div class="flex w-full items-center justify-center">
|
<div class="flex w-full items-center justify-center">
|
||||||
<p-image class="thumbnail" [src]="metadataForm.get('thumbnailUrl')?.value" alt="Image" appendTo="body" lazyLoad [preview]="true"></p-image>
|
<div class="flex w-1/2">
|
||||||
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl" class="md:!w-1/2"/>
|
@if (metadataForm.get('thumbnailUrl')?.value) {
|
||||||
|
<p-image
|
||||||
|
class="thumbnail"
|
||||||
|
[src]="metadataForm.get('thumbnailUrl')?.value"
|
||||||
|
alt="Image"
|
||||||
|
appendTo="body"
|
||||||
|
lazyLoad
|
||||||
|
[preview]="true"
|
||||||
|
[ngClass]="{
|
||||||
|
'changed': isValueCopied('thumbnailUrl'),
|
||||||
|
}"
|
||||||
|
></p-image>
|
||||||
|
}
|
||||||
|
@else {
|
||||||
|
<div class="thumbnail text-sm">No cover image</div>
|
||||||
|
}
|
||||||
|
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl"/>
|
||||||
|
</div>
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
[icon]="isValueSaved('thumbnailUrl') ? 'pi pi-check' : (hoveredFields['thumbnailUrl'] && isValueCopied('thumbnailUrl') ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved('thumbnailUrl') ? 'pi pi-check' : (isValueCopied('thumbnailUrl') ? 'pi pi-refresh' : 'pi pi-angle-left')"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[ngClass]="
|
|
||||||
{
|
|
||||||
'green-outlined-button': isValueCopied('thumbnailUrl') && !hoveredFields['thumbnailUrl'],
|
|
||||||
'red-outlined-button': isValueCopied('thumbnailUrl') && hoveredFields['thumbnailUrl']
|
|
||||||
}"
|
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields['thumbnailUrl'] && isValueCopied('thumbnailUrl') ? resetField('thumbnailUrl') : copyFetchedToCurrent('thumbnailUrl')"
|
[severity]="isValueCopied('thumbnailUrl') ? 'warn' : null"
|
||||||
(mouseenter)="onMouseEnter('thumbnailUrl')"
|
[disabled]="!isFetchedDifferent('thumbnailUrl') && !isValueCopied('thumbnailUrl')"
|
||||||
(mouseleave)="onMouseLeave('thumbnailUrl')"/>
|
(click)="isValueCopied('thumbnailUrl') ? resetField('thumbnailUrl') : copyFetchedToCurrent('thumbnailUrl')"
|
||||||
<input type="hidden" [value]="fetchedMetadata.thumbnailUrl" class="md:!w-1/2" readonly/>
|
/>
|
||||||
<p-image class="thumbnail" [src]="fetchedMetadata.thumbnailUrl!" alt="Image" appendTo="body" lazyLoad [preview]="true"></p-image>
|
<div class="flex w-1/2">
|
||||||
|
@if (fetchedMetadata.thumbnailUrl) {
|
||||||
|
<p-image
|
||||||
|
class="thumbnail"
|
||||||
|
[src]="fetchedMetadata.thumbnailUrl!"
|
||||||
|
alt="Image"
|
||||||
|
appendTo="body"
|
||||||
|
lazyLoad
|
||||||
|
[preview]="true"
|
||||||
|
></p-image>
|
||||||
|
}
|
||||||
|
@else {
|
||||||
|
<div class="thumbnail text-sm">Cover image not found</div>
|
||||||
|
}
|
||||||
|
<input type="hidden" [value]="fetchedMetadata.thumbnailUrl" readonly/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@for (field of metadataFieldsTop; track field) {
|
@for (field of metadataFieldsTop; track field) {
|
||||||
<div class="meta-row flex items-center field-{{field.controlName}}">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="meta-fields flex w-full">
|
<div class="meta-fields">
|
||||||
<input
|
<input
|
||||||
pSize="small"
|
pSize="small"
|
||||||
fluid
|
fluid
|
||||||
pInputText
|
pInputText
|
||||||
id="{{field.controlName}}"
|
id="{{field.controlName}}"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
class="dest md:!w-1/2"
|
class="dest"
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
'outlined-input-green': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
'changed': isValueChanged(field.controlName),
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (isValueChanged(field.controlName) || !fetchedMetadata[field.fetchedKey] ? 'pi pi-refresh' : 'pi pi-angle-left')"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="{
|
||||||
{
|
'nosrc' : !fetchedMetadata[field.fetchedKey]
|
||||||
'green-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName],
|
|
||||||
'notneeded' : !fetchedMetadata[field.fetchedKey]
|
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
[severity]="isValueChanged(field.controlName) ? 'warn' : null"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
[disabled]="!isFetchedDifferent(field.controlName) && !isValueChanged(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(click)="isValueChanged(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
<input
|
/>
|
||||||
pSize="small"
|
@if (fetchedMetadata[field.fetchedKey]) {
|
||||||
pInputText
|
<input
|
||||||
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
pSize="small"
|
||||||
class="src md:!w-1/2"
|
pInputText
|
||||||
disabled
|
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
||||||
|
class="src"
|
||||||
|
disabled
|
||||||
|
[ngClass]="{
|
||||||
|
'diff': isFetchedDifferent(field.controlName),
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@for (field of metadataPublishDate; track field) {
|
||||||
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
|
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
|
<div class="meta-fields">
|
||||||
|
<p-datepicker
|
||||||
|
size="small"
|
||||||
|
fluid
|
||||||
|
inputId="{{field.controlName}}"
|
||||||
|
formControlName="{{field.controlName}}"
|
||||||
|
dataType="string"
|
||||||
|
dateFormat="yy-mm-dd"
|
||||||
|
[keepInvalid]="true"
|
||||||
|
[showIcon]="true"
|
||||||
|
[iconDisplay]="'input'"
|
||||||
|
appendTo="body"
|
||||||
|
class="dest"
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
'notneeded': !fetchedMetadata[field.fetchedKey],
|
'changed': isValueChanged(field.controlName),
|
||||||
}"/>
|
}">
|
||||||
|
</p-datepicker>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (isValueChanged(field.controlName) || !fetchedMetadata[field.fetchedKey] ? 'pi pi-refresh' : 'pi pi-angle-left')"
|
||||||
|
[outlined]="true"
|
||||||
|
[ngClass]="{
|
||||||
|
'nosrc' : !fetchedMetadata[field.fetchedKey]
|
||||||
|
}"
|
||||||
|
class="arrow-button"
|
||||||
|
[severity]="isValueChanged(field.controlName) ? 'warn' : null"
|
||||||
|
[disabled]="!isFetchedDifferent(field.controlName) && !isValueChanged(field.controlName)"
|
||||||
|
(click)="isValueChanged(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
|
/>
|
||||||
|
@if (fetchedMetadata[field.fetchedKey]) {
|
||||||
|
<input
|
||||||
|
pSize="small"
|
||||||
|
pInputText
|
||||||
|
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
||||||
|
class="src"
|
||||||
|
disabled
|
||||||
|
[ngClass]="{
|
||||||
|
'diff': isFetchedDifferent(field.controlName),
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@for (field of metadataChips; track field) {
|
@for (field of metadataChips; track field) {
|
||||||
<div class="meta-row flex items-center field-{{field.controlName}}">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="meta-fields flex w-full items-center">
|
<div class="meta-fields">
|
||||||
<p-autoComplete
|
<p-autoComplete
|
||||||
size="small"
|
size="small"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
@@ -117,115 +189,123 @@
|
|||||||
[dropdown]="false"
|
[dropdown]="false"
|
||||||
[forceSelection]="false"
|
[forceSelection]="false"
|
||||||
class="dest w-full"
|
class="dest w-full"
|
||||||
[ngClass]="{'outlined-input-green': isValueCopied(field.controlName) && !hoveredFields[field.controlName]}"
|
[ngClass]="{
|
||||||
(onBlur)="onAutoCompleteBlur(field.controlName, $event)"/>
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}"
|
||||||
|
(onBlur)="onAutoCompleteBlur(field.controlName, $event)"
|
||||||
|
/>
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (isValueChanged(field.controlName) || !fetchedMetadata[field.fetchedKey] ? 'pi pi-refresh' : 'pi pi-angle-left')"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="{
|
||||||
{
|
'nosrc' : !fetchedMetadata[field.fetchedKey]
|
||||||
'green-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName],
|
|
||||||
'notneeded' : !fetchedMetadata[field.fetchedKey]
|
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
[severity]="isValueChanged(field.controlName) ? 'warn' : null"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
[disabled]="!isFetchedDifferent(field.controlName) && !isValueChanged(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(click)="isValueChanged(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
<p-autoComplete
|
/>
|
||||||
size="small"
|
@if (fetchedMetadata[field.fetchedKey]) {
|
||||||
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
<p-autoComplete
|
||||||
[ngModelOptions]="{standalone:true}"
|
size="small"
|
||||||
[disabled]="true"
|
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
||||||
[multiple]="true"
|
[ngModelOptions]="{standalone:true}"
|
||||||
[typeahead]="false"
|
[disabled]="true"
|
||||||
[dropdown]="false"
|
[multiple]="true"
|
||||||
[forceSelection]="false"
|
[typeahead]="false"
|
||||||
class="src w-full"
|
[dropdown]="false"
|
||||||
[ngClass]="{
|
[forceSelection]="false"
|
||||||
'notneeded': !fetchedMetadata[field.fetchedKey],
|
class="src w-full"
|
||||||
}"/>
|
[ngClass]="{
|
||||||
|
'diff': isFetchedDifferent(field.controlName),
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@for (field of metadataDescription; track field) {
|
@for (field of metadataDescription; track field) {
|
||||||
<div class="meta-row flex items-center field-{{field.controlName}}">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="meta-fields flex w-full items-center">
|
<div class="meta-fields">
|
||||||
<textarea
|
<textarea
|
||||||
|
pTextarea
|
||||||
rows="4"
|
rows="4"
|
||||||
pSize="small"
|
pSize="small"
|
||||||
pTextarea
|
|
||||||
id="{{field.controlName}}"
|
id="{{field.controlName}}"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
class="dest md:!w-1/2"
|
class="dest"
|
||||||
[ngClass]="{'outlined-input-green': isValueCopied(field.controlName) && !hoveredFields[field.controlName]}"
|
[ngClass]="{
|
||||||
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}"
|
||||||
></textarea>
|
></textarea>
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (isValueChanged(field.controlName) || !fetchedMetadata[field.fetchedKey] ? 'pi pi-refresh' : 'pi pi-angle-left')"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="{
|
||||||
{
|
'nosrc' : !fetchedMetadata[field.fetchedKey]
|
||||||
'green-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName],
|
|
||||||
'notneeded' : !fetchedMetadata[field.fetchedKey]
|
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
[severity]="isValueChanged(field.controlName) ? 'warn' : null"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
[disabled]="!isFetchedDifferent(field.controlName) && !isValueChanged(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(click)="isValueChanged(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
<textarea
|
/>
|
||||||
rows="4"
|
@if (fetchedMetadata[field.fetchedKey]) {
|
||||||
pSize="small"
|
<textarea
|
||||||
pInputText
|
pTextarea
|
||||||
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
rows="4"
|
||||||
class="src md:!w-1/2"
|
pSize="small"
|
||||||
disabled
|
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
||||||
[ngClass]="{
|
class="src"
|
||||||
'notneeded': !fetchedMetadata[field.fetchedKey],
|
disabled
|
||||||
}"></textarea>
|
[ngClass]="{
|
||||||
|
'diff': isFetchedDifferent(field.controlName),
|
||||||
|
}"
|
||||||
|
></textarea>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@for (field of metadataFieldsBottom; track field) {
|
@for (field of metadataFieldsBottom; track field) {
|
||||||
<div class="meta-row flex items-cente field-{{field.controlName}}">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="md:w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="meta-fields flex w-full">
|
<div class="meta-fields">
|
||||||
<input
|
<input
|
||||||
pInputText
|
pInputText
|
||||||
pSize="small"
|
pSize="small"
|
||||||
id="{{field.controlName}}"
|
id="{{field.controlName}}"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
class="dest md:!w-1/2"
|
class="dest"
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
'outlined-input-green': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
'changed': isValueChanged(field.controlName),
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<p-button
|
<p-button
|
||||||
size="small"
|
size="small"
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (isValueChanged(field.controlName) || !fetchedMetadata[field.fetchedKey] ? 'pi pi-refresh' : 'pi pi-angle-left')"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="{
|
||||||
{
|
'nosrc' : !fetchedMetadata[field.fetchedKey]
|
||||||
'green-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName],
|
|
||||||
'notneeded' : !fetchedMetadata[field.fetchedKey]
|
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
[severity]="isValueChanged(field.controlName) ? 'warn' : null"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
[disabled]="!isFetchedDifferent(field.controlName) && !isValueChanged(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(click)="isValueChanged(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
<input
|
/>
|
||||||
pInputText
|
@if (fetchedMetadata[field.fetchedKey]) {
|
||||||
pSize="small"
|
<input
|
||||||
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
pInputText
|
||||||
class="src md:!w-1/2"
|
pSize="small"
|
||||||
disabled
|
[value]="fetchedMetadata[field.fetchedKey] ?? null"
|
||||||
[ngClass]="{
|
class="src"
|
||||||
'notneeded': !fetchedMetadata[field.fetchedKey],
|
disabled
|
||||||
}"/>
|
[ngClass]="{
|
||||||
|
'diff': isFetchedDifferent(field.controlName),
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -236,7 +316,7 @@
|
|||||||
<form [formGroup]="metadataForm" class="metaeditor flex w-full">
|
<form [formGroup]="metadataForm" class="metaeditor flex w-full">
|
||||||
<div class="flex-grow overflow-auto">
|
<div class="flex-grow overflow-auto">
|
||||||
<div class="metaheader relative flex items-center">
|
<div class="metaheader relative flex items-center">
|
||||||
<p class="text-sm flex items-center" style="gap: 0.5rem">
|
<p class="text-sm missingmd">
|
||||||
Unable to fetch metadata for this file
|
Unable to fetch metadata for this file
|
||||||
</p>
|
</p>
|
||||||
<p-button
|
<p-button
|
||||||
@@ -249,9 +329,9 @@
|
|||||||
(onClick)="confirmReset()"
|
(onClick)="confirmReset()"
|
||||||
></p-button>
|
></p-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col p-4 md:flex-row">
|
<div class="metabody flex flex-col p-4 md:flex-row">
|
||||||
<div class="flex items-start justify-center md:w-[20%] md:h-full">
|
<div class="flex items-start justify-center md:w-[20%] md:h-full">
|
||||||
<div class="w-full md:h-full">
|
<div class="w-full md:h-full field-thumbnail">
|
||||||
<img
|
<img
|
||||||
[src]="metadataForm.get('thumbnailUrl')?.value"
|
[src]="metadataForm.get('thumbnailUrl')?.value"
|
||||||
alt="Book Thumbnail"
|
alt="Book Thumbnail"
|
||||||
@@ -260,10 +340,9 @@
|
|||||||
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl"/>
|
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="metacontent md:w-[80%]">
|
<div class="metacontent md:w-[80%]">
|
||||||
@for (field of metadataFieldsTop; track field) {
|
@for (field of metadataFieldsTop; track field) {
|
||||||
<div class="meta-row flex items-center">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
<input
|
<input
|
||||||
@@ -272,39 +351,136 @@
|
|||||||
pInputText
|
pInputText
|
||||||
id="{{field.controlName}}"
|
id="{{field.controlName}}"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
|
[ngClass]="{
|
||||||
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
[outlined]="true"
|
||||||
|
class="arrow-button"
|
||||||
|
severity="warn"
|
||||||
|
[disabled]="!isValueChanged(field.controlName)"
|
||||||
|
(click)="resetField(field.controlName)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@for (field of metadataPublishDate; track field) {
|
||||||
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
|
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
|
<div class="flex w-full">
|
||||||
|
<p-datepicker
|
||||||
|
size="small"
|
||||||
|
fluid
|
||||||
|
inputId="{{field.controlName}}"
|
||||||
|
formControlName="{{field.controlName}}"
|
||||||
|
dataType="string"
|
||||||
|
dateFormat="yy-mm-dd"
|
||||||
|
[keepInvalid]="true"
|
||||||
|
[showIcon]="true"
|
||||||
|
[iconDisplay]="'input'"
|
||||||
|
appendTo="body"
|
||||||
|
class="w-full"
|
||||||
|
[ngClass]="{
|
||||||
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}">
|
||||||
|
</p-datepicker>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
[outlined]="true"
|
||||||
|
class="arrow-button"
|
||||||
|
severity="warn"
|
||||||
|
[disabled]="!isValueChanged(field.controlName)"
|
||||||
|
(click)="resetField(field.controlName)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@for (field of metadataChips; track field) {
|
@for (field of metadataChips; track field) {
|
||||||
<div class="meta-row flex items-center">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
<p-autoComplete formControlName="{{field.controlName}}" [multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full" (onBlur)="onAutoCompleteBlur(field.controlName, $event)"></p-autoComplete>
|
<p-autoComplete
|
||||||
|
size="small"
|
||||||
|
formControlName="{{field.controlName}}"
|
||||||
|
[multiple]="true"
|
||||||
|
[typeahead]="false"
|
||||||
|
[dropdown]="false"
|
||||||
|
[forceSelection]="false"
|
||||||
|
class="w-full"
|
||||||
|
[ngClass]="{
|
||||||
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}"
|
||||||
|
(onBlur)="onAutoCompleteBlur(field.controlName, $event)"
|
||||||
|
/>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
[outlined]="true"
|
||||||
|
class="arrow-button"
|
||||||
|
severity="warn"
|
||||||
|
[disabled]="!isValueChanged(field.controlName)"
|
||||||
|
(click)="resetField(field.controlName)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@for (field of metadataDescription; track field) {
|
@for (field of metadataDescription; track field) {
|
||||||
<div class="meta-row flex items-center">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
<textarea fluid rows="4" pSize="small" pTextarea id="{{field.controlName}}" formControlName="{{field.controlName}}"></textarea>
|
<textarea
|
||||||
|
pTextarea
|
||||||
|
fluid
|
||||||
|
rows="4"
|
||||||
|
pSize="small"
|
||||||
|
id="{{field.controlName}}"
|
||||||
|
formControlName="{{field.controlName}}"
|
||||||
|
[ngClass]="{
|
||||||
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}"
|
||||||
|
></textarea>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
[outlined]="true"
|
||||||
|
class="arrow-button"
|
||||||
|
severity="warn"
|
||||||
|
[disabled]="!isValueChanged(field.controlName)"
|
||||||
|
(click)="resetField(field.controlName)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@for (field of metadataFieldsBottom; track field) {
|
@for (field of metadataFieldsBottom; track field) {
|
||||||
<div class="meta-row flex items-center">
|
<div class="meta-row field-{{field.controlName}}">
|
||||||
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="w-[8rem] text-sm">{{ field.label }}</label>
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
<input
|
<input
|
||||||
|
pSize="small"
|
||||||
fluid
|
fluid
|
||||||
pInputText
|
pInputText
|
||||||
pSize="small"
|
|
||||||
id="{{field.controlName}}"
|
id="{{field.controlName}}"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
|
[ngClass]="{
|
||||||
|
'changed': isValueChanged(field.controlName),
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<p-button
|
||||||
|
size="small"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
[outlined]="true"
|
||||||
|
class="arrow-button"
|
||||||
|
severity="warn"
|
||||||
|
[disabled]="!isValueChanged(field.controlName)"
|
||||||
|
(click)="resetField(field.controlName)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+172
-62
@@ -1,38 +1,57 @@
|
|||||||
.thumbnail {
|
.thumbnail {
|
||||||
width: 10rem;
|
border: 1px solid var(--border-color);
|
||||||
height: 14rem;
|
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
margin: 0 auto 1rem;
|
margin: 0 auto 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .metapicker .thumbnail {
|
||||||
|
img {
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
max-height: 14rem;
|
||||||
|
max-width: 10em;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
max-width: 50%;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.metaeditor .thumbnail {
|
|
||||||
width: 100%;
|
.metapicker div.thumbnail {
|
||||||
|
background-color: var(--p-inputtext-disabled-background);
|
||||||
|
color: var(--p-inputtext-disabled-color);
|
||||||
|
width: 9rem;
|
||||||
|
height: 14rem;
|
||||||
|
padding: 1rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .metaeditor img.thumbnail {
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
max-height: 14em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow-button {
|
.metaeditor .arrow-button {
|
||||||
padding-left: 1rem;
|
padding: 0;
|
||||||
padding-right: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.green-outlined-button {
|
.thumbnail.changed,
|
||||||
--p-button-outlined-primary-border-color: forestgreen;
|
input.changed,
|
||||||
--p-button-outlined-primary-color: forestgreen;
|
textarea.changed,
|
||||||
}
|
::ng-deep p-datepicker.changed input,
|
||||||
|
::ng-deep p-autocomplete.changed ul.p-autocomplete-input-multiple {
|
||||||
.red-outlined-button {
|
border: 1px solid var(--p-button-outlined-warn-border-color) !important;
|
||||||
--p-button-outlined-primary-border-color: #E32636;
|
|
||||||
--p-button-outlined-primary-color: #E32636;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.outlined-input-green,
|
|
||||||
textarea.outlined-input-green,
|
|
||||||
::ng-deep p-autocomplete.outlined-input-green ul.p-autocomplete-input-multiple {
|
|
||||||
border: 1px solid forestgreen !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::ng-deep .p-inputchips {
|
::ng-deep .p-inputchips {
|
||||||
@@ -52,14 +71,58 @@ textarea.outlined-input-green,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.metapicker label,
|
.metapicker label,
|
||||||
.metaeditor label {
|
.metaeditor label,
|
||||||
|
.missingmd {
|
||||||
color: var(--text-color-secondary);
|
color: var(--text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::ng-deep .metapicker {
|
||||||
|
.dest, .src {
|
||||||
|
width: calc(50% - 2rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow-button {
|
||||||
|
margin: auto 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.arrow-button.nosrc button[disabled] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input.diff,
|
||||||
|
textarea.diff,
|
||||||
|
.p-autocomplete.diff .p-chip-label {
|
||||||
|
color: var(--p-primary-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src .p-chip.p-disabled {
|
||||||
|
color: var(--p-inputtext-disabled-color) !important;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src .p-chip-remove-icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src li.p-autocomplete-input-chip {
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.metaheader {
|
.metaheader {
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px dotted var(--border-color);
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
p {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.metaheader .midbuttons {
|
.metaheader .midbuttons {
|
||||||
@@ -69,12 +132,42 @@ textarea.outlined-input-green,
|
|||||||
.metacontent {
|
.metacontent {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metaeditor .metacontent {
|
.metaeditor .metacontent {
|
||||||
padding: 0 0 0 1rem;
|
padding: 0 0 0 1rem;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::ng-deep button {
|
||||||
|
border-left-width: 0;
|
||||||
|
border-radius: 0 6px 6px 0;
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
opacity: 1;
|
||||||
|
border-color: var(--p-inputtext-border-color) !important;
|
||||||
|
|
||||||
|
span {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep input,
|
||||||
|
::ng-deep ul,
|
||||||
|
textarea {
|
||||||
|
border-radius: 6px 0 0 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-authors,
|
||||||
|
.field-categories,
|
||||||
|
.field-moods,
|
||||||
|
.field-tags {
|
||||||
|
::ng-deep button {
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-status {
|
.metadata-status {
|
||||||
@@ -91,55 +184,54 @@ textarea.outlined-input-green,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.metaheader,
|
||||||
|
.metapicker .metacontent,
|
||||||
|
.metaeditor .metabody {
|
||||||
|
padding-left: 3.25rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.meta-row {
|
.meta-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
|
|
||||||
|
label {
|
||||||
|
margin: auto 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-fields {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-description .meta-fields {
|
||||||
|
align-items: stretch;
|
||||||
|
|
||||||
|
.src {
|
||||||
|
resize: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.meta-row {
|
.meta-row {
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.metapicker .meta-row {
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.metapicker .meta-fields {
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.dest {
|
|
||||||
width: 50%;
|
|
||||||
order: 1;
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
p-button {
|
|
||||||
padding: 0;
|
|
||||||
order: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep button {
|
|
||||||
border-left-width: 0;
|
|
||||||
border-radius: 0 6px 6px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.src {
|
|
||||||
width: 50%;
|
|
||||||
order: 2;
|
|
||||||
border-radius: 6px 0 0 6px;
|
|
||||||
margin-left: 0.25rem;
|
|
||||||
|
|
||||||
::ng-deep ul {
|
|
||||||
border-radius: 6px 0 0 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.metapicker {
|
.metapicker {
|
||||||
|
.field-thumbnail label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.field-title,
|
.field-title,
|
||||||
.field-subtitle,
|
.field-subtitle,
|
||||||
.field-publisher,
|
.field-publisher,
|
||||||
@@ -156,13 +248,31 @@ textarea.outlined-input-green,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dest {
|
.dest {
|
||||||
width: 100% !important;
|
flex: 1 !important;
|
||||||
|
width: auto !important;
|
||||||
margin: 0 0 2px 0;
|
margin: 0 0 2px 0;
|
||||||
|
|
||||||
|
&:not(:only-child) {
|
||||||
|
border-radius: 6px 0 0 6px;
|
||||||
|
|
||||||
|
::ng-deep ul {
|
||||||
|
border-radius: 6px 0 0 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow-button {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep button {
|
||||||
|
border-left-width: 0;
|
||||||
|
border-radius: 0 6px 6px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.src {
|
.src {
|
||||||
flex: 1 !important;
|
width: 100% !important;
|
||||||
width: auto !important;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-19
@@ -11,6 +11,7 @@ import {AutoComplete} from 'primeng/autocomplete';
|
|||||||
import {Image} from 'primeng/image';
|
import {Image} from 'primeng/image';
|
||||||
import {LazyLoadImageModule} from 'ng-lazyload-image';
|
import {LazyLoadImageModule} from 'ng-lazyload-image';
|
||||||
import {ConfirmationService} from 'primeng/api';
|
import {ConfirmationService} from 'primeng/api';
|
||||||
|
import {DatePicker} from 'primeng/datepicker';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bookdrop-file-metadata-picker-component',
|
selector: 'app-bookdrop-file-metadata-picker-component',
|
||||||
@@ -24,7 +25,8 @@ import {ConfirmationService} from 'primeng/api';
|
|||||||
Textarea,
|
Textarea,
|
||||||
AutoComplete,
|
AutoComplete,
|
||||||
Image,
|
Image,
|
||||||
LazyLoadImageModule
|
LazyLoadImageModule,
|
||||||
|
DatePicker,
|
||||||
],
|
],
|
||||||
templateUrl: './bookdrop-file-metadata-picker.component.html',
|
templateUrl: './bookdrop-file-metadata-picker.component.html',
|
||||||
styleUrl: './bookdrop-file-metadata-picker.component.scss'
|
styleUrl: './bookdrop-file-metadata-picker.component.scss'
|
||||||
@@ -47,6 +49,9 @@ export class BookdropFileMetadataPickerComponent {
|
|||||||
{label: 'Title', controlName: 'title', fetchedKey: 'title'},
|
{label: 'Title', controlName: 'title', fetchedKey: 'title'},
|
||||||
{label: 'Subtitle', controlName: 'subtitle', fetchedKey: 'subtitle'},
|
{label: 'Subtitle', controlName: 'subtitle', fetchedKey: 'subtitle'},
|
||||||
{label: 'Publisher', controlName: 'publisher', fetchedKey: 'publisher'},
|
{label: 'Publisher', controlName: 'publisher', fetchedKey: 'publisher'},
|
||||||
|
];
|
||||||
|
|
||||||
|
metadataPublishDate = [
|
||||||
{label: 'Publish Date', controlName: 'publishedDate', fetchedKey: 'publishedDate'}
|
{label: 'Publish Date', controlName: 'publishedDate', fetchedKey: 'publishedDate'}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -113,16 +118,31 @@ export class BookdropFileMetadataPickerComponent {
|
|||||||
|
|
||||||
copyFetchedToCurrent(field: string): void {
|
copyFetchedToCurrent(field: string): void {
|
||||||
const value = this.fetchedMetadata[field];
|
const value = this.fetchedMetadata[field];
|
||||||
if (value && !this.copiedFields[field]) {
|
if (value) {
|
||||||
this.metadataForm.get(field)?.setValue(value);
|
this.metadataForm.get(field)?.setValue(value);
|
||||||
this.copiedFields[field] = true;
|
this.copiedFields[field] = true;
|
||||||
this.highlightCopiedInput(field);
|
|
||||||
this.metadataCopied.emit(true);
|
this.metadataCopied.emit(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
highlightCopiedInput(field: string): void {
|
isValueChanged(field: string): boolean {
|
||||||
this.copiedFields[field] = true;
|
const [value, original] = this.prepFieldComparison(this.metadataForm.get(field)?.value, this.originalMetadata?.[field]);
|
||||||
|
return (value && value != original) || (!value && original);
|
||||||
|
}
|
||||||
|
|
||||||
|
isFetchedDifferent(field: string): boolean {
|
||||||
|
const [value, fetched] = this.prepFieldComparison(this.metadataForm.get(field)?.value, this.fetchedMetadata[field]);
|
||||||
|
return (fetched && fetched != value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private prepFieldComparison(field1: any, field2: any) {
|
||||||
|
if (Array.isArray(field1)) {
|
||||||
|
field1 = field1.length > 0 ? JSON.stringify(field1.sort()) : undefined;
|
||||||
|
}
|
||||||
|
if (Array.isArray(field2)) {
|
||||||
|
field2 = field2.length > 0 ? JSON.stringify(field2.sort()) : undefined;
|
||||||
|
}
|
||||||
|
return [field1, field2];
|
||||||
}
|
}
|
||||||
|
|
||||||
isValueCopied(field: string): boolean {
|
isValueCopied(field: string): boolean {
|
||||||
@@ -133,22 +153,9 @@ export class BookdropFileMetadataPickerComponent {
|
|||||||
return this.savedFields[field];
|
return this.savedFields[field];
|
||||||
}
|
}
|
||||||
|
|
||||||
hoveredFields: { [key: string]: boolean } = {};
|
|
||||||
|
|
||||||
onMouseEnter(controlName: string): void {
|
|
||||||
if (this.isValueCopied(controlName) && !this.isValueSaved(controlName)) {
|
|
||||||
this.hoveredFields[controlName] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMouseLeave(controlName: string): void {
|
|
||||||
this.hoveredFields[controlName] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
resetField(field: string) {
|
resetField(field: string) {
|
||||||
this.metadataForm.get(field)?.setValue(this.originalMetadata?.[field]);
|
this.metadataForm.get(field)?.setValue(this.originalMetadata?.[field]);
|
||||||
this.copiedFields[field] = false;
|
this.copiedFields[field] = false;
|
||||||
this.hoveredFields[field] = false;
|
|
||||||
if (field === 'thumbnailUrl') {
|
if (field === 'thumbnailUrl') {
|
||||||
this.metadataForm.get('thumbnailUrl')?.setValue(this.urlHelper.getBookdropCoverUrl(this.bookdropFileId));
|
this.metadataForm.get('thumbnailUrl')?.setValue(this.urlHelper.getBookdropCoverUrl(this.bookdropFileId));
|
||||||
}
|
}
|
||||||
@@ -216,7 +223,6 @@ export class BookdropFileMetadataPickerComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.copiedFields = {};
|
this.copiedFields = {};
|
||||||
this.hoveredFields = {};
|
|
||||||
this.metadataCopied.emit(false);
|
this.metadataCopied.emit(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -155,7 +155,7 @@
|
|||||||
@for (file of bookdropFileUis; track file) {
|
@for (file of bookdropFileUis; track file) {
|
||||||
|
|
||||||
<div class="file-item">
|
<div class="file-item">
|
||||||
<div class="file-row">
|
<div class="file-row" [ngClass]="file.showDetails ? ' expanded' : ''">
|
||||||
<p-checkbox
|
<p-checkbox
|
||||||
[binary]="true"
|
[binary]="true"
|
||||||
[(ngModel)]="file.selected"
|
[(ngModel)]="file.selected"
|
||||||
|
|||||||
+31
-8
@@ -8,7 +8,9 @@
|
|||||||
border: 1px solid var(--p-content-border-color);
|
border: 1px solid var(--p-content-border-color);
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
height: calc(100dvh - 4.9rem);
|
height: calc(100dvh - 4.4rem);
|
||||||
|
border-radius: 0;
|
||||||
|
border-width: 1px 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,9 +159,10 @@
|
|||||||
|
|
||||||
.default-controls {
|
.default-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: flex-end;
|
||||||
|
|
||||||
p-select {
|
p-select {
|
||||||
width: 8rem;
|
width: 8rem;
|
||||||
@@ -174,7 +177,6 @@
|
|||||||
|
|
||||||
p-select {
|
p-select {
|
||||||
flex-basis: 50%;
|
flex-basis: 50%;
|
||||||
max-width: 250px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -271,6 +273,9 @@ p-inputgroup.disabled {
|
|||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
.file-row.expanded {
|
||||||
|
border-bottom-style: dotted;
|
||||||
|
}
|
||||||
|
|
||||||
.status-indicator {
|
.status-indicator {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
@@ -331,7 +336,7 @@ div.cover-image {
|
|||||||
.file-library {
|
.file-library {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
justify-content: space-between;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
@@ -345,7 +350,6 @@ div.cover-image {
|
|||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
flex-basis: 50%;
|
flex-basis: 50%;
|
||||||
max-width: 250px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,10 +391,18 @@ div.cover-image {
|
|||||||
|
|
||||||
.footer-left {
|
.footer-left {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
@media (max-width: 540px) {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-right {
|
.footer-right {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
@media (max-width: 540px) {
|
||||||
|
order: 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-center {
|
.footer-center {
|
||||||
@@ -398,13 +410,24 @@ div.cover-image {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
.p-paginator {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
::ng-deep .p-paginator .p-paginator-jtp-dropdown span {
|
||||||
|
font-size: var(--p-select-sm-font-size);
|
||||||
|
padding-block: var(--p-select-sm-padding-y);
|
||||||
|
padding-inline: var(--p-select-sm-padding-x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 540px) {
|
||||||
|
order: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.p-paginator {
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 5rem 1.1rem 2rem 3.6rem;
|
padding: 5rem 1.1rem 1.1rem 3.6rem;
|
||||||
transition: margin-left variables.$transitionDuration;
|
transition: margin-left variables.$transitionDuration;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
.layout-sidebar {
|
.layout-sidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 225px;
|
width: 225px;
|
||||||
height: calc(100dvh - 6rem);
|
height: calc(100dvh - 6.1rem);
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
top: 4.9rem;
|
top: 5rem;
|
||||||
left: 1.1rem;
|
left: 1.1rem;
|
||||||
transition: transform variables.$transitionDuration, left variables.$transitionDuration;
|
transition: transform variables.$transitionDuration, left variables.$transitionDuration;
|
||||||
background-color: var(--card-background);
|
background-color: var(--card-background);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
&.layout-overlay {
|
&.layout-overlay {
|
||||||
.layout-main-container {
|
.layout-main-container {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding: 5rem 1.1rem 2rem 3.6rem;
|
padding: 5rem 1.1rem 1.1rem 3.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-sidebar {
|
.layout-sidebar {
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
.layout-main-container {
|
.layout-main-container {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding: 5rem 1rem 2rem 1.5rem;
|
padding: 5rem 1.1rem 1.1rem 1.1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
.layout-wrapper {
|
.layout-wrapper {
|
||||||
.layout-main-container {
|
.layout-main-container {
|
||||||
padding: 4.4rem 0.5rem 0.5rem 0.5rem;
|
padding-left: 1.1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-sidebar {
|
.layout-sidebar {
|
||||||
@@ -100,3 +100,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.layout-wrapper {
|
||||||
|
.layout-main-container {
|
||||||
|
padding: 4.4rem 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user