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

Ability to add device from empty state #4228

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 54 additions & 0 deletions frontend/src/components/DevicesBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,60 @@
</router-link>.
</p>
</template>
<template #actions>
<ff-button
v-if="hasPermission('device:create')"
class="font-normal"
kind="primary"
:disabled="teamDeviceLimitReached || teamRuntimeLimitReached"
data-action="register-device"
@click="showCreateDeviceDialog"
>
<template #icon-left>
<PlusSmIcon />
</template>
Add Device
</ff-button>
</template>
</EmptyState>
</template>
<template v-else-if="displayingApplication">
<EmptyState data-el="application-no-devices">
<template #img>
<img src="../images/empty-states/instance-devices.png">
</template>
<template #header>Connect your First Device</template>
<template #message>
<p>
Here, you will see a list of Devices belonging to this Application.
</p>
<p>
You can deploy <router-link class="ff-link" :to="{name: 'ApplicationSnapshots'}">Snapshots</router-link> of this Application to your connected Devices.
</p>
<p>
A full list of your Team's Devices are available <router-link
class="ff-link"
:to="{name: 'TeamDevices', params: {team_slug: team.slug}}"
>
here
</router-link>.
</p>
</template>
<template #actions>
<ff-button
v-if="hasPermission('device:create')"
class="font-normal"
kind="primary"
:disabled="teamDeviceLimitReached || teamRuntimeLimitReached"
data-action="register-device"
@click="showCreateDeviceDialog"
>
<template #icon-left>
<PlusSmIcon />
</template>
Add Device
</ff-button>
</template>
</EmptyState>
</template>
<div v-else class="ff-no-data ff-no-data-large">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default {
// in the project directly? Currently done as a two
// step process
// eslint-disable-next-line promise/no-nesting
return devicesApi.updateDevice(response.id, { project: this.instance.id }).then((response) => {
return devicesApi.updateDevice(response.id, { instance: this.instance.id }).then((response) => {
// Reattach the credentials from the create request
// so they can be displayed to the user
response.credentials = creds
Expand Down
Loading