Skip to content

Commit

Permalink
feat: updating progress indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj committed Sep 1, 2023
1 parent 02aa296 commit 8a0d271
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
27 changes: 19 additions & 8 deletions frontend/src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
--light-theme-tag-blue-background: #c2e0ff;
--light-theme-tag-blue-text:#00478f;
--light-theme-focus: #0073e6;
--light-theme-miscellaneous-interactive:#0073E6;

//Primary button
--cds-interactive-01: #0073E6;
--cds-active-primary: #0073E6;
Expand Down Expand Up @@ -68,6 +70,18 @@ cds-button span {
--cds-support-info-inverse: var(--light-theme-notifications-support-info-border);
--cds-text-inverse: var(--light-theme-text-text-primary);
}
.step-active {
--cds-border-subtle: var(--light-theme-miscellaneous-interactive);
}
.cds--progress-label {
overflow: visible !important;

}
.cds--progress-label:hover {
box-shadow: none !important;
text-decoration: underline;
text-underline-offset: 0.325rem;
}

* {
font-family: "BCSans", "Noto Sans", Verdana, Arial, sans-serif;
Expand All @@ -92,8 +106,9 @@ hr {
display: block;
border: 0;
border-top: 1px solid var(--border-subtle-02,#dfdfe1);
margin: 1em 0;
padding: 0;
align-self: stretch;
width: 100%;
}

.bulleted-list {
Expand Down Expand Up @@ -381,12 +396,6 @@ hr {
letter-spacing: 0.01rem;
}

.divider {
align-self: stretch;
width: 100%;
background: var(--light-theme-border-border-subtle-02, #dfdfe1);
}

.content {
flex-grow: 1;
align-self: stretch;
Expand All @@ -399,6 +408,8 @@ hr {
display: flex;
flex-direction: column;
gap: 1.5rem;
--cds-icon-primary: var(--light-theme-miscellaneous-interactive);
//--cds-border-subtle: var(--light-theme-miscellaneous-interactive); aplica em todos
}
.form-header-stretched {
align-self: stretch;
Expand Down Expand Up @@ -466,7 +477,7 @@ hr {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2.5rem;
gap: 1.5rem;
}

.form-steps-section-01 {
Expand Down
43 changes: 18 additions & 25 deletions frontend/src/pages/ApplyClientNumberPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { reactive, watch, toRef, ref, getCurrentInstance, computed } from 'vue'
// Carbon
import '@carbon/web-components/es/components/button/index';
import '@carbon/web-components/es/components/progress-indicator/index';
// Composables
import { useEventBus } from "@vueuse/core";
import { useRouter } from "vue-router";
Expand Down Expand Up @@ -120,10 +121,7 @@ watch([error], () => {
}
});
addValidation(
"location.contacts.*.locationNames.*.text",
isContainedIn(locations)
);
addValidation('location.contacts.*.locationNames.*.text', isContainedIn(locations))
// Tab system
const progressData = reactive([
Expand Down Expand Up @@ -205,10 +203,10 @@ const progressData = reactive([
const currentTab = ref(0);
const stateIcon = (index: number) => {
if (currentTab.value == index) return "current";
if (currentTab.value > index || progressData[index].valid) return "complete";
return "queued";
};
if (currentTab.value == index) return 'current'
if (currentTab.value > index || progressData[index].valid) return 'complete'
return 'incomplete'
}
const checkStepValidity = (stepNumber: number): boolean => {
progressData.forEach((step: any) => {
Expand Down Expand Up @@ -308,10 +306,17 @@ generalErrorBus.on((event: string) => (globalErrorMessage.value = event));
<span class="heading-05" data-scroll="top">New client application</span>
<p class="body-01">All fields are mandatory</p>
</div>
<wizard-progress-indicator-component
:model-value="progressData"
@go-to="goToStep"
/>
<cds-progress-indicator space-equally>
<cds-progress-step
v-for="item in progressData"
:key="item.step"
:secondary-label="item.subtitle"
:state="item.step <= currentTab ? item.step < currentTab ? 'complete' : 'current' : 'incomplete'"
:class="item.step <= currentTab ? 'step-active' : 'step-inactive'"
>
<span class="cds--progress-label">{{ item.title }}</span>
</cds-progress-step>
</cds-progress-indicator>
</div>

<div class="form-steps">
Expand Down Expand Up @@ -442,7 +447,7 @@ generalErrorBus.on((event: string) => (globalErrorMessage.value = event));
</cds-button>

<cds-button
v-if="!isLast && !isFormValid && !endAndLogOut && !mailAndLogOut"
v-if="!isLast && !endAndLogOut && !mailAndLogOut"
id="nextBtn"
kind="primary"
size="lg"
Expand All @@ -468,18 +473,6 @@ generalErrorBus.on((event: string) => (globalErrorMessage.value = event));
<Check16 slot="icon" />
</cds-button>

<cds-button
data-test="wizard-save-button"
kind="primary"
size="lg"
:disabled="isNextAvailable"
v-if="!isLast && isFormValid && !endAndLogOut && !mailAndLogOut"
@click.prevent="saveChange"
>
<span>Save</span>
<Save16 slot="icon" />
</cds-button>

<cds-button
data-test="wizard-logout-button"
kind="primary"
Expand Down

0 comments on commit 8a0d271

Please sign in to comment.