Open zufanka opened 4 years ago
@ca1yps0 i have already implemented this design into branch add-red-flags-in-the-detail-view
and have created merge request for it. you can find necessary HTML in elvis-ember/app/templates/components/contracts-relationship.hbs
starting on line 21 (you will also have to add new th.flags
column into the table header
here is the merge request, so i suppose @ca1yps0 will finish what is needed and merge it. https://github.com/tenders-exposed/elvis-ember/pull/538
i am totally offline next week so i hope this is enough for you guys.
@ca1yps0 The format of the red flags has been changed in the data so we had to change it too. We no longer have flags attached to the actors
. They are all attached to each individual tender
. So you will find the indicators (flags) in the new node /networks/{networkID}/nodes/{nodeID}/bids
endpoint, among the other tender details.
For example, for this network node bids
https://api.defense.tenders.exposed/networks/6d88aaa9-922b-4e42-9fe7-67add53f61ce/nodes/322549bc-3bfc-4a9e-9e34-f25c4c72d0d3/bids?limit=10&page=1
I'm getting the following response:
[
{
"isWinning": true,
"bidders": [
{
"name": "Lasi",
"id": "042ba027-2494-4461-91e1-98450956ed99",
"type": "bidder",
"nodeID": "6142530d-d7a9-4df5-8f42-f00dc223fbc4"
}
],
"lot": {
"bidsCount": 1,
"awardDecisionDate": "2020-07-19",
"addressOfImplementation": {},
"tender": {
"id": "PT_199b14d8b4b5e4f773385cb0483bccc8efce9ac0a0bd048fdacb276559faa1f5_1",
"description": "Aquisição de Kit de sobrevivência",
"sources": [
"https://opentender.eu/pt/tender/20e1f721-a44e-4ed2-9e52-29e5475ec55c"
],
"procedureType": "OUTRIGHT_AWARD",
"year": 2020,
"country": "PT",
"isDirective": false,
"indicators": [
{
"id": "3dc668c5-d377-4736-a4ae-5f8e1dbdf408",
"type": "INTEGRITY_CALL_FOR_TENDER_PUBLICATION",
"value": 100
},
{
"id": "865bc23b-26b3-47bf-8540-7ca4104b4ae7",
"type": "INTEGRITY_TAX_HAVEN",
"value": null
},
{
"id": "743ec127-82c7-4f01-8009-8fc5a3a2c2a3",
"type": "INTEGRITY_PROCEDURE_TYPE",
"value": 100
}
],
"finalValue": 3919.3,
"buyers": [
{
"name": "Guarda Nacional Republicana",
"id": "fafbbaaa-5ccc-4938-b499-783695baf247",
"type": "buyer",
"nodeID": "322549bc-3bfc-4a9e-9e34-f25c4c72d0d3"
}
]
}
}
}
]
So for each tender in the table, you can retrieve the flags from the indicators
array of that specific tender:
"indicators": [
{
"id": "3dc668c5-d377-4736-a4ae-5f8e1dbdf408",
"type": "INTEGRITY_CALL_FOR_TENDER_PUBLICATION",
"value": 100
},
{
"id": "865bc23b-26b3-47bf-8540-7ca4104b4ae7",
"type": "INTEGRITY_TAX_HAVEN",
"value": null
},
{
"id": "743ec127-82c7-4f01-8009-8fc5a3a2c2a3",
"type": "INTEGRITY_PROCEDURE_TYPE",
"value": 100
}
]
If the value is 100, it means they got a full score and we're not showing the flag. If the value is 0 it means there is something suspicious and we need to show the flag. If the value is null it means there was insufficient data and we're not showing anything for now.
Here is an example of a network and a node which has value: 0
in most indicators:
This feature depends on https://github.com/tenders-exposed/elvis-ember/issues/539 so make sure you look into that one first 😉
Mapping:
INTEGRITY_CALL_FOR_TENDER_PUBLICATION : No call for tender published INTEGRITY_TAX_HAVEN : Company from a tax haven INTEGRITY_PROCEDURE_TYPE : Non-open tender procedure
If the number of bids is 1, let's underline the number with red
@ca1yps0 Let's also show the thumbnail with the flags when the user clicks on the flag icon itself. I don't think we're gonna attach any more explanations in there since the new names are already quite explanatory by themselves.
In this view:
Add:
[ ] single bid - highlight the number 1
ADD: [ ] non-open procedure [ ] no call for tender published [ ] tax haven
Step 1 OK : @georgiana-b will check if they are in the payload. IF they are: Step 2 : We'd want to integrate them into the table view. @chutko Step 3 : implementation from @ca1yps0