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

♻️ vue-dot: Remove deprecated VLayout usage in FileList #1076

Merged
merged 1 commit into from
Apr 30, 2021
Merged
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
- ♻️ **Refactoring**
- **ErrorPage:** Utilisation du composant `PageContainer` à la place de `PageCard` ([#1062](https://github.com/assurance-maladie-digital/design-system/pull/1062)) ([4877246](https://github.com/assurance-maladie-digital/design-system/commit/4877246872e45a0fb5d5840d339444f1ed59c166))
- **PageContainer:** Ajout d'un conteneur interne et correction de l'espacement interne ([#1067](https://github.com/assurance-maladie-digital/design-system/pull/1067)) ([4b5a40e](https://github.com/assurance-maladie-digital/design-system/commit/4b5a40e1a2f251c1e64e21703689bde43df7aec9))
- **DataListItem:** Suppression de l'utilisation du composant `VLayout` déprécié ([#1075](https://github.com/assurance-maladie-digital/design-system/pull/1075))
- **DataListItem:** Suppression de l'utilisation du composant `VLayout` déprécié ([#1075](https://github.com/assurance-maladie-digital/design-system/pull/1075)) ([214c4f2](https://github.com/assurance-maladie-digital/design-system/commit/214c4f22cbc163865c63b71694bef6d2824ba1f4))
- **FileList:** Suppression de l'utilisation du composant `VLayout` déprécié ([#1076](https://github.com/assurance-maladie-digital/design-system/pull/1076))

- 🔥 **Suppressions**
- **PageCard:** Suppression du composant ([#1066](https://github.com/assurance-maladie-digital/design-system/pull/1066)) ([1175200](https://github.com/assurance-maladie-digital/design-system/commit/11752004fcd5a70876e9c759a294d588ef46097a))
Expand Down
102 changes: 50 additions & 52 deletions packages/vue-dot/src/patterns/UploadWorkflow/FileList/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,62 +49,60 @@

<!-- Action buttons -->
<VListItemAction v-bind="options.listItemAction">
<VLayout v-bind="options.layout">
<VBtn
v-if="file.state === 'initial'"
v-bind="options.uploadBtn"
:aria-label="locales.uploadFile"
@click="$emit('upload', file.id)"
<VBtn
v-if="file.state === 'initial'"
v-bind="options.uploadBtn"
:aria-label="locales.uploadFile"
@click="$emit('upload', file.id)"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
{{ uploadIcon }}
</VIcon>
</VBtn>

<VBtn
v-if="file.state === 'error'"
v-bind="options.retryBtn"
:aria-label="locales.uploadFile"
@click="$emit('retry', file.id)"
{{ uploadIcon }}
</VIcon>
</VBtn>

<VBtn
v-if="file.state === 'error'"
v-bind="options.retryBtn"
:aria-label="locales.uploadFile"
@click="$emit('retry', file.id)"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
{{ refreshIcon }}
</VIcon>
</VBtn>

<VBtn
v-if="showViewBtn && file.state === 'success'"
v-bind="options.viewFileBtn"
:aria-label="locales.viewFile"
@click="$emit('view-file', file)"
{{ refreshIcon }}
</VIcon>
</VBtn>

<VBtn
v-if="showViewBtn && file.state === 'success'"
v-bind="options.viewFileBtn"
:aria-label="locales.viewFile"
@click="$emit('view-file', file)"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
{{ eyeIcon }}
</VIcon>
</VBtn>

<VBtn
v-if="file.state !== 'initial'"
v-bind="options.deleteFileBtn"
@click="$emit('delete-file', file.id)"
{{ eyeIcon }}
</VIcon>
</VBtn>

<VBtn
v-if="file.state !== 'initial'"
v-bind="options.deleteFileBtn"
@click="$emit('delete-file', file.id)"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
<VIcon
v-bind="options.icon"
:color="iconColor"
>
{{ deleteIcon }}
</VIcon>
</VBtn>
</VLayout>
{{ deleteIcon }}
</VIcon>
</VBtn>
</VListItemAction>
</VListItem>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
export const config = {
listItem: {
class: 'flex-wrap'
},
listItemAvatarIcon: {
size: 24
},
listItemTitle: {
class: 'text-wrap'
},
layout: {
justifyEnd: true
listItemAction: {
class: 'flex-row'
},
divider: {
inset: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`FileList renders correctly 1`] = `
<vlist-stub tag="div" class="vd-file-list" style="width: 100%;">
<vlistitem-stub activeclass="" tag="div">
<vlistitem-stub activeclass="" tag="div" class="flex-wrap">
<vlistitemavatar-stub size="40">
<vicon-stub color="success" size="24">
M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z
Expand All @@ -15,17 +15,15 @@ exports[`FileList renders correctly 1`] = `
<!---->
<!---->
</vlistitemcontent-stub>
<vlistitemaction-stub>
<vlayout-stub tag="div" justifyend="true">
<!---->
<!---->
<!---->
<vbtn-stub tag="button" activeclass="" icon="true" type="button">
<vicon-stub color="grey darken-1">
M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z
</vicon-stub>
</vbtn-stub>
</vlayout-stub>
<vlistitemaction-stub class="flex-row">
<!---->
<!---->
<!---->
<vbtn-stub tag="button" activeclass="" icon="true" type="button">
<vicon-stub color="grey darken-1">
M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z
</vicon-stub>
</vbtn-stub>
</vlistitemaction-stub>
</vlistitem-stub>
<vdivider-stub inset="true"></vdivider-stub>
Expand Down