Skip to content

Commit

Permalink
Merge branch 'main' into source-apn-ses-email
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb authored Jul 16, 2024
2 parents 0ac093a + 01934d5 commit d6c04ea
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 50 deletions.
47 changes: 46 additions & 1 deletion .github/workflows/install-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
- cron: '45 23 * * *'
workflow_dispatch:


jobs:
install:
name: Install and test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
Expand All @@ -32,3 +32,48 @@ jobs:
- name: test access
run: |
curl -L -v http://localhost:3000
notify-slack:
name: Notify about test failure
needs: [install]
if: failure()
runs-on: ubuntu-latest

steps:
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: 'C067BD0377F'
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":x: ${{ github.workflow }} workflow failed",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.server_url }}/${{ github.repository }}/actions/workflows/install-test.yaml|${{ github.workflow }}> workflow failed to complete successfully."
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_GHBOT_TOKEN }}
6 changes: 6 additions & 0 deletions frontend/src/pages/application/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:columns="cloudColumns"
:rows="filteredRows"
:show-search="true"
:search="searchTerm"
search-placeholder="Search Instances"
:rows-selectable="true"
@update:search="updateSearch"
Expand Down Expand Up @@ -174,6 +175,11 @@ export default {
return this.teamMembership.role === Roles.Admin
}
},
mounted () {
if (this.$route?.query?.searchQuery) {
this.searchTerm = this.$route.query.searchQuery
}
},
methods: {
selectedCloudRow (cloudInstance) {
this.$router.push({
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/pages/team/Applications/components/Application.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<ApplicationHeader :application="localApplication" />

<InstancesWrapper :application="localApplication" :is-searching="isSearching" @delete-instance="onInstanceDelete" />
<InstancesWrapper :application="localApplication" :search-query="searchQuery" @delete-instance="onInstanceDelete" />

<DevicesWrapper :application="localApplication" :is-searching="isSearching" @delete-device="$emit('device-deleted')" />
<DevicesWrapper :application="localApplication" :search-query="searchQuery" @delete-device="$emit('device-deleted')" />

<ConfirmInstanceDeleteDialog ref="confirmInstanceDeleteDialog" @confirm="onInstanceDeleted" />
</template>
Expand All @@ -29,10 +29,10 @@ export default {
type: Object,
required: true
},
isSearching: {
type: Boolean,
searchQuery: {
type: String,
required: false,
default: false
default: ''
}
},
emits: ['instance-deleted', 'device-deleted'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
>
<DeviceTile :device="device" :application="application" @device-action="onDeviceAction" />
</div>
<div v-if="hasMoreDevices" class="has-more item-wrapper">
<router-link :to="{name: 'ApplicationDevices', params: {id: application.id}}">
<span>
{{ remainingDevices }}
More...
</span>
<ChevronRightIcon class="ff-icon" />
</router-link>
</div>
<HasMoreTile
v-if="hasMoreDevices"
link-to="ApplicationDevices"
:remaining="remainingDevices"
:application="application"
:search-query="searchQuery"
/>
</div>

<TeamDeviceCreateDialog
Expand Down Expand Up @@ -71,29 +69,28 @@
</template>

<script>
import { ChevronRightIcon } from '@heroicons/vue/solid'
import IconDeviceSolid from '../../../../../components/icons/DeviceSolid.js'
import deviceActionsMixin from '../../../../../mixins/DeviceActions.js'
import DeviceCredentialsDialog from '../../../Devices/dialogs/DeviceCredentialsDialog.vue'
import TeamDeviceCreateDialog from '../../../Devices/dialogs/TeamDeviceCreateDialog.vue'
import DeviceTile from './DeviceTile.vue'
import HasMoreTile from './HasMoreTile.vue'
export default {
name: 'DevicesWrapper',
components: { TeamDeviceCreateDialog, DeviceCredentialsDialog, ChevronRightIcon, IconDeviceSolid, DeviceTile },
components: { HasMoreTile, TeamDeviceCreateDialog, DeviceCredentialsDialog, IconDeviceSolid, DeviceTile },
mixins: [deviceActionsMixin],
props: {
application: {
type: Object,
required: true,
default: null
},
isSearching: {
type: Boolean,
searchQuery: {
type: String,
required: false,
default: false
default: ''
}
},
emits: ['delete-device'],
Expand All @@ -120,6 +117,9 @@ export default {
},
devices () {
return this.application.devices.slice(0, 3)
},
isSearching () {
return this.searchQuery.length > 0
}
},
mounted () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<div class="has-more item-wrapper" data-el="has-more-tile">
<router-link :to="{name: linkTo, params: {id: application.id}, query: {searchQuery}}">
<span>
{{ remaining }}
More...
</span>
<ChevronRightIcon class="ff-icon" />
</router-link>
</div>
</template>

<script>
import { ChevronRightIcon } from '@heroicons/vue/solid'
export default {
name: 'HasMoreTile',
components: { ChevronRightIcon },
props: {
application: {
type: Object,
required: true
},
remaining: {
type: Number,
required: true
},
linkTo: {
type: String,
required: true
},
searchQuery: {
type: String,
required: false,
default: ''
}
}
}
</script>

<style scoped lang="scss">
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,37 @@
>
<InstanceTile :instance="instance" @delete-instance="$emit('delete-instance', $event)" />
</div>
<div v-if="hasMoreInstances" class="has-more item-wrapper">
<router-link :to="{name: 'ApplicationInstances', params: {id: application.id}}">
<span>
{{ remainingInstances }}
More...
</span>
<ChevronRightIcon class="ff-icon" />
</router-link>
</div>
<HasMoreTile
v-if="hasMoreInstances"
link-to="ApplicationInstances"
:remaining="remainingInstances"
:application="application"
:search-query="searchQuery"
/>
</div>
</section>
</template>

<script>
import { ChevronRightIcon } from '@heroicons/vue/solid'
import IconNodeRedSolid from '../../../../../components/icons/NodeRedSolid.js'
import HasMoreTile from './HasMoreTile.vue'
import InstanceTile from './InstanceTile.vue'
export default {
name: 'InstancesWrapper',
components: { ChevronRightIcon, IconNodeRedSolid, InstanceTile },
components: { HasMoreTile, IconNodeRedSolid, InstanceTile },
props: {
application: {
type: Object,
required: true,
default: null
},
isSearching: {
type: Boolean,
searchQuery: {
type: String,
required: false,
default: false
default: ''
}
},
emits: ['delete-instance'],
Expand All @@ -86,6 +84,9 @@ export default {
},
threeInstances () {
return this.application.instanceCount === 3
},
isSearching () {
return this.searchQuery.length > 0
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/team/Applications/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<li v-for="application in filteredApplications" :key="application.id" data-el="application-item">
<ApplicationListItem
:application="application"
:is-searching="filterTerm.length > 0"
:search-query="filterTerm"
@instance-deleted="fetchData(false)"
@device-deleted="fetchData(false)"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default {
},
filterTerm: {
get () {
return this.search
return this.search || this.internalSearch
},
set (value) {
const valueChanged = value !== this.internalSearch
Expand Down Expand Up @@ -259,6 +259,11 @@ export default {
}
}
},
mounted () {
if (this.$route?.query?.searchQuery) {
this.internalSearch = this.$route.query.searchQuery
}
},
methods: {
filterRows (rows) {
const search = this.internalSearch
Expand Down
Loading

0 comments on commit d6c04ea

Please sign in to comment.