Skip to content

Commit

Permalink
Merge pull request #923 from cloud-pi-native/feat/service-team-feedbacks
Browse files Browse the repository at this point in the history
feat: 🚸 better ux for forms in tiles
  • Loading branch information
clairenollet authored Jan 25, 2024
2 parents 9e52ea4 + da68243 commit 7540d27
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 11 deletions.
2 changes: 2 additions & 0 deletions apps/client/cypress/e2e/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ Cypress.Commands.add('assertAddEnvironment', (project, environments, isDeepCheck
.should('have.value', environment?.quota?.id)
cy.get('#cluster-select')
.should('have.value', environment?.cluster?.id)
cy.getByDataTestid('goBackBtn')
.click()
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/ClusterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ watch(selectedContext, () => {
/>
<DsfrButton
v-else
label="Mettre à jour le cluster"
label="Enregistrer"
data-testid="updateClusterBtn"
:disabled="!isClusterValid"
primary
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/QuotaForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ onBeforeMount(() => {
/>
<DsfrButton
v-else
label="Modifier le quota"
label="Enregistrer"
data-testid="updateQuotaBtn"
:disabled="!isQuotaValid"
primary
Expand Down
6 changes: 3 additions & 3 deletions apps/client/src/components/RepoForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const saveRepo = () => {
emit('save', localRepo.value)
}
const cancel = (event) => {
emit('cancel', event)
const cancel = () => {
emit('cancel')
}
</script>
Expand Down Expand Up @@ -171,7 +171,7 @@ const cancel = (event) => {
class="flex space-x-10 mt-5"
>
<DsfrButton
:label="localRepo.id ? 'Modifier le dépôt' : 'Ajouter le dépôt'"
:label="localRepo.id ? 'Enregistrer' : 'Ajouter le dépôt'"
:data-testid="localRepo.id ? 'updateRepoBtn' : 'addRepoBtn'"
:disabled="!isRepoValid"
primary
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/StageForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ onBeforeMount(() => {
/>
<DsfrButton
v-else
label="Modifier le type d'environnement"
label="Enregistrer"
data-testid="updateStageBtn"
:disabled="!isStageValid"
primary
Expand Down
19 changes: 18 additions & 1 deletion apps/client/src/views/admin/ListClusters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ watch(clusters, () => {
class="flex <md:flex-col-reverse items-center justify-between pb-5"
>
<DsfrButton
v-if="!Object.keys(selectedCluster).length && !isNewClusterForm"
label="Ajouter un nouveau cluster"
data-testid="addClusterLink"
tertiary
Expand All @@ -104,6 +105,19 @@ watch(clusters, () => {
icon="ri-add-line"
@click="showNewClusterForm()"
/>
<div
v-else
class="w-full flex justify-end"
>
<DsfrButton
title="Revenir à la liste des clusters"
data-testid="goBackBtn"
secondary
icon-only
icon="ri-arrow-go-back-line"
@click="() => cancel()"
/>
</div>
</div>
<div
v-if="isNewClusterForm"
Expand All @@ -120,6 +134,7 @@ watch(clusters, () => {
/>
</div>
<div
v-else
:class="{
'md:grid md:grid-cols-3 md:gap-3 items-center justify-between': !selectedCluster?.label,
}"
Expand All @@ -129,7 +144,9 @@ watch(clusters, () => {
:key="cluster.id"
class="fr-mt-2v fr-mb-4w w-full"
>
<div>
<div
v-show="!Object.keys(selectedCluster).length"
>
<DsfrTile
:title="cluster.title"
:data-testid="`clusterTile-${cluster.title}`"
Expand Down
1 change: 1 addition & 0 deletions apps/client/src/views/admin/ListProjects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ onBeforeMount(async () => {
<DsfrButton
v-if="selectedProject"
title="Revenir à la liste des projets"
data-testid="goBackBtn"
secondary
icon-only
icon="ri-arrow-go-back-line"
Expand Down
19 changes: 18 additions & 1 deletion apps/client/src/views/admin/ListQuotas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ watch(quotas, () => {
class="flex <md:flex-col-reverse items-center justify-between pb-5"
>
<DsfrButton
v-if="!Object.keys(selectedQuota).length && !isNewQuotaForm"
label="Ajouter un nouveau quota"
data-testid="addQuotaLink"
tertiary
Expand All @@ -110,6 +111,19 @@ watch(quotas, () => {
icon="ri-add-line"
@click="showNewQuotaForm()"
/>
<div
v-else
class="w-full flex justify-end"
>
<DsfrButton
title="Revenir à la liste des quotas"
data-testid="goBackBtn"
secondary
icon-only
icon="ri-arrow-go-back-line"
@click="() => cancel()"
/>
</div>
</div>
<div
v-if="isNewQuotaForm"
Expand All @@ -125,6 +139,7 @@ watch(quotas, () => {
/>
</div>
<div
v-else
:class="{
'md:grid md:grid-cols-3 md:gap-3 items-center justify-between': !selectedQuota?.name,
}"
Expand All @@ -134,7 +149,9 @@ watch(quotas, () => {
:key="quota.id"
class="fr-mt-2v fr-mb-4w w-full"
>
<div>
<div
v-show="!Object.keys(selectedQuota).length"
>
<DsfrTile
:title="quota.title"
:data-testid="`quotaTile-${quota.title}`"
Expand Down
19 changes: 18 additions & 1 deletion apps/client/src/views/admin/ListStages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ watch(stages, () => {
class="flex <md:flex-col-reverse items-center justify-between pb-5"
>
<DsfrButton
v-if="!Object.keys(selectedStage).length && !isNewStageForm"
label="Ajouter un nouveau type d'environnement"
data-testid="addStageLink"
tertiary
Expand All @@ -113,6 +114,19 @@ watch(stages, () => {
icon="ri-add-line"
@click="showNewStageForm()"
/>
<div
v-else
class="w-full flex justify-end"
>
<DsfrButton
title="Revenir à la liste des types d'environnement"
data-testid="goBackBtn"
secondary
icon-only
icon="ri-arrow-go-back-line"
@click="() => cancel()"
/>
</div>
</div>
<div
v-if="isNewStageForm"
Expand All @@ -129,6 +143,7 @@ watch(stages, () => {
/>
</div>
<div
v-else
:class="{
'md:grid md:grid-cols-3 md:gap-3 items-center justify-between': !selectedStage?.name,
}"
Expand All @@ -138,7 +153,9 @@ watch(stages, () => {
:key="stage.id"
class="fr-mt-2v fr-mb-4w w-full"
>
<div>
<div
v-show="!Object.keys(selectedStage).length"
>
<DsfrTile
:title="stage.title"
:data-testid="`stageTile-${stage.title}`"
Expand Down
19 changes: 18 additions & 1 deletion apps/client/src/views/projects/DsoRepos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ watch(project, () => {
class="flex <md:flex-col-reverse items-center justify-between pb-5"
>
<DsfrButton
v-if="!Object.keys(selectedRepo).length && !isNewRepoForm"
label="Ajouter un nouveau dépôt"
data-testid="addRepoLink"
tertiary
Expand All @@ -94,6 +95,19 @@ watch(project, () => {
icon="ri-add-line"
@click="showNewRepoForm()"
/>
<div
v-else
class="w-full flex justify-end"
>
<DsfrButton
title="Revenir à la liste des dépôts"
data-testid="goBackBtn"
secondary
icon-only
icon="ri-arrow-go-back-line"
@click="() => cancel()"
/>
</div>
</div>
<div
v-if="isNewRepoForm"
Expand All @@ -107,6 +121,7 @@ watch(project, () => {
/>
</div>
<div
v-else
:class="{
'md:grid md:grid-cols-3 md:gap-3 items-center justify-between': !selectedRepo.internalRepoName,
}"
Expand All @@ -116,7 +131,9 @@ watch(project, () => {
:key="repo.id"
class="fr-mt-2v fr-mb-4w"
>
<div>
<div
v-show="!Object.keys(selectedRepo).length"
>
<DsfrTile
:title="repo.title"
:description="['deleting', 'initializing'].includes(repo?.data?.status) ? 'Opérations en cours' : null"
Expand Down
19 changes: 18 additions & 1 deletion apps/client/src/views/projects/ManageEnvironments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ watch(project, () => {
class="flex <md:flex-col-reverse items-center justify-between pb-5"
>
<DsfrButton
v-if="!Object.keys(selectedEnvironment).length && !isNewEnvironmentForm"
label="Ajouter un nouvel environnement"
data-testid="addEnvironmentLink"
tertiary
Expand All @@ -110,6 +111,19 @@ watch(project, () => {
icon="ri-add-line"
@click="showNewEnvironmentForm()"
/>
<div
v-else
class="w-full flex justify-end"
>
<DsfrButton
title="Revenir à la liste des environnements"
data-testid="goBackBtn"
secondary
icon-only
icon="ri-arrow-go-back-line"
@click="() => cancel()"
/>
</div>
</div>
<div
v-if="isNewEnvironmentForm"
Expand All @@ -126,6 +140,7 @@ watch(project, () => {
/>
</div>
<div
v-else
:class="{
'md:grid md:grid-cols-3 md:gap-3 items-center justify-between': !selectedEnvironment.id,
}"
Expand All @@ -135,7 +150,9 @@ watch(project, () => {
:key="environment.id"
class="fr-mt-2v fr-mb-4w"
>
<div>
<div
v-show="!Object.keys(selectedEnvironment).length"
>
<DsfrTile
:title="environment.title"
:description="['deleting', 'initializing'].includes(environment.status) ? 'Opérations en cours' : null"
Expand Down

0 comments on commit 7540d27

Please sign in to comment.