Merge branch 'api'

This commit is contained in:
Oliver Davies 2019-03-31 06:37:50 +01:00
commit be42371350
5 changed files with 249 additions and 231 deletions

236
src/api-client.js Normal file
View file

@ -0,0 +1,236 @@
import _ from 'lodash'
const data = {
applications: {
1: {
id: 1,
name: 'Rebuilding Acquia',
machineName: 'rebuildingacquia',
type: 'Drupal',
level: 'Enterprise',
environments: {
dev: {
name: 'Dev',
url: 'dev.rebuilding-acquia.com',
label: 'develop'
},
stage: {
name: 'Stage',
url: 'stg.rebuilding-acquia.com',
label: 'master'
},
prod: {
name: 'Prod',
url: 'rebuilding-acquia.com',
label: 'tags/2018-12-21'
},
ra: {
name: 'RA',
url: 'ra.rebuilding-acquia.com',
label: 'tags/WELCOME'
}
},
tasks: [
{
text: 'Commit: fdac923 Merge branch \'update-password-policy\' refs/heads/master',
user: 'system',
times: {
display: 'Dec 19, 2018 3:48:29 PM UTC +0000',
started: 'Dec 19, 2018 3:48:29 PM UTC +0000',
completed: 'Dec 19, 2018 3:48:29 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 9688c41 Update IP address refs/heads/master',
user: 'system',
times: {
display: 'Dec 19, 2018 3:50:31 PM UTC +0000',
started: 'Dec 19, 2018 3:50:31 PM UTC +0000',
completed: 'Dec 19, 2018 3:50:31 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Deploy code from test to prod',
user: 'system',
times: {
display: 'Dec 19, 2018 3:55:29 PM UTC +0000',
started: 'Dec 19, 2018 3:55:29 PM UTC +0000',
completed: 'Dec 19, 2018 3:55:29 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Deploy the code reference master to dev',
user: 'system',
times: {
display: 'Dec 20, 2018 10:13:48 PM UTC +0000',
started: 'Dec 20, 2018 10:13:48 PM UTC +0000',
completed: 'Dec 20, 2018 10:13:48 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Deploy the code reference tags/2018-12-19 to test',
user: 'system',
times: {
display: 'Dec 20, 2018 10:25:07 PM UTC +0000',
started: 'Dec 20, 2018 10:25:07 PM UTC +0000',
completed: 'Dec 20, 2018 10:25:07 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: e75c4a3 Merge branch \'voucher-code-bug-34\' refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 12:55:49 PM UTC +0000',
started: 'Dec 21, 2018 12:55:49 PM UTC +0000',
completed: 'Dec 21, 2018 12:55:49 PM UTC +0000'
},
status: 'Failed',
loading: false,
success: false
},
{
text: 'Commit: 398945c Ensure stage_file_proxy is enabled refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 1:09:19 PM UTC +0000',
started: 'Dec 21, 2018 1:09:19 PM UTC +0000',
completed: 'Dec 21, 2018 1:09:19 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 96ac151 Fix syntax refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 1:23:43 PM UTC +0000',
started: 'Dec 21, 2018 1:23:43 PM UTC +0000',
completed: 'Dec 21, 2018 1:23:43 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 8056d51 Add production URLs as settings refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 1:34:13 PM UTC +0000',
started: 'Dec 21, 2018 1:34:13 PM UTC +0000',
completed: 'Dec 21, 2018 1:34:13 PM UTC +0000'
},
status: 'In progress',
loading: true,
success: true
}
]
},
2: {
id: 2,
name: 'Oliver Davies',
machineName: 'oliverdavies',
type: 'Drupal',
level: 'Professional',
environments: {
dev: {
name: 'Dev',
url: 'dev.oliverdavies.uk',
label: 'develop'
},
stage: {
name: 'Stage',
url: 'stg.oliverdavies.uk',
label: 'master'
},
prod: {
name: 'Prod',
url: 'oliverdavies.uk',
label: 'tags/2018-12-21'
}
},
tasks: [
{
text: 'Create database opdaviestest in Dev.',
user: 'system',
times: {
display: 'Dec 23, 2018 11:26:48 PM UTC +0000',
started: 'Dec 23, 2018 11:26:50 PM UTC +0000',
completed: 'Dec 23, 2018 11:26:52 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Create database opdaviestest in Stage.',
user: 'system',
times: {
display: 'Dec 23, 2018 11:26:48 PM UTC +0000',
started: 'Dec 23, 2018 11:26:50 PM UTC +0000',
completed: 'Dec 23, 2018 11:26:52 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Install Drupal 8 to Dev.',
user: 'oliver@oliverdavies.uk (oliver@oliverdavies.uk)',
times: {
display: 'Dec 23, 2018 11:33:52 PM UTC +0000',
started: 'Dec 23, 2018 11:33:53 PM UTC +0000',
completed: 'Dec 23, 2018 11:37:21 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 9736ef5 Importing site archive refs/heads/master',
user: 'vcs.commit',
times: {
display: 'Dec 23, 2018 11:36:29 PM UTC +0000',
started: 'Dec 23, 2018 11:36:30 PM UTC +0000',
completed: 'Dec 23, 2018 11:37:16 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 0ab620f Initial commit to Acquia Git starter repo. refs/tags/pre-import-2018-12-23',
user: 'vcs.commit',
times: {
display: 'Dec 23, 2018 11:36:30 PM UTC +0000',
started: 'Dec 23, 2018 11:36:32 PM UTC +0000',
completed: 'Dec 23, 2018 11:36:33 PM UTC +0000'
},
loading: false,
success: true
}
]
}
}
}
export default {
methods: {
getApplications () {
return data.applications
},
getApplication (applicationId) {
return _(data.applications).get(applicationId)
},
getEnvironment (applicationId, environment) {
return _(this.getApplication(applicationId))
.get('environments')[environment]
}
}
}

View file

@ -1,217 +0,0 @@
export default {
applications: {
1: {
id: 1,
name: 'Rebuilding Acquia',
machineName: 'rebuildingacquia',
type: 'Drupal',
level: 'Enterprise',
environments: {
dev: {
name: 'Dev',
url: 'dev.rebuilding-acquia.com',
label: 'develop'
},
stage: {
name: 'Stage',
url: 'stg.rebuilding-acquia.com',
label: 'master'
},
prod: {
name: 'Prod',
url: 'rebuilding-acquia.com',
label: 'tags/2018-12-21'
},
ra: {
name: 'RA',
url: 'ra.rebuilding-acquia.com',
label: 'tags/WELCOME'
}
},
tasks: [
{
text: 'Commit: fdac923 Merge branch \'update-password-policy\' refs/heads/master',
user: 'system',
times: {
display: 'Dec 19, 2018 3:48:29 PM UTC +0000',
started: 'Dec 19, 2018 3:48:29 PM UTC +0000',
completed: 'Dec 19, 2018 3:48:29 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 9688c41 Update IP address refs/heads/master',
user: 'system',
times: {
display: 'Dec 19, 2018 3:50:31 PM UTC +0000',
started: 'Dec 19, 2018 3:50:31 PM UTC +0000',
completed: 'Dec 19, 2018 3:50:31 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Deploy code from test to prod',
user: 'system',
times: {
display: 'Dec 19, 2018 3:55:29 PM UTC +0000',
started: 'Dec 19, 2018 3:55:29 PM UTC +0000',
completed: 'Dec 19, 2018 3:55:29 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Deploy the code reference master to dev',
user: 'system',
times: {
display: 'Dec 20, 2018 10:13:48 PM UTC +0000',
started: 'Dec 20, 2018 10:13:48 PM UTC +0000',
completed: 'Dec 20, 2018 10:13:48 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Deploy the code reference tags/2018-12-19 to test',
user: 'system',
times: {
display: 'Dec 20, 2018 10:25:07 PM UTC +0000',
started: 'Dec 20, 2018 10:25:07 PM UTC +0000',
completed: 'Dec 20, 2018 10:25:07 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: e75c4a3 Merge branch \'voucher-code-bug-34\' refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 12:55:49 PM UTC +0000',
started: 'Dec 21, 2018 12:55:49 PM UTC +0000',
completed: 'Dec 21, 2018 12:55:49 PM UTC +0000'
},
status: 'Failed',
loading: false,
success: false
},
{
text: 'Commit: 398945c Ensure stage_file_proxy is enabled refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 1:09:19 PM UTC +0000',
started: 'Dec 21, 2018 1:09:19 PM UTC +0000',
completed: 'Dec 21, 2018 1:09:19 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 96ac151 Fix syntax refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 1:23:43 PM UTC +0000',
started: 'Dec 21, 2018 1:23:43 PM UTC +0000',
completed: 'Dec 21, 2018 1:23:43 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 8056d51 Add production URLs as settings refs/heads/master',
user: 'system',
times: {
display: 'Dec 21, 2018 1:34:13 PM UTC +0000',
started: 'Dec 21, 2018 1:34:13 PM UTC +0000',
completed: 'Dec 21, 2018 1:34:13 PM UTC +0000'
},
status: 'In progress',
loading: true,
success: true
}
]
},
2: {
id: 2,
name: 'Oliver Davies',
machineName: 'oliverdavies',
type: 'Drupal',
level: 'Professional',
environments: {
dev: {
name: 'Dev',
url: 'dev.oliverdavies.uk',
label: 'develop'
},
stage: {
name: 'Stage',
url: 'stg.oliverdavies.uk',
label: 'master'
},
prod: {
name: 'Prod',
url: 'oliverdavies.uk',
label: 'tags/2018-12-21'
}
},
tasks: [
{
text: 'Create database opdaviestest in Dev.',
user: 'system',
times: {
display: 'Dec 23, 2018 11:26:48 PM UTC +0000',
started: 'Dec 23, 2018 11:26:50 PM UTC +0000',
completed: 'Dec 23, 2018 11:26:52 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Create database opdaviestest in Stage.',
user: 'system',
times: {
display: 'Dec 23, 2018 11:26:48 PM UTC +0000',
started: 'Dec 23, 2018 11:26:50 PM UTC +0000',
completed: 'Dec 23, 2018 11:26:52 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Install Drupal 8 to Dev.',
user: 'oliver@oliverdavies.uk (oliver@oliverdavies.uk)',
times: {
display: 'Dec 23, 2018 11:33:52 PM UTC +0000',
started: 'Dec 23, 2018 11:33:53 PM UTC +0000',
completed: 'Dec 23, 2018 11:37:21 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 9736ef5 Importing site archive refs/heads/master',
user: 'vcs.commit',
times: {
display: 'Dec 23, 2018 11:36:29 PM UTC +0000',
started: 'Dec 23, 2018 11:36:30 PM UTC +0000',
completed: 'Dec 23, 2018 11:37:16 PM UTC +0000'
},
loading: false,
success: true
},
{
text: 'Commit: 0ab620f Initial commit to Acquia Git starter repo. refs/tags/pre-import-2018-12-23',
user: 'vcs.commit',
times: {
display: 'Dec 23, 2018 11:36:30 PM UTC +0000',
started: 'Dec 23, 2018 11:36:32 PM UTC +0000',
completed: 'Dec 23, 2018 11:36:33 PM UTC +0000'
},
loading: false,
success: true
}
]
}
}
}

View file

@ -63,11 +63,13 @@
<script>
import _ from 'lodash'
import ApiClient from '@/api-client.js'
import ApplicationCard from '@/components/Application/ApplicationCard'
import ApplicationDisplaySwitcher from '@/components/Application/ApplicationDisplaySwitcher'
import data from '@/data'
export default {
mixins: [ApiClient],
components: {
ApplicationCard,
ApplicationDisplaySwitcher
@ -75,7 +77,7 @@ export default {
data () {
return {
applications: data.applications,
applications: this.getApplications(),
display: 'grid'
}
},

View file

@ -153,10 +153,12 @@
<script>
import ActionCards from '@/components/Environment/ActionCards'
import ApiClient from '@/api-client.js'
import ApplicationTags from '@/components/Application/ApplicationTags'
import data from '@/data'
export default {
mixins: [ApiClient],
components: {
ActionCards,
ApplicationTags
@ -167,19 +169,13 @@ export default {
environmentName: String
},
data () {
return {
applications: data.applications
}
},
computed: {
application: function () {
return this.applications[this.id]
return this.getApplication(this.id)
},
environment: function () {
return this.application['environments'][this.environmentName]
return this.getEnvironment(this.id, this.environmentName)
},
gitUrl: function () {

View file

@ -82,14 +82,16 @@
</template>
<script>
import ApiClient from '@/api-client.js'
import ApplicationTags from '@/components/Application/ApplicationTags'
import data from '@/data'
import EnvironmentCards from '@/components/Environment/EnvironmentCards'
import QuickHelp from '@/components/Environment/QuickHelp'
import TaskLog from '@/components/Environment/TaskLog/TaskLog'
import ToggleHelp from '@/components/Environment/ToggleHelp'
export default {
mixins: [ApiClient],
components: {
ApplicationTags,
EnvironmentCards,
@ -104,7 +106,6 @@ export default {
data () {
return {
applications: data.applications,
help: {
hidden: false
}
@ -113,7 +114,7 @@ export default {
computed: {
application: function () {
return this.applications[this.id]
return this.getApplication(this.id)
}
}
}