Skip to content

Commit

Permalink
[MS] User details modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ironicbay committed Dec 15, 2023
1 parent 4e309b4 commit 8ebd833
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 4 deletions.
3 changes: 3 additions & 0 deletions client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@
"cancel": "Cancel",
"create": "Invite"
},
"UserDetailsModal": {
"title": "User details"
},
"revocation": {
"revokeTitle": "Revoke this user? | Revoke these users?",
"revokeQuestion": "This will revoke {user}, preventing them from accessing this organization. Are you sure you want to proceed? | This will revoke these {count} users, preventing them from accessing this organization. Are you sure you want to proceed?",
Expand Down
3 changes: 3 additions & 0 deletions client/src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@
"cancel": "Annuler",
"create": "Inviter"
},
"UserDetailsModal": {
"title": "Détails de l'utilisateur"
},
"revocation": {
"revokeTitle": "Révoquer cet utilisateur ? | Révoquer ces utilisateurs ?",
"revokeQuestion": "L'utilisateur {user} sera révoqué. Il ne pourra plus accéder à l'organisation. Voulez-vous continuer ? | Ces {count} utilisateurs seront révoqués. Ils ne pourront plus accéder à l'organisation. Voulez-vous continuer ?",
Expand Down
5 changes: 5 additions & 0 deletions client/src/theme/components/modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ ion-modal.join-by-link-modal::part(content) {
}
}

.user-details-modal {
--width: 642px;
--height: 468px;
}

.file-upload-modal {
--width: 842px;
}
Expand Down
23 changes: 19 additions & 4 deletions client/src/views/users/UserContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</ion-item>
<ion-item
button
@click="onClick(UserAction.Details)"
@click="presentDetailsModal()"
class="group-item"
>
<ion-icon :icon="informationCircle" />
Expand All @@ -54,16 +54,31 @@ export enum UserAction {
</script>

<script setup lang="ts">
import { IonContent, IonItem, IonLabel, IonList, popoverController, IonIcon, IonItemGroup } from '@ionic/vue';
import { personRemove, informationCircle } from 'ionicons/icons';
import UserDetailsModal from '@/views/users/UserDetailsModal.vue';
import { IonContent, IonIcon, IonItem, IonItemGroup, IonLabel, IonList, modalController, popoverController } from '@ionic/vue';
import { informationCircle, personRemove } from 'ionicons/icons';
import { UserProfile } from '@/parsec';
defineProps<{
const props = defineProps<{
isRevoked: boolean;
}>();
function onClick(action: UserAction): Promise<boolean> {
return popoverController.dismiss({ action: action });
}
async function presentDetailsModal(): Promise<void> {
const modal = await modalController.create({
component: UserDetailsModal,
cssClass: 'user-details-modal',
componentProps: {
userProfile: UserProfile.Admin,
isRevoked: props.isRevoked,
},
});
await modal.present();
await modal.onWillDismiss();
}
</script>

<style lang="scss" scoped>
Expand Down
215 changes: 215 additions & 0 deletions client/src/views/users/UserDetailsModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<!-- Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS -->

<template>
<ion-page class="modal">
<ms-modal
:title="$t('UsersPage.UserDetailsModal.title')"
:close-button="{ visible: true }"
>
<div>
<ion-text class="text1">
Name
</ion-text>
<ion-text class="text1-right">
Joined
</ion-text>
</div>
<div>
<ion-text class="text2">
Thomas Linere

Check warning on line 19 in client/src/views/users/UserDetailsModal.vue

View workflow job for this annotation

GitHub Actions / spelling / cspell

Unknown word (Linere)
</ion-text>
<ion-text class="text2-right">
April 25th 2022
</ion-text>
</div>
<div>
<ion-text class="text4">
Espaces de travail communs
</ion-text>
</div>
<div>
<ion-chip
v-if="isRevoked"
color="danger"
>
<ion-icon
:icon="ellipse"
class="revoked"
/>
<ion-label>
Révoqué
</ion-label>
</ion-chip>
</div>
<ion-list>
<ion-card
:disabled="isRevoked"
class="workspace-card"
>
<ion-card-content>
<ion-avatar class="card-content-icons">
<ion-icon
class="card-content-icons__item"
:icon="business"
/>
<ion-icon
class="cloud-overlay"
:class="'cloud-overlay-ko'"
:icon="cloudOffline"
/>
<ion-text class="text3">
Tout le monde
</ion-text>
<tag-profile :profile="standard" />
</ion-avatar>
</ion-card-content>
</ion-card>
<ion-card
:disabled="isRevoked"
class="workspace-card"
>
<ion-card-content>
<ion-avatar class="card-content-icons">
<ion-icon
class="card-content-icons__item"
:icon="business"
/>
<ion-icon
class="cloud-overlay"
:class="'cloud-overlay-ko'"
:icon="cloudOffline"
/>
<ion-text class="text3">
Développement
</ion-text>
<tag-profile :profile="userProfile" />
</ion-avatar>
</ion-card-content>
</ion-card>
</ion-list>
<ion-button
class="close-button"
@click="cancel"
>
Fermer
</ion-button>
</ms-modal>
</ion-page>
</template>

<script setup lang="ts">
import MsModal from '@/components/core/ms-modal/MsModal.vue';
import { MsModalResult } from '@/components/core/ms-types';
import {
IonChip,
IonAvatar,
IonButton,
IonItem,
IonList,
IonPage,
IonText,
modalController,
IonCard,
IonCardContent,
IonIcon,
} from '@ionic/vue';
import { business, cloudOffline, ellipse } from 'ionicons/icons';
import { UserProfile } from '@/parsec';
import TagProfile from '@/components/users/TagProfile.vue';
// User list > ... > details de l'utilisateur > modale user
// mettre modale ici
// s'inspirer de workspacesharingmodal : tout dans un msmodal

Check warning on line 122 in client/src/views/users/UserDetailsModal.vue

View workflow job for this annotation

GitHub Actions / spelling / cspell

Unknown word (workspacesharingmodal)

Check warning on line 122 in client/src/views/users/UserDetailsModal.vue

View workflow job for this annotation

GitHub Actions / spelling / cspell

Unknown word (msmodal)
// icone de workspace dans workspacespage

Check warning on line 123 in client/src/views/users/UserDetailsModal.vue

View workflow job for this annotation

GitHub Actions / spelling / cspell

Unknown word (workspacespage)
// dans workspacesharingmodal y'a aussi les badges externe admin etc

Check warning on line 124 in client/src/views/users/UserDetailsModal.vue

View workflow job for this annotation

GitHub Actions / spelling / cspell

Unknown word (workspacesharingmodal)
const standard = UserProfile.Standard;
defineProps<{
userProfile: UserProfile;
isRevoked: boolean;
}>();
function cancel(): Promise<boolean> {
return modalController.dismiss(null, MsModalResult.Cancel);
}
</script>

<style lang="scss" scoped>
.text1 {
font-size: 0.9rem;
color: var(--parsec-color-light-secondary-text);
&-right {
font-size: 0.9rem;
color: var(--parsec-color-light-secondary-text);
margin-left: 50%;
margin-right: 20%;
}
}
.text2 {
font-size: 1.1rem;
font-weight: 500;
color: var(--parsec-color-light-secondary-text);
&-right {
font-size: 1.1rem;
font-weight: 500;
color: var(--parsec-color-light-secondary-text); margin-left: 30%;
margin-right: auto;
}
}
.text3 {
font-size: 1rem;
margin-left: 1rem;
margin-right: auto;
}
.text4 {
font-size: 0.9rem;
color: var(--parsec-color-light-secondary-text);
margin-top: 1rem;
}
.close-button {
display: flex;
margin-left: auto;
width: fit-content;
}
.card-content-icons {
margin: 0 auto 0.5rem;
position: relative;
height: fit-content;
display: flex;
justify-content: left;
align-items: center;
color: var(--parsec-color-light-primary-900);
width: 100%;
&__item {
font-size: 2rem;
}
.cloud-overlay {
position: absolute;
font-size: 1rem;
bottom: -10px;
left: 4%;
padding: 2px;
background: white;
border-radius: 50%;
}
.cloud-overlay-ok {
color: var(--parsec-color-light-primary-500);
}
.cloud-overlay-ko {
color: var(--parsec-color-light-secondary-text);
}
}
.revoked {
font-size: 0.5rem;
margin-right: 0.5rem;
}
.workspace-card {
box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1);
}
</style>

0 comments on commit 8ebd833

Please sign in to comment.