-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implemented: code to use user profile component from the dxp-components (dxp/169) #172
Open
amansinghbais
wants to merge
3
commits into
hotwax:main
Choose a base branch
from
amansinghbais:picking/169-userprofile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
e2bbaf0
Implemented: code to use user profile component from the dxp-componen…
amansinghbais 6371ba3
Improved: passed userProfile and buttonText as props to DxpUserProfil…
amansinghbais 90ae457
Improved: userprofile styling removed as component moved to dxp (dxp/…
amansinghbais File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,29 +6,8 @@ | |||||
</ion-toolbar> | ||||||
</ion-header> | ||||||
<ion-content> | ||||||
<div class="user-profile"> | ||||||
<ion-card> | ||||||
<ion-item lines="full"> | ||||||
<ion-avatar slot="start" v-if="userProfile?.partyImageUrl"> | ||||||
<Image :src="userProfile.partyImageUrl"/> | ||||||
</ion-avatar> | ||||||
<!-- ion-no-padding to remove extra side/horizontal padding as additional padding | ||||||
is added on sides from ion-item and ion-padding-vertical to compensate the removed | ||||||
vertical padding --> | ||||||
<ion-card-header class="ion-no-padding ion-padding-vertical"> | ||||||
<ion-card-subtitle>{{ userProfile?.userLoginId }}</ion-card-subtitle> | ||||||
<ion-card-title>{{ userProfile?.partyName }}</ion-card-title> | ||||||
</ion-card-header> | ||||||
</ion-item> | ||||||
<ion-button color="danger" @click="logout()">{{ $t("Logout") }}</ion-button> | ||||||
<ion-button fill="outline" @click="goToLaunchpad()"> | ||||||
{{ $t("Go to Launchpad") }} | ||||||
<ion-icon slot="end" :icon="openOutline" /> | ||||||
</ion-button> | ||||||
<!-- Commenting this code as we currently do not have reset password functionality --> | ||||||
<!-- <ion-button fill="outline" color="medium">{{ $t("Reset password") }}</ion-button> --> | ||||||
</ion-card> | ||||||
</div> | ||||||
<DxpUserProfile @reset-state-before-logout="resetStateBeforeLogout" :userProfile="userProfile" logoutLabel="Logout" goToLabel="Go to Launchpad" /> | ||||||
|
||||||
<div class="section-header"> | ||||||
<h1>{{ $t('OMS') }}</h1> | ||||||
</div> | ||||||
|
@@ -112,19 +91,17 @@ | |||||
</template> | ||||||
|
||||||
<script lang="ts"> | ||||||
import { IonAvatar, IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonContent, IonHeader, IonIcon, IonItem, IonLabel, IonPage, IonSelect, IonSelectOption, IonTitle, IonToolbar, modalController } from '@ionic/vue'; | ||||||
import { IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonContent, IonHeader, IonIcon, IonItem, IonLabel, IonPage, IonSelect, IonSelectOption, IonTitle, IonToolbar, modalController } from '@ionic/vue'; | ||||||
import { defineComponent } from 'vue'; | ||||||
import { businessOutline, personCircleOutline, codeWorkingOutline, openOutline, timeOutline } from 'ionicons/icons'; | ||||||
import { mapGetters, useStore } from 'vuex'; | ||||||
import { useRouter } from 'vue-router'; | ||||||
import Image from '@/components/Image.vue'; | ||||||
import { DateTime } from 'luxon'; | ||||||
import TimeZoneModal from '@/views/TimezoneModal.vue'; | ||||||
|
||||||
export default defineComponent({ | ||||||
name: 'Settings', | ||||||
components: { | ||||||
IonAvatar, | ||||||
IonButton, | ||||||
IonCard, | ||||||
IonCardContent, | ||||||
|
@@ -140,8 +117,7 @@ export default defineComponent({ | |||||
IonSelect, | ||||||
IonSelectOption, | ||||||
IonTitle, | ||||||
IonToolbar, | ||||||
Image | ||||||
IonToolbar | ||||||
}, | ||||||
data() { | ||||||
return { | ||||||
|
@@ -183,12 +159,8 @@ export default defineComponent({ | |||||
}); | ||||||
return timeZoneModal.present(); | ||||||
}, | ||||||
logout () { | ||||||
this.store.dispatch('user/logout').then(() => { | ||||||
this.store.dispatch('picklist/clearPicklist') | ||||||
const redirectUrl = window.location.origin + '/login' | ||||||
window.location.href = `${process.env.VUE_APP_LOGIN_URL}?isLoggedOut=true&redirectUrl=${redirectUrl}` | ||||||
}) | ||||||
async resetStateBeforeLogout() { | ||||||
await this.store.dispatch('picklist/clearPicklist') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}, | ||||||
setFacility (facility: any) { | ||||||
if (this.userProfile){ | ||||||
|
@@ -202,9 +174,6 @@ export default defineComponent({ | |||||
goToOms(){ | ||||||
window.open(this.instanceUrl.startsWith('http') ? this.instanceUrl.replace('api/', "") : `https://${this.instanceUrl}.hotwax.io/`, '_blank', 'noopener, noreferrer'); | ||||||
}, | ||||||
goToLaunchpad() { | ||||||
window.location.href = `${process.env.VUE_APP_LOGIN_URL}` | ||||||
}, | ||||||
getDateTime(time: any) { | ||||||
return DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED); | ||||||
}, | ||||||
|
@@ -238,10 +207,6 @@ export default defineComponent({ | |||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | ||||||
align-items: start; | ||||||
} | ||||||
.user-profile { | ||||||
display: grid; | ||||||
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); | ||||||
} | ||||||
.section-header { | ||||||
display: flex; | ||||||
justify-content: space-between; | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the PR as per the changes in dxp component.