Skip to content
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

feat(fe2): move settings to tab on projects page #2207

Merged
merged 130 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
9587d12
Add settings tab. Update style of component
andrewwallacespeckle Mar 25, 2024
52a3266
Structuring of files/components
andrewwallacespeckle Mar 25, 2024
d3276a7
Updates to TexInput
andrewwallacespeckle Mar 25, 2024
f884162
Add RadioGroup
andrewwallacespeckle Mar 25, 2024
706572d
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Mar 26, 2024
4bd9466
Last FE work
andrewwallacespeckle Mar 27, 2024
8c6aff1
FE Updates
andrewwallacespeckle Mar 27, 2024
429c327
Webhooks Settings Tab
andrewwallacespeckle Mar 28, 2024
d2ea076
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Mar 28, 2024
760d34e
Styling updates to webhooks
andrewwallacespeckle Mar 28, 2024
3eb6b49
Title/Description Update
andrewwallacespeckle Mar 31, 2024
00ccdf8
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Mar 31, 2024
8b92fde
General Page done
andrewwallacespeckle Apr 1, 2024
332f966
Collaborators WIP
andrewwallacespeckle Apr 2, 2024
55f6676
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 2, 2024
8537c4f
Styling updates
andrewwallacespeckle Apr 2, 2024
2f4e02b
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 2, 2024
0eb5efa
Add custom message to updateProject
andrewwallacespeckle Apr 3, 2024
1e7b272
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 3, 2024
e5a367d
Radio Group Same Height
andrewwallacespeckle Apr 3, 2024
8193d91
Styling updates to radio group. Disabled state
andrewwallacespeckle Apr 3, 2024
d53b7b3
Updates pre demo
andrewwallacespeckle Apr 3, 2024
b334326
Updates to icons & post demo changes
andrewwallacespeckle Apr 4, 2024
990e670
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 4, 2024
56ba8f0
Major Updates
andrewwallacespeckle Apr 4, 2024
53255c0
Unsaved Changes Dialog
andrewwallacespeckle Apr 4, 2024
c5a1977
Routing WIP
andrewwallacespeckle Apr 4, 2024
310c7bd
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 4, 2024
cfbc44a
Remove StatsBlock
andrewwallacespeckle Apr 5, 2024
a74ec6d
Auto update discussions on Private
andrewwallacespeckle Apr 5, 2024
c667614
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 5, 2024
aed3320
Routing/Redirects
andrewwallacespeckle Apr 5, 2024
8cd3fc6
New input style
andrewwallacespeckle Apr 5, 2024
16ddef8
Invite Dialog
andrewwallacespeckle Apr 5, 2024
397aa45
Fix mobile radiogroup
andrewwallacespeckle Apr 5, 2024
a7ce93f
Mobile Improvements
andrewwallacespeckle Apr 5, 2024
50810bc
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 5, 2024
4cd7ebc
Fix console warning
andrewwallacespeckle Apr 5, 2024
042980f
Fix build
andrewwallacespeckle Apr 5, 2024
5b270d4
Disabled States
andrewwallacespeckle Apr 5, 2024
6438c17
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 5, 2024
fe00544
Fix console
andrewwallacespeckle Apr 5, 2024
ce08702
Unhide webhooks
andrewwallacespeckle Apr 5, 2024
9a17453
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 8, 2024
03ff85e
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 9, 2024
a7dd316
Updates from testing
andrewwallacespeckle Apr 9, 2024
85620ac
Responsive fixes
andrewwallacespeckle Apr 9, 2024
749330a
Alignment fixes
andrewwallacespeckle Apr 9, 2024
3d41923
Fix textarea mobile height
andrewwallacespeckle Apr 9, 2024
e3b3fb7
Updates to GraphQL Fragments
andrewwallacespeckle Apr 9, 2024
1e78e30
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 9, 2024
efc9b1c
Fix disabled state
andrewwallacespeckle Apr 10, 2024
2a9a765
WIP Arrows for scroll
andrewwallacespeckle Apr 10, 2024
9d76573
Update PageTabs - broken
andrewwallacespeckle Apr 10, 2024
4fa28ec
Fix to PageTabs
andrewwallacespeckle Apr 10, 2024
32498f2
PageTab fix initial scroll
andrewwallacespeckle Apr 10, 2024
f5d9531
Hide Scrollbar
andrewwallacespeckle Apr 10, 2024
220dd96
Better underline method
andrewwallacespeckle Apr 10, 2024
d8a46b7
Fix mobile initial underline
andrewwallacespeckle Apr 10, 2024
b413bb3
Webhooks Empty State
andrewwallacespeckle Apr 10, 2024
76c1109
Fix input border
andrewwallacespeckle Apr 10, 2024
7da8d88
Fix empty state
andrewwallacespeckle Apr 10, 2024
44a347e
Input Styling updates
andrewwallacespeckle Apr 10, 2024
222e675
Remove mobile smaller text
andrewwallacespeckle Apr 10, 2024
211bd3d
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 12, 2024
a0398af
Update disabled state for disabled items
andrewwallacespeckle Apr 12, 2024
a326fb8
Updates disabled sates on Settings Block
andrewwallacespeckle Apr 12, 2024
2afc9c7
Fix build. Disable Invite
andrewwallacespeckle Apr 12, 2024
58aef38
Fixes to invite permissions
andrewwallacespeckle Apr 12, 2024
c41d4ef
Disable role select when invite is disabled
andrewwallacespeckle Apr 12, 2024
4cf6a3d
Small alignment fix
andrewwallacespeckle Apr 12, 2024
e8a7321
Fix webhooks empty state
andrewwallacespeckle Apr 12, 2024
502237d
cleaning up unnecessary vue files
fabis94 Apr 15, 2024
39868da
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
fabis94 Apr 15, 2024
5fed586
story improvement
fabis94 Apr 15, 2024
e2b87be
Remove DisabledMessage prop
andrewwallacespeckle Apr 15, 2024
1897d10
Fix disabled prop on Button
andrewwallacespeckle Apr 15, 2024
eb15628
Move team to Leave Fragment
andrewwallacespeckle Apr 15, 2024
5431658
Remove unused Disabled Message props
andrewwallacespeckle Apr 15, 2024
2e809c5
Add limit to graphql query
andrewwallacespeckle Apr 15, 2024
a60407f
Updates to BlockDiscussions
andrewwallacespeckle Apr 15, 2024
57ba80a
add formatTriggers function to webhooks
andrewwallacespeckle Apr 15, 2024
64661e8
Remove md from button. Improved switch
andrewwallacespeckle Apr 15, 2024
7cbedea
Update RadioGroup.stories.ts
andrewwallacespeckle Apr 15, 2024
25c88a8
Update RadioGroup to use defineModel
andrewwallacespeckle Apr 15, 2024
0a615f4
Various styling and copy updates
benjaminvo Apr 16, 2024
fc773cb
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle Apr 29, 2024
125f1c6
Updates to Invite Dialog
andrewwallacespeckle Apr 30, 2024
fe81621
Custom success Message
andrewwallacespeckle Apr 30, 2024
fe44bcb
Update slot names
andrewwallacespeckle Apr 30, 2024
7a34fe9
Remove md in TextInput. Set h-8 to default
andrewwallacespeckle Apr 30, 2024
8652835
Changes from call with fabs
andrewwallacespeckle Apr 30, 2024
3c5f6fb
Replace isOwner with composable
andrewwallacespeckle Apr 30, 2024
0cf4371
Set SettingsBlock icon as optional
andrewwallacespeckle May 1, 2024
effc6c4
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle May 2, 2024
1f542a6
Comments from PR
andrewwallacespeckle May 2, 2024
bc1aaab
Updates from PR
andrewwallacespeckle May 2, 2024
d615445
Final Tidy Ups
andrewwallacespeckle May 2, 2024
44755d8
Fix Title/Description
andrewwallacespeckle May 3, 2024
cd3a63a
Fix spacing issue on Webhooks page
benjaminvo May 7, 2024
6ce1a61
Update borders and colors to align with Automate
benjaminvo May 7, 2024
66efec7
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle May 7, 2024
cd7671e
WEB-869
andrewwallacespeckle May 7, 2024
9e4bd33
Improve styling of radiogroup component
benjaminvo May 7, 2024
ebea6ce
Adjust border styling of RadioGroup component
benjaminvo May 7, 2024
36b9fcc
Improve circle around checkmark in RadioGroup
benjaminvo May 7, 2024
ed620f0
Split Tabs into 2 components
andrewwallacespeckle May 7, 2024
227ee9b
Merge branch 'andrew/WBX-386-move-project-settings-to-tab' of https:/…
andrewwallacespeckle May 7, 2024
8fd5035
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle May 7, 2024
a960e8b
Restyle overflow arrows
benjaminvo May 7, 2024
69a5588
Adjust gap and remove icons from vertical nav
benjaminvo May 7, 2024
f8f561d
Ensure active item visible
andrewwallacespeckle May 7, 2024
8e308e3
Merge branch 'andrew/WBX-386-move-project-settings-to-tab' of https:/…
andrewwallacespeckle May 7, 2024
2848ce2
Increase gap on vertical nav
benjaminvo May 7, 2024
986376b
Merge branch 'andrew/WBX-386-move-project-settings-to-tab' of https:/…
benjaminvo May 7, 2024
1f7be71
Update copy for Access and Discussions settings
benjaminvo May 7, 2024
3799ee7
Input Tidyup
andrewwallacespeckle May 8, 2024
510fb68
WEB-877 update-collaborators-block
andrewwallacespeckle May 8, 2024
7326fd9
Update inputs to new style
andrewwallacespeckle May 8, 2024
07c45d1
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle May 8, 2024
0881f8a
Fix webhooks button hover state
andrewwallacespeckle May 8, 2024
7851aff
Fix comment copy
benjaminvo May 8, 2024
4f59d33
Remove hover shadow from search input on Dashboard
benjaminvo May 8, 2024
dd2487d
Small change from Benjamin
andrewwallacespeckle May 9, 2024
8f5217b
Change collaborators permissions copy
benjaminvo May 10, 2024
5e0638a
Merge branch 'main' into andrew/WBX-386-move-project-settings-to-tab
andrewwallacespeckle May 10, 2024
6af8089
Comments from PR #1
andrewwallacespeckle May 10, 2024
a08c7eb
Comments from PR #2
andrewwallacespeckle May 10, 2024
2059976
Fix condition for EditableHeader
andrewwallacespeckle May 10, 2024
1157996
Updates from CR
andrewwallacespeckle May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>
</label>
<PencilIcon
v-if="canEdit"
v-if="canEdit && !isDisabled"
class="shrink-0 ml-2 mt-3 w-4 h-4 opacity-0 group-hover:opacity-100 transition text-foreground-2"
/>
</div>
Expand Down Expand Up @@ -65,7 +65,7 @@
</label>
<div class="shrink-0 ml-2 mt-1 text-foreground-2">
<PencilIcon
v-if="canEdit"
v-if="canEdit && !isDisabled"
class="w-4 h-4 opacity-0 group-hover:opacity-100 transition text-foreground-2"
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/frontend-2/components/form/select/ServerRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:fully-control-value="fullyControlValue"
:label-id="labelId"
:button-id="buttonId"
mount-menu-on-body
>
<template #nothing-selected>
{{ multiple ? 'Select roles' : 'Select role' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const items = ref<
},
[ProjectVisibility.Private]: {
id: ProjectVisibility.Private,
description: 'Only team members will have access',
description: 'Only collaborators can access',
title: 'Private'
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:title="titleState"
:description="descriptionState"
:can-edit="canEdit"
:is-disabled="anyMutationsLoading"
:is-disabled="canEdit || anyMutationsLoading"
@update:title="handleUpdateTitle"
@update:description="handleUpdateDescription"
/>
Expand Down
61 changes: 37 additions & 24 deletions packages/frontend-2/components/project/model-page/dialog/MoveTo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,38 @@
Move {{ versions.length }} version{{ versions.length > 1 ? 's' : '' }}
</template>
<div class="flex flex-col space-y-4">
<LayoutTabs v-slot="{ activeItem }" :items="tabItems">
<ProjectModelPageDialogMoveToExistingTab
v-if="activeItem.id === 'existing-model'"
:versions="versions"
:project-id="projectId"
:disabled="loading"
:model-id="modelId"
@model-selected="onMove"
/>
<ProjectModelPageDialogMoveToNewTab
v-else
:project-id="projectId"
:versions="versions"
:disabled="loading"
@model-selected="onMove($event, true)"
/>
</LayoutTabs>
<LayoutTabsHoriztonal v-model:active-item="activeTab" :items="tabItems">
<template #default="{ activeItem }">
<div class="min-h-40">
<ProjectModelPageDialogMoveToExistingTab
v-if="activeItem.id === 'existing-model'"
:versions="versions"
:project-id="projectId"
:disabled="loading"
:model-id="modelId"
@model-selected="onMove"
/>
<ProjectModelPageDialogMoveToNewTab
v-else-if="activeItem.id === 'new-model'"
:project-id="projectId"
:versions="versions"
:disabled="loading"
@model-selected="onMove($event, true)"
/>
</div>
</template>
</LayoutTabsHoriztonal>
</div>
</LayoutDialog>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { graphql } from '~~/lib/common/generated/gql'
import type { ProjectModelPageDialogMoveToVersionFragment } from '~~/lib/common/generated/gql/graphql'
import { useMixpanel } from '~~/lib/core/composables/mp'
import type { LayoutTabItem } from '~~/lib/layout/helpers/components'
import { useMoveVersions } from '~~/lib/projects/composables/versionManagement'
import { LayoutTabsHoriztonal } from '@speckle/ui-components'
import type { LayoutPageTabItem } from '@speckle/ui-components'

graphql(`
fragment ProjectModelPageDialogMoveToVersion on Version {
Expand All @@ -55,28 +61,35 @@ const props = defineProps<{
}>()

const moveVersions = useMoveVersions()

const mp = useMixpanel()
const loading = ref(false)
const tabItems = ref<LayoutTabItem[]>([

// Define tab items
const tabItems = ref<LayoutPageTabItem[]>([
{ title: 'Existing model', id: 'existing-model' },
{ title: 'New model', id: 'new-model' }
])

// Manage active tab state
const activeTab = ref(tabItems.value[0])

const isOpen = computed({
get: () => props.open,
set: (newVal) => emit('update:open', newVal)
set: (value) => emit('update:open', value)
})

const mp = useMixpanel()

const onMove = async (targetModelName: string, newModelCreated?: boolean) => {
loading.value = true
const success = await moveVersions(
{
versionIds: props.versions.map((v) => v.id),
targetModelName
},
{ previousModelId: props.modelId, newModelCreated, projectId: props.projectId }
{
previousModelId: props.modelId,
newModelCreated,
projectId: props.projectId
}
)
loading.value = false
mp.track('Commit Action', {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-2/components/project/page/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:title="titleState"
:description="descriptionState"
:can-edit="canEdit"
:is-disabled="anyMutationsLoading"
:is-disabled="!canEdit || anyMutationsLoading"
@update:title="handleUpdateTitle"
@update:description="handleUpdateDescription"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
<template>
<LayoutDialogSection
allow-overflow
border-b
border-t
title="Invite"
:always-open="defaultOpen"
>
<template #icon>
<UserPlusIcon class="h-full w-full" />
</template>
<LayoutDialog v-model:open="isOpen" max-width="md" :buttons="dialogButtons">
<template #header>Invite to Project</template>
<div class="flex flex-col mt-2">
<FormTextInput
v-model="search"
name="search"
size="lg"
placeholder="Search"
help="Search by username or email"
:disabled="disabled"
:help="
disabled
? 'You must be the project owner to invite users'
: 'Search by username or email'
"
input-classes="pr-[85px] text-sm"
color="foundation"
label="Add people by email or username"
show-label
>
<template #input-right>
<div class="absolute inset-y-0 right-0 flex items-center pr-2">
<div
class="absolute inset-y-0 right-0 flex items-center pr-2"
:class="disabled ? 'pointer-events-none' : ''"
>
<ProjectPageTeamPermissionSelect v-model="role" hide-remove />
</div>
</template>
Expand Down Expand Up @@ -48,34 +51,43 @@
/>
</div>
</div>
</LayoutDialogSection>
</LayoutDialog>
</template>
<script setup lang="ts">
import { Roles } from '@speckle/shared'
import type { ServerRoles, StreamRoles } from '@speckle/shared'
import { LayoutDialogSection } from '@speckle/ui-components'
import { useUserSearch } from '~~/lib/common/composables/users'
import type { UserSearchItem } from '~~/lib/common/composables/users'
import type {
ProjectInviteCreateInput,
ProjectPageTeamDialogFragment
ProjectPageInviteDialog_ProjectFragment
} from '~~/lib/common/generated/gql/graphql'
import type { SetFullyRequired } from '~~/lib/common/helpers/type'
import { isEmail } from '~~/lib/common/helpers/validation'
import { isArray, isString } from 'lodash-es'
import { useInviteUserToProject } from '~~/lib/projects/composables/projectManagement'
import { useTeamDialogInternals } from '~~/lib/projects/composables/team'
import { UserPlusIcon } from '@heroicons/vue/24/outline'
import { useTeamInternals } from '~~/lib/projects/composables/team'
import { useMixpanel } from '~~/lib/core/composables/mp'
import { useServerInfo } from '~~/lib/core/composables/server'
import { graphql } from '~/lib/common/generated/gql/gql'

graphql(`
fragment ProjectPageInviteDialog_Project on Project {
id
...ProjectPageTeamInternals_Project
}
`)

type InvitableUser = UserSearchItem | string

const props = defineProps<{
project: ProjectPageTeamDialogFragment
defaultOpen: boolean
projectId: string
project?: ProjectPageInviteDialog_ProjectFragment
disabled?: boolean
}>()

const isOpen = defineModel<boolean>('open', { required: true })

const loading = ref(false)
const search = ref('')
const role = ref<StreamRoles>(Roles.Stream.Contributor)
Expand All @@ -88,9 +100,22 @@ const { userSearch, searchVariables } = useUserSearch({
limit: 5
}))
})
const { collaboratorListItems } = useTeamDialogInternals({
props: toRefs(props)
})

const projectId = computed(() => props.projectId as string)

const projectData = computed(() => props.project)

const { collaboratorListItems } = useTeamInternals(projectData)

const dialogButtons = computed(() => [
{
text: 'Cancel',
props: { color: 'secondary', fullWidth: true },
onClick: () => {
isOpen.value = false
}
}
])

const selectedEmails = computed(() => {
const query = searchVariables.value?.query || ''
Expand Down Expand Up @@ -150,7 +175,7 @@ const onInviteUser = async (

// Invite email
loading.value = true
await createInvite(props.project.id, inputs)
await createInvite(projectId.value, inputs)

mp.track('Invite Action', {
type: 'project invite',
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-2/components/project/page/StatsBlock.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="bg-foundation rounded-lg p-4 sm:px-6">
<div class="bg-foundation rounded-lg p-4 border border-outline-3">
<div class="flex flex-col">
<div class="text-foreground-2 mb-2">
<slot name="top" />
Expand Down

This file was deleted.

Loading