Skip to content

Commit

Permalink
UBER-296: Fix create application color selector
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
  • Loading branch information
haiodo committed May 29, 2023
1 parent 6b7e83c commit 5f71398
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/ColorPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
dispatch('close', itemValue)
}}
>
<div class="color" style:background-color={color.background}>{color.name}</div>
<div class="color" style:background={color.color} />
<span class="label" style:color={color.title}>{itemValue.label}</span>
<div class="check">
{#if itemValue.id === selected}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@
</script>

<div class="flex">
<a class="mr-1" href={getFileUrl(attachment.file)} download={attachment.name} on:click|stopPropagation>
<a
class="mr-1"
href={getFileUrl(attachment.file, 'full', attachment.name)}
download={attachment.name}
on:click|stopPropagation
>
<ActionIcon icon={FileDownload} size={'small'} action={() => {}} />
</a>
<ActionIcon icon={IconMoreH} size={'small'} action={showMenu} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
{#if isImage(value.type)}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="cellImagePreview" on:click={openAttachment}>
<img class={'img-fit'} src={getFileUrl(value.file)} alt={value.name} />
<img class={'img-fit'} src={getFileUrl(value.file, 'full', value.name)} alt={value.name} />
</div>
{:else}
<div class="cellMiscPreview">
Expand All @@ -65,7 +65,7 @@
{extensionIconLabel(value.name)}
</div>
{:else}
<a class="no-line" href={getFileUrl(value.file)} download={value.name}>
<a class="no-line" href={getFileUrl(value.file, 'full', value.name)} download={value.name}>
<div class="flex-center extensionIcon">{extensionIconLabel(value.name)}</div>
</a>
{/if}
Expand All @@ -79,7 +79,7 @@
{extensionIconLabel(value.name)}
</div>
{:else}
<a class="no-line" href={getFileUrl(value.file)} download={value.name}>
<a class="no-line" href={getFileUrl(value.file, 'full', value.name)} download={value.name}>
<div class="flex-center extensionIcon">{extensionIconLabel(value.name)}</div>
</a>
{/if}
Expand All @@ -91,7 +91,7 @@
</div>
{:else}
<div class="eCellInfoFilename">
<a href={getFileUrl(value.file)} download={value.name}>{trimFilename(value.name)}</a>
<a href={getFileUrl(value.file, 'full', value.name)} download={value.name}>{trimFilename(value.name)}</a>
</div>
{/if}
<div class="eCellInfoFilesize">{filesize(value.size)}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<div class="flex-row-center attachment-container">
<a
class="no-line"
href={getFileUrl(value.file)}
href={getFileUrl(value.file, 'full', value.name)}
download={value.name}
on:click={clickHandler}
on:mousedown={middleClickHandler}
Expand All @@ -90,15 +90,25 @@
</a>
<div class="flex-col info-container">
<div class="name">
<a href={getFileUrl(value.file)} download={value.name} on:click={clickHandler} on:mousedown={middleClickHandler}>
<a
href={getFileUrl(value.file, 'full', value.name)}
download={value.name}
on:click={clickHandler}
on:mousedown={middleClickHandler}
>
{trimFilename(value.name)}
</a>
</div>
<div class="info-content flex-row-center">
{filesize(value.size, { spacer: '' })}
<span class="actions inline-flex clear-mins ml-1 gap-1">
<span>•</span>
<a class="no-line colorInherit" href={getFileUrl(value.file)} download={value.name} bind:this={download}>
<a
class="no-line colorInherit"
href={getFileUrl(value.file, 'full', value.name)}
download={value.name}
bind:this={download}
>
<Label label={presentation.string.Download} />
</a>
{#if removable}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<AttachmentGalleryPresenter value={attachment}>
<svelte:fragment slot="rowMenu">
<div class="eAttachmentCellActions" class:fixed={i === selectedFileNumber}>
<a href={getFileUrl(attachment.file)} download={attachment.name}>
<a href={getFileUrl(attachment.file, 'full', attachment.name)} download={attachment.name}>
<Icon icon={FileDownload} size={'small'} />
</a>
<div class="eAttachmentCellMenu" on:click={(event) => showFileMenu(event, attachment, i)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<AttachmentPresenter value={attachment} />
</div>
<div class="eAttachmentRowActions" class:fixed={i === selectedFileNumber}>
<a href={getFileUrl(attachment.file)} download={attachment.name}>
<a href={getFileUrl(attachment.file, 'full', attachment.name)} download={attachment.name}>
<Icon icon={FileDownload} size={'small'} />
</a>
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
</div>
<audio bind:duration bind:currentTime={time} bind:paused>
<source src={getFileUrl(value.file)} type={value.type} />
<source src={getFileUrl(value.file, 'full', value.name)} type={value.type} />
</audio>

<style lang="scss">
Expand Down
2 changes: 1 addition & 1 deletion plugins/attachment-resources/src/components/Photos.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
click(ev, image)
}}
>
<img src={getFileUrl(image.file)} alt={image.name} />
<img src={getFileUrl(image.file, 'full', image.name)} alt={image.name} />
</div>
{/each}
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<AttachmentPresenter value={attachment} />
</div>
<div class="eAttachmentRowActions" class:fixed={i === selectedRowNumber}>
<a href={getFileUrl(attachment.file)} download={attachment.name}>
<a href={getFileUrl(attachment.file, 'full', attachment.name)} download={attachment.name}>
<Icon icon={FileDownload} size={'small'} />
</a>
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@
{#if selectedState}
<div
class="color"
style="background-color: {getPlatformColorDef(
style="background: {getPlatformColorDef(
selectedState.color ?? getColorNumberByText(selectedState.name),
$themeStore.dark
).background}"
).color}"
/>
<span class="label overflow-label">{selectedState.name}</span>
{:else}
Expand Down

0 comments on commit 5f71398

Please sign in to comment.