Merge pull request #1093 from dod-ccpo/js-cleanup
Delete unused Vue components and remove references to them.
This commit is contained in:
commit
c8a2e9ee96
@ -3,7 +3,7 @@
|
|||||||
"files": "^.secrets.baseline$",
|
"files": "^.secrets.baseline$",
|
||||||
"lines": null
|
"lines": null
|
||||||
},
|
},
|
||||||
"generated_at": "2019-09-24T13:51:51Z",
|
"generated_at": "2019-09-25T09:43:11Z",
|
||||||
"plugins_used": [
|
"plugins_used": [
|
||||||
{
|
{
|
||||||
"base64_limit": 4.5,
|
"base64_limit": 4.5,
|
||||||
@ -199,5 +199,5 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"version": "0.12.5"
|
"version": "0.12.6"
|
||||||
}
|
}
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
import { shallowMount } from '@vue/test-utils'
|
|
||||||
import { NO_ACCESS, EditEnvironmentRole } from '../forms/edit_environment_role'
|
|
||||||
|
|
||||||
describe('EditEnvironmentRole', () => {
|
|
||||||
var initialRoleCategories, wrapper
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
initialRoleCategories = [
|
|
||||||
{
|
|
||||||
role: NO_ACCESS,
|
|
||||||
members: [
|
|
||||||
{ role_name: null, application_role_id: '123' },
|
|
||||||
{ role_name: null, application_role_id: '456' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
role: 'Basic Access',
|
|
||||||
members: [{ role_name: 'Basic Access', application_role_id: '789' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
role: 'Network Admin',
|
|
||||||
members: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
role: 'Business Read-only',
|
|
||||||
members: [
|
|
||||||
{ role_name: 'Business Read-only', application_role_id: '012' },
|
|
||||||
{ role_name: 'Business Read-only', application_role_id: '345' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
role: 'Technical Read-only',
|
|
||||||
members: [
|
|
||||||
{ role_name: 'Technical Read-only', application_role_id: '678' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
wrapper = shallowMount(EditEnvironmentRole, {
|
|
||||||
propsData: { initialRoleCategories },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('removes null roles to no_access', () => {
|
|
||||||
let roles = wrapper.vm.sanitizeValues([
|
|
||||||
{ role: NO_ACCESS, members: [{ role_name: null }] },
|
|
||||||
])
|
|
||||||
expect(roles).toEqual([
|
|
||||||
{ role: NO_ACCESS, members: [{ role_name: NO_ACCESS }] },
|
|
||||||
])
|
|
||||||
})
|
|
||||||
|
|
||||||
it('gets the data for a user', () => {
|
|
||||||
let member_data = wrapper.vm.getUserInfo('678')
|
|
||||||
|
|
||||||
expect(member_data).toEqual({
|
|
||||||
role_name: 'Technical Read-only',
|
|
||||||
application_role_id: '678',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('removes a user from role', () => {
|
|
||||||
let techRole = wrapper.vm.roleCategories.find(role => {
|
|
||||||
return role.role === 'Technical Read-only'
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(techRole.members.length).toEqual(1)
|
|
||||||
wrapper.vm.removeUser('678')
|
|
||||||
expect(techRole.members.length).toEqual(0)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('adds user to a role', () => {
|
|
||||||
let techRole = wrapper.vm.roleCategories.find(role => {
|
|
||||||
return role.role === 'Technical Read-only'
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(techRole.members.length).toEqual(1)
|
|
||||||
wrapper.vm.addUser({ application_role_id: '901' }, 'Technical Read-only')
|
|
||||||
expect(techRole.members.length).toEqual(2)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('updates users role', () => {
|
|
||||||
let techRole = wrapper.vm.roleCategories.find(role => {
|
|
||||||
return role.role === 'Technical Read-only'
|
|
||||||
})
|
|
||||||
let businessRole = wrapper.vm.roleCategories.find(role => {
|
|
||||||
return role.role === 'Business Read-only'
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(techRole.members.length).toEqual(1)
|
|
||||||
expect(businessRole.members.length).toEqual(2)
|
|
||||||
wrapper.vm.updateRoles('678', 'Business Read-only')
|
|
||||||
expect(techRole.members.length).toEqual(0)
|
|
||||||
expect(businessRole.members.length).toEqual(3)
|
|
||||||
})
|
|
||||||
})
|
|
@ -1,43 +0,0 @@
|
|||||||
import { shallowMount } from '@vue/test-utils'
|
|
||||||
|
|
||||||
import EditOfficerForm from '../edit_officer_form'
|
|
||||||
|
|
||||||
describe('EditOfficerForm', () => {
|
|
||||||
it('defaults to not editing', () => {
|
|
||||||
const wrapper = shallowMount(EditOfficerForm)
|
|
||||||
expect(wrapper.vm.$data.editing).toEqual(false)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('does not start in editing mode when no errors', () => {
|
|
||||||
const wrapper = shallowMount(EditOfficerForm, {
|
|
||||||
propsData: { hasErrors: false },
|
|
||||||
})
|
|
||||||
expect(wrapper.vm.$data.editing).toEqual(false)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('does start in editing mode when the form has errors', () => {
|
|
||||||
const wrapper = shallowMount(EditOfficerForm, {
|
|
||||||
propsData: { hasErrors: true },
|
|
||||||
})
|
|
||||||
expect(wrapper.vm.$data.editing).toEqual(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('does start in editing mode when the form has changes', () => {
|
|
||||||
const wrapper = shallowMount(EditOfficerForm, {
|
|
||||||
propsData: { hasChanges: true },
|
|
||||||
})
|
|
||||||
expect(wrapper.vm.$data.editing).toEqual(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('starts editing when edit method called', () => {
|
|
||||||
const wrapper = shallowMount(EditOfficerForm)
|
|
||||||
wrapper.vm.edit({ preventDefault: () => null })
|
|
||||||
expect(wrapper.vm.$data.editing).toEqual(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('stops editing when cancel method called', () => {
|
|
||||||
const wrapper = shallowMount(EditOfficerForm)
|
|
||||||
wrapper.vm.cancel()
|
|
||||||
expect(wrapper.vm.$data.editing).toEqual(false)
|
|
||||||
})
|
|
||||||
})
|
|
@ -6,7 +6,6 @@ import FormMixin from '../../mixins/form'
|
|||||||
import Modal from '../../mixins/modal'
|
import Modal from '../../mixins/modal'
|
||||||
import MultiStepModalForm from './multi_step_modal_form'
|
import MultiStepModalForm from './multi_step_modal_form'
|
||||||
import checkboxinput from '../checkbox_input'
|
import checkboxinput from '../checkbox_input'
|
||||||
import levelofwarrant from '../levelofwarrant'
|
|
||||||
import multicheckboxinput from '../multi_checkbox_input'
|
import multicheckboxinput from '../multi_checkbox_input'
|
||||||
import optionsinput from '../options_input'
|
import optionsinput from '../options_input'
|
||||||
import SemiCollapsibleText from '../semi_collapsible_text'
|
import SemiCollapsibleText from '../semi_collapsible_text'
|
||||||
@ -22,7 +21,6 @@ export default {
|
|||||||
Modal,
|
Modal,
|
||||||
MultiStepModalForm,
|
MultiStepModalForm,
|
||||||
checkboxinput,
|
checkboxinput,
|
||||||
levelofwarrant,
|
|
||||||
multicheckboxinput,
|
multicheckboxinput,
|
||||||
optionsinput,
|
optionsinput,
|
||||||
SemiCollapsibleText,
|
SemiCollapsibleText,
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
import FormMixin from '../../mixins/form'
|
|
||||||
import Modal from '../../mixins/modal'
|
|
||||||
import toggler from '../toggler'
|
|
||||||
import { EditEnvironmentRole } from './edit_environment_role'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'edit-application-roles',
|
|
||||||
|
|
||||||
mixins: [FormMixin, Modal],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
toggler,
|
|
||||||
EditEnvironmentRole,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
name: String,
|
|
||||||
id: String,
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
doRevoke: function() {
|
|
||||||
this.$root.$emit('revoke-' + this.id)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,98 +0,0 @@
|
|||||||
import FormMixin from '../../mixins/form'
|
|
||||||
import Modal from '../../mixins/modal'
|
|
||||||
|
|
||||||
// Note: If refactoring consider using nested vue components as suggested by Dan:
|
|
||||||
// https://github.com/dod-ccpo/atst/pull/799/files#r282240663
|
|
||||||
// May also want to reconsider the data structure by storing the roles and members separately
|
|
||||||
|
|
||||||
export const NO_ACCESS = 'No Access'
|
|
||||||
|
|
||||||
export const EditEnvironmentRole = {
|
|
||||||
name: 'edit-environment-role',
|
|
||||||
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
props: {
|
|
||||||
initialRoleCategories: Array,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
selectedSection: null,
|
|
||||||
roleCategories: this.sanitizeValues(this.initialRoleCategories),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
sanitizeValues: function(roles) {
|
|
||||||
roles.forEach(role => {
|
|
||||||
role.members.forEach(member => {
|
|
||||||
if (member.role_name === null) {
|
|
||||||
member.role_name = NO_ACCESS
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
return roles
|
|
||||||
},
|
|
||||||
|
|
||||||
checkNoAccess: function(role) {
|
|
||||||
return role === NO_ACCESS
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleSection: function(sectionName) {
|
|
||||||
if (this.selectedSection === sectionName) {
|
|
||||||
this.selectedSection = null
|
|
||||||
} else {
|
|
||||||
this.selectedSection = sectionName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onInput: function(e) {
|
|
||||||
this.changed = true
|
|
||||||
this.updateRoles(e.target.attributes['user-id'].value, e.target.value)
|
|
||||||
this.showError = false
|
|
||||||
this.showValid = true
|
|
||||||
},
|
|
||||||
|
|
||||||
getUserInfo: function(userId) {
|
|
||||||
for (let role of this.roleCategories) {
|
|
||||||
for (let member of role.members) {
|
|
||||||
if (member.application_role_id === userId) {
|
|
||||||
return member
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
removeUser: function(userId) {
|
|
||||||
for (let role of this.roleCategories) {
|
|
||||||
role.members = role.members.filter(member => {
|
|
||||||
return member.application_role_id !== userId
|
|
||||||
})
|
|
||||||
if (!role.members) {
|
|
||||||
role.members = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
addUser: function(userInfo, newRole) {
|
|
||||||
this.roleCategories.forEach(role => {
|
|
||||||
if (role.role === newRole) {
|
|
||||||
userInfo.role_name = newRole
|
|
||||||
role.members.push(userInfo)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
updateRoles: function(userId, newRole) {
|
|
||||||
var userInfo = this.getUserInfo(userId)
|
|
||||||
this.removeUser(userId)
|
|
||||||
this.addUser(userInfo, newRole)
|
|
||||||
this.toggleSection()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function(createElement) {
|
|
||||||
return createElement('p', 'Please implement inline-template')
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
import FormMixin from '../../mixins/form'
|
|
||||||
import checkboxinput from '../checkbox_input'
|
|
||||||
import textinput from '../text_input'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'edit-officer-form',
|
|
||||||
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
checkboxinput,
|
|
||||||
textinput,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
hasChanges: {
|
|
||||||
type: Boolean,
|
|
||||||
default: () => false,
|
|
||||||
},
|
|
||||||
hasErrors: {
|
|
||||||
type: Boolean,
|
|
||||||
default: () => false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
editing: this.hasErrors || this.hasChanges,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
edit: function(event) {
|
|
||||||
event.preventDefault()
|
|
||||||
this.editing = true
|
|
||||||
},
|
|
||||||
|
|
||||||
cancel: function(event) {
|
|
||||||
this.editing = false
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
template: '<div></div>',
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
import createNumberMask from 'text-mask-addons/dist/createNumberMask'
|
|
||||||
import { conformToMask } from 'vue-text-mask'
|
|
||||||
|
|
||||||
import FormMixin from '../../mixins/form'
|
|
||||||
import textinput from '../text_input'
|
|
||||||
import optionsinput from '../options_input'
|
|
||||||
import uploadinput from '../upload_input'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'funding',
|
|
||||||
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
textinput,
|
|
||||||
optionsinput,
|
|
||||||
uploadinput,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
initialData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
uploadErrors: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
const {
|
|
||||||
clin_01 = 0,
|
|
||||||
clin_02 = 0,
|
|
||||||
clin_03 = 0,
|
|
||||||
clin_04 = 0,
|
|
||||||
} = this.initialData
|
|
||||||
|
|
||||||
return {
|
|
||||||
clin_01,
|
|
||||||
clin_02,
|
|
||||||
clin_03,
|
|
||||||
clin_04,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
totalBudget: function() {
|
|
||||||
return [this.clin_01, this.clin_02, this.clin_03, this.clin_04].reduce(
|
|
||||||
function(acc, curr) {
|
|
||||||
curr = !curr ? 0 : parseFloat(curr)
|
|
||||||
return acc + curr
|
|
||||||
},
|
|
||||||
0
|
|
||||||
)
|
|
||||||
},
|
|
||||||
totalBudgetStr: function() {
|
|
||||||
return this.totalBudget.toLocaleString('us-US', {
|
|
||||||
style: 'currency',
|
|
||||||
currency: 'USD',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
updateBudget: function() {
|
|
||||||
document.querySelector('#to-target').innerText = this.totalBudgetStr
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
clin_01: 'updateBudget',
|
|
||||||
clin_02: 'updateBudget',
|
|
||||||
clin_03: 'updateBudget',
|
|
||||||
clin_04: 'updateBudget',
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted: function() {
|
|
||||||
this.updateBudget()
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
import FormMixin from '../../mixins/form'
|
|
||||||
import textinput from '../text_input'
|
|
||||||
import checkboxinput from '../checkbox_input'
|
|
||||||
|
|
||||||
const dodid = {
|
|
||||||
name: 'dodid',
|
|
||||||
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
textinput,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
initialInvite: Boolean,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
invite: this.initialInvite,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const cordata = {
|
|
||||||
name: 'cordata',
|
|
||||||
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
textinput,
|
|
||||||
checkboxinput,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
initialCorInvite: Boolean,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
cor_invite: this.initialCorInvite,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'oversight',
|
|
||||||
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
textinput,
|
|
||||||
checkboxinput,
|
|
||||||
cordata,
|
|
||||||
dodid,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
initialData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
const {
|
|
||||||
am_cor = false,
|
|
||||||
ko_invite = false,
|
|
||||||
cor_invite = false,
|
|
||||||
so_invite = false,
|
|
||||||
} = this.initialData
|
|
||||||
|
|
||||||
return {
|
|
||||||
am_cor,
|
|
||||||
ko_invite,
|
|
||||||
cor_invite,
|
|
||||||
so_invite,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
@ -7,7 +7,6 @@ import FormMixin from '../../mixins/form'
|
|||||||
import optionsinput from '../options_input'
|
import optionsinput from '../options_input'
|
||||||
import SemiCollapsibleText from '../semi_collapsible_text'
|
import SemiCollapsibleText from '../semi_collapsible_text'
|
||||||
import textinput from '../text_input'
|
import textinput from '../text_input'
|
||||||
import TotalsBox from '../totals_box'
|
|
||||||
import uploadinput from '../upload_input'
|
import uploadinput from '../upload_input'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -22,7 +21,6 @@ export default {
|
|||||||
optionsinput,
|
optionsinput,
|
||||||
SemiCollapsibleText,
|
SemiCollapsibleText,
|
||||||
textinput,
|
textinput,
|
||||||
TotalsBox,
|
|
||||||
uploadinput,
|
uploadinput,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
import textinput from './text_input'
|
|
||||||
import checkboxinput from './checkbox_input'
|
|
||||||
import FormMixin from '../mixins/form'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [FormMixin],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
textinput,
|
|
||||||
checkboxinput,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
initialData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
const { unlimited_level_of_warrant = false } = this.initialData
|
|
||||||
|
|
||||||
return {
|
|
||||||
unlimited_level_of_warrant,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,107 +0,0 @@
|
|||||||
import { set } from 'vue/dist/vue'
|
|
||||||
import { compose, sortBy, reverse, indexBy, prop, toLower } from 'ramda'
|
|
||||||
|
|
||||||
import { formatDollars } from '../../lib/dollars'
|
|
||||||
import localDatetime from '../../components/local_datetime'
|
|
||||||
|
|
||||||
const sort = (sortInfo, members) => {
|
|
||||||
if (sortInfo.columnName === '') {
|
|
||||||
return members
|
|
||||||
} else {
|
|
||||||
const sortColumn = sortInfo.columns[sortInfo.columnName]
|
|
||||||
const sortedMembers = sortColumn.sortFunc(sortColumn.attr, members)
|
|
||||||
|
|
||||||
return sortInfo.isAscending ? sortedMembers : reverse(sortedMembers)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'task-order-list',
|
|
||||||
|
|
||||||
props: {
|
|
||||||
data: Array,
|
|
||||||
expired: Boolean,
|
|
||||||
funded: Boolean,
|
|
||||||
},
|
|
||||||
|
|
||||||
components: {
|
|
||||||
localDatetime,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function() {
|
|
||||||
const alphabeticalSort = (attr, members) => {
|
|
||||||
const lowercaseProp = compose(
|
|
||||||
toLower,
|
|
||||||
prop(attr)
|
|
||||||
)
|
|
||||||
return sortBy(lowercaseProp, members)
|
|
||||||
}
|
|
||||||
|
|
||||||
const numericSort = (attr, members) => sortBy(prop(attr), members)
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
displayName: 'Status',
|
|
||||||
attr: 'display_status',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'Period of Performance',
|
|
||||||
attr: 'start_date',
|
|
||||||
sortFunc: numericSort,
|
|
||||||
width: '50%',
|
|
||||||
class: 'period-of-performance',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'Initial Value',
|
|
||||||
attr: 'budget',
|
|
||||||
class: 'table-cell--align-right',
|
|
||||||
sortFunc: numericSort,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: this.expired ? 'Expired Balance' : 'Balance',
|
|
||||||
attr: 'budget',
|
|
||||||
class: 'table-cell--align-right',
|
|
||||||
sortFunc: numericSort,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: '',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const defaultSortColumn = 'Period of Performance'
|
|
||||||
return {
|
|
||||||
sortInfo: {
|
|
||||||
columnName: defaultSortColumn,
|
|
||||||
isAscending: false,
|
|
||||||
columns: indexBy(prop('displayName'), columns),
|
|
||||||
},
|
|
||||||
days_to_exp_alert_limit: 30,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
taskOrders: function() {
|
|
||||||
return sort(this.sortInfo, this.data)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
updateSort: function(columnName) {
|
|
||||||
// clicking a column twice toggles ascending / descending
|
|
||||||
if (columnName === this.sortInfo.columnName) {
|
|
||||||
this.sortInfo.isAscending = !this.sortInfo.isAscending
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sortInfo.columnName = columnName
|
|
||||||
},
|
|
||||||
|
|
||||||
getColumns: function() {
|
|
||||||
return Object.values(this.sortInfo.columns)
|
|
||||||
},
|
|
||||||
|
|
||||||
formatDollars: function(value) {
|
|
||||||
return formatDollars(value, false)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
template: '<div></div>',
|
|
||||||
}
|
|
@ -1,8 +1,6 @@
|
|||||||
import { EditEnvironmentRole } from './forms/edit_environment_role'
|
|
||||||
import FormMixin from '../mixins/form'
|
import FormMixin from '../mixins/form'
|
||||||
import optionsinput from './options_input'
|
import optionsinput from './options_input'
|
||||||
import textinput from './text_input'
|
import textinput from './text_input'
|
||||||
import EnvironmentRole from './environment_role'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'toggler',
|
name: 'toggler',
|
||||||
@ -17,11 +15,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
EditEnvironmentRole,
|
|
||||||
optionsinput,
|
optionsinput,
|
||||||
textinput,
|
textinput,
|
||||||
optionsinput,
|
optionsinput,
|
||||||
EnvironmentRole,
|
|
||||||
toggler: this,
|
toggler: this,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
import { formatDollars } from '../lib/dollars'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'totalsbox',
|
|
||||||
|
|
||||||
props: {
|
|
||||||
name: String,
|
|
||||||
obligated: Number,
|
|
||||||
contractAmount: Number,
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
formattedObligated: function() {
|
|
||||||
return formatDollars(this._filterNaN(this.obligated))
|
|
||||||
},
|
|
||||||
formattedContractAmount: function() {
|
|
||||||
return formatDollars(this._filterNaN(this.contractAmount))
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
_filterNaN: function(value) {
|
|
||||||
return Number.isNaN(value) ? 0 : value
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
16
js/index.js
16
js/index.js
@ -8,28 +8,21 @@ import VTooltip from 'v-tooltip'
|
|||||||
import stickybits from 'stickybits'
|
import stickybits from 'stickybits'
|
||||||
|
|
||||||
import dodlogin from './components/dodlogin'
|
import dodlogin from './components/dodlogin'
|
||||||
import levelofwarrant from './components/levelofwarrant'
|
|
||||||
import optionsinput from './components/options_input'
|
import optionsinput from './components/options_input'
|
||||||
import multicheckboxinput from './components/multi_checkbox_input'
|
import multicheckboxinput from './components/multi_checkbox_input'
|
||||||
import textinput from './components/text_input'
|
import textinput from './components/text_input'
|
||||||
import checkboxinput from './components/checkbox_input'
|
import checkboxinput from './components/checkbox_input'
|
||||||
import EditOfficerForm from './components/forms/edit_officer_form'
|
|
||||||
import poc from './components/forms/poc'
|
import poc from './components/forms/poc'
|
||||||
import oversight from './components/forms/oversight'
|
|
||||||
import toggler from './components/toggler'
|
import toggler from './components/toggler'
|
||||||
import ApplicationNameAndDescription from './components/forms/new_application/name_and_description'
|
import ApplicationNameAndDescription from './components/forms/new_application/name_and_description'
|
||||||
import ApplicationEnvironments from './components/forms/new_application/environments'
|
import ApplicationEnvironments from './components/forms/new_application/environments'
|
||||||
import { EditEnvironmentRole } from './components/forms/edit_environment_role'
|
|
||||||
import EditApplicationRoles from './components/forms/edit_application_roles'
|
|
||||||
import MultiStepModalForm from './components/forms/multi_step_modal_form'
|
import MultiStepModalForm from './components/forms/multi_step_modal_form'
|
||||||
import funding from './components/forms/funding'
|
|
||||||
import uploadinput from './components/upload_input'
|
import uploadinput from './components/upload_input'
|
||||||
import Modal from './mixins/modal'
|
import Modal from './mixins/modal'
|
||||||
import selector from './components/selector'
|
import selector from './components/selector'
|
||||||
import BudgetChart from './components/charts/budget_chart'
|
import BudgetChart from './components/charts/budget_chart'
|
||||||
import SpendTable from './components/tables/spend_table'
|
import SpendTable from './components/tables/spend_table'
|
||||||
import EnvironmentsTable from './components/tables/application_environments'
|
import EnvironmentsTable from './components/tables/application_environments'
|
||||||
import TaskOrderList from './components/tables/task_order_list.js'
|
|
||||||
import LocalDatetime from './components/local_datetime'
|
import LocalDatetime from './components/local_datetime'
|
||||||
import { isNotInVerticalViewport } from './lib/viewport'
|
import { isNotInVerticalViewport } from './lib/viewport'
|
||||||
import DateSelector from './components/date_selector'
|
import DateSelector from './components/date_selector'
|
||||||
@ -39,7 +32,6 @@ import DeleteConfirmation from './components/delete_confirmation'
|
|||||||
import NewEnvironment from './components/forms/new_environment'
|
import NewEnvironment from './components/forms/new_environment'
|
||||||
import EnvironmentRole from './components/environment_role'
|
import EnvironmentRole from './components/environment_role'
|
||||||
import SemiCollapsibleText from './components/semi_collapsible_text'
|
import SemiCollapsibleText from './components/semi_collapsible_text'
|
||||||
import TotalsBox from './components/totals_box'
|
|
||||||
import ToForm from './components/forms/to_form'
|
import ToForm from './components/forms/to_form'
|
||||||
import ClinFields from './components/clin_fields'
|
import ClinFields from './components/clin_fields'
|
||||||
|
|
||||||
@ -54,35 +46,27 @@ const app = new Vue({
|
|||||||
components: {
|
components: {
|
||||||
dodlogin,
|
dodlogin,
|
||||||
toggler,
|
toggler,
|
||||||
levelofwarrant,
|
|
||||||
optionsinput,
|
optionsinput,
|
||||||
multicheckboxinput,
|
multicheckboxinput,
|
||||||
textinput,
|
textinput,
|
||||||
checkboxinput,
|
checkboxinput,
|
||||||
poc,
|
poc,
|
||||||
oversight,
|
|
||||||
ApplicationNameAndDescription,
|
ApplicationNameAndDescription,
|
||||||
ApplicationEnvironments,
|
ApplicationEnvironments,
|
||||||
selector,
|
selector,
|
||||||
BudgetChart,
|
BudgetChart,
|
||||||
SpendTable,
|
SpendTable,
|
||||||
EnvironmentsTable,
|
EnvironmentsTable,
|
||||||
TaskOrderList,
|
|
||||||
LocalDatetime,
|
LocalDatetime,
|
||||||
EditEnvironmentRole,
|
|
||||||
EditApplicationRoles,
|
|
||||||
MultiStepModalForm,
|
MultiStepModalForm,
|
||||||
funding,
|
|
||||||
uploadinput,
|
uploadinput,
|
||||||
DateSelector,
|
DateSelector,
|
||||||
EditOfficerForm,
|
|
||||||
SidenavToggler,
|
SidenavToggler,
|
||||||
BaseForm,
|
BaseForm,
|
||||||
DeleteConfirmation,
|
DeleteConfirmation,
|
||||||
NewEnvironment,
|
NewEnvironment,
|
||||||
EnvironmentRole,
|
EnvironmentRole,
|
||||||
SemiCollapsibleText,
|
SemiCollapsibleText,
|
||||||
TotalsBox,
|
|
||||||
ToForm,
|
ToForm,
|
||||||
ClinFields,
|
ClinFields,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user