Skip to content

Commit

Permalink
Merge pull request #1459 from frankrousseau/master
Browse files Browse the repository at this point in the history
[ux] Add a studio name widget
  • Loading branch information
frankrousseau authored Jun 6, 2024
2 parents 5344193 + a3a50a5 commit 04a2863
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/lists/PeopleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
:departments="person.departments"
/>
<td class="studio" v-if="!isBots">
{{ getStudioName(person) }}
<studio-name :studio-id="person.studio_id" />
</td>
<row-actions-cell
v-if="isCurrentUserAdmin"
Expand Down Expand Up @@ -120,7 +120,7 @@
:departments="person.departments"
/>
<td class="studio" v-if="!isBots">
{{ getStudioName(person) }}
<studio-name :studio-id="person.studio_id" />
</td>
<row-actions-cell
v-if="isCurrentUserAdmin"
Expand Down Expand Up @@ -149,6 +149,7 @@ import { AlertTriangleIcon } from 'vue-feather-icons'
import DepartmentNamesCell from '@/components/cells/DepartmentNamesCell.vue'
import PeopleNameCell from '@/components/cells/PeopleNameCell.vue'
import RowActionsCell from '@/components/cells/RowActionsCell.vue'
import StudioName from '@/components/widgets/StudioName.vue'
import TableInfo from '@/components/widgets/TableInfo.vue'
export default {
Expand All @@ -159,6 +160,7 @@ export default {
DepartmentNamesCell,
PeopleNameCell,
RowActionsCell,
StudioName,
TableInfo
},
Expand Down
43 changes: 43 additions & 0 deletions src/components/widgets/StudioName.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<div>
<span class="square" :style="{ backgroundColor: studio.color }"></span>
{{ studio.name }}
</div>
</template>

<script>
import { mapGetters, mapActions } from 'vuex'
export default {
name: 'studio-name',
components: {},
props: {
studioId: {
type: String,
default: null
}
},
computed: {
...mapGetters(['studioMap']),
studio() {
return this.studioMap.get(this.studioId)
}
},
methods: {
...mapActions([])
}
}
</script>

<style lang="scss" scoped>
.square {
display: inline-block;
width: 10px;
height: 10px;
margin-right: 5px;
}
</style>

0 comments on commit 04a2863

Please sign in to comment.