Skip to content

Commit

Permalink
Merge pull request #32 from input-output-hk/NPG-8789
Browse files Browse the repository at this point in the history
feat: Add warning for PoA review and add f12 to funding file generation
  • Loading branch information
coire1 authored Jul 15, 2024
2 parents 8fd9f16 + 3307e49 commit a02a6e2
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<div class="content new-poa-review-popup">
<div class="box">
<h3>{{ $t('new_poa_review.title') }}</h3>
<o-notification v-if="!isPreviousPoaSignedOff" class="is-warning">
{{ $t('new_poa_review.no_previous_signoff') }}
</o-notification>
<schema-form
class="card-content scrollable-modal"
:schema="schema"
Expand Down Expand Up @@ -43,6 +46,10 @@ const props = defineProps({
som: {
type: Object,
default: () => {}
},
isPreviousPoaSignedOff: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['poaReviewSubmitted'])
Expand Down
5 changes: 5 additions & 0 deletions milestone-tracker-frontend/src/components/poa/PoaList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<poa-single
class="current-poa"
:is-previous-poa-signed-off="isPreviousPoaSignedOff"
:current="true"
:poa="renderedPoas.current"
:som="som"
Expand Down Expand Up @@ -60,6 +61,10 @@ const props = defineProps({
submittablePoa: {
type: Boolean,
default: false
},
isPreviousPoaSignedOff: {
type: Boolean,
default: false
}
})
Expand Down
5 changes: 5 additions & 0 deletions milestone-tracker-frontend/src/components/poa/PoaSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
v-if="canWriteSomReview(proposal.id, proposal.challenge_id) && current && !locked && newReviewVisible"
class="section pr-0 pl-0">
<new-poa-review
:is-previous-poa-signed-off="isPreviousPoaSignedOff"
:som="som"
:poa="poa"
@poa-review-submitted="newReviewVisible = false"
Expand Down Expand Up @@ -114,6 +115,10 @@ const props = defineProps({
type: Object,
default: () => {}
},
isPreviousPoaSignedOff: {
type: Boolean,
default: false
}
})
import { useUser } from '@/store/user.js'
const { canWriteSomReview, canSignoff, canWithdrawSignoff } = useUser()
Expand Down
9 changes: 7 additions & 2 deletions milestone-tracker-frontend/src/components/som/SingleSom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@
</section>
<div v-if="som.poas.length > 0" class="columns">
<div :id="`poa-${som.milestone}`" class="column is-12">
<poa-list :som="som" :poas="som.poas" :proposal="proposal" :submittable-poa="current && canWriteSom(proposal.id) && (locked > 0) && !poaLocked" />
<poa-list
:is-previous-poa-signed-off="isPreviousPoaSignedOff(otherMilestonesSoms, som)"
:som="som"
:poas="som.poas"
:proposal="proposal"
:submittable-poa="current && canWriteSom(proposal.id) && (locked > 0) && !poaLocked" />
</div>
</div>
</div>
Expand Down Expand Up @@ -351,7 +356,7 @@ import NewSignoff from '@/components/forms/NewSignoff.vue'
import NewSignoffWithdraw from '@/components/forms/NewSignoffWithdraw.vue'
import SignoffWithdrawList from '@/components/shared/SignoffWithdrawList.vue'
import ResubmissionConfirm from '@/components/proposal/ResubmissionConfirm.vue'
import { canAllSomsBeSignedOffByReviews, isPreviousSomSignedOff } from '../../utils/milestones'
import { canAllSomsBeSignedOffByReviews, isPreviousSomSignedOff, isPreviousPoaSignedOff } from '../../utils/milestones'
</script>

<style lang="scss" scoped>
Expand Down
1 change: 1 addition & 0 deletions milestone-tracker-frontend/src/locales/messages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default {
poa_approved_help: "Tick the checkbox if the Proof of Achievement for the Milestone is approved.",
comment: "Comment:",
comment_help: "Please provide a description why Proof of Achievement (PoA) is approved. In case PoA is not approved, please describe what is missing and how the proposer can amend them in order to get the approval.",
no_previous_signoff: "Previous milestone's PoA is not signed off yet. It is recommended to wait for its final approval before proceeding with the review of this PoA."
},
poa_reviews: {
open: "Open",
Expand Down
26 changes: 25 additions & 1 deletion milestone-tracker-frontend/src/pages/FundingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const {
getSubmittedSomReviews
} = useUsers()
const funds = ref(['Fund 9', 'Fund 10', 'Fund 11'])
const funds = ref(['Fund 9', 'Fund 10', 'Fund 11', 'Fund 12'])
const poaRewards = ref({
'Fund 9': [
{
Expand Down Expand Up @@ -137,6 +137,18 @@ const poaRewards = ref({
min: 150000,
max: 10000000
}
],
'Fund 12': [
{
amount: 200,
min: 0,
max: 150000
},
{
amount: 250,
min: 150000,
max: 10000000
}
]
})
const somRewards = ref({
Expand Down Expand Up @@ -165,6 +177,18 @@ const somRewards = ref({
min: 150000,
max: 10000000
}
],
'Fund 12': [
{
amount: 200,
min: 0,
max: 150000
},
{
amount: 250,
min: 150000,
max: 10000000
}
]
})
Expand Down
24 changes: 24 additions & 0 deletions milestone-tracker-frontend/src/utils/milestones.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,29 @@ const isPreviousSomSignedOff = (soms, currentSom) => {
return false
}

const isPreviousPoaSignedOff = (soms, currentSom) => {
if (currentSom) {
if (currentSom.milestone === 1) {
return true
}
const previousMl = soms.find((s) => {
if (s) {
return s.milestone === currentSom.milestone - 1
}
return false
})
if (previousMl) {
if (previousMl.poas.length > 0) {
const previousPoa = previousMl.poas.find((p) => p.current)
if (previousPoa) {
return previousPoa.signoffs.length > 0
}
}
}
}
return false
}


// Specific validation rules
const minCostF9 = () => 1
Expand Down Expand Up @@ -358,5 +381,6 @@ export {
canSubmitSomByChangeRequest,
canAllSomsBeSignedOffByReviews,
isPreviousSomSignedOff,
isPreviousPoaSignedOff,
generateValidationRules
}

0 comments on commit a02a6e2

Please sign in to comment.