Commit d307baec authored by Rémy Marronnier's avatar Rémy Marronnier

fakeResults wip

parent 4481ac09
......@@ -6,7 +6,7 @@
<v-expansion-panel>
<v-expansion-panel-header>Item</v-expansion-panel-header>
<v-expansion-panel-content v-for="(item,i) in 5" :key="i">
<Contract></Contract>
<Contract v-for="aid in aids" :key="aid"></Contract>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
......@@ -18,6 +18,14 @@ export default {
name: "Eligible",
components: {
Contract
},
data() {
return {
aids: []
};
},
beforeCreate() {
this.aids = this.$store.state.results.eligible;
}
};
</script>
......
......@@ -18,6 +18,9 @@ export default {
name: "Contract",
components: {
AidSummary
},
data() {
return {};
}
};
</script>
......
import { CLARA_API_URL } from "./config";
//import { CLARA_API_URL } from "./config";
import { LoremIpsum } from "lorem-ipsum";
const filters = [
export function contractsService() {
const contracts = [
{
name: "mobilite",
description: "Aides à la mobilité",
icon: "mobilite",
},
{
name: "orientation",
description: "Aides à la définition du projet professionnel, à l'orientation, ou à la reconversion",
icon: "orientation",
},
{
name: "creation-entreprise",
description: "Aides à la création ou reprise d'entreprise",
icon: "creation-entreprise",
},
{
name: "appui-embauche",
description: "Appui à l'embauche",
icon: "appui-embauche",
},
{
name: "contrat-specifique",
description: "Contrats spécifiques",
icon: "contrat-specifique",
},
{
name: "emploi-international",
description: "Emplois internationaux",
icon: "emploi-international",
},
{
name: "formation",
description: "Dispositifs de formation, certification, obtention de diplôme",
icon: "formation",
},
{
name: "aide-regionale",
description: "Aides régionales",
icon: "aide-regionale",
},
{
name: "senior",
description: "Aides pour les séniors",
icon: "senior",
},
{
name: "alternance",
description: "Aides pour l'alternance'",
icon: "alternance",
},
];
return contracts;
}
export function filtersService() {
const filters = [
{
name: "travailler-en-alternance",
description: "Travailler en alternance",
......@@ -53,9 +113,13 @@ const filters = [
description: "Financer une formation, obtenir un diplôme",
value: false
}
];
];
function fakeAidSummaryGenerator(quantity) {
return filters;
}
function fakeAidSummaryGenerator() {
const lorem = new LoremIpsum({
sentencesPerParagraph: {
......@@ -71,36 +135,55 @@ function fakeAidSummaryGenerator(quantity) {
var name = lorem.generateWords(6);
var slug = name.replace(" ", "-");
var short_description = lorem.generateParagraphs(1);
var filters = [];
var min = 1;
var max = 3;
number_of_filters = Math.floor(Math.random() * (+max - +min)) + +min;
let allFilters = filtersService();
let contracts = contractsService();
var contract = contracts[Math.floor(Math.random() * contracts.length)];
let random_filter = Math.floor(Math.random() * allFilters.length);
var filters = [allFilters[random_filter], allFilters[random_filter - 1]];
return {
"name": name,
"slug": slug,
"short_description": short_description,
"contract": contract,
"filters": filters,
}
}
export function aidsService(quantity) {
let aidsArray = new Array(quantity);
for (let i = 0; i < quantity; i++) {
aidsArray[i] = fakeAidSummaryGenerator();
}
return {}
let aidsSortedByContract = [];
aidsArray.forEach(aid => {
aidsSortedByContract[aid.contract].push(aid)
});
}
return aidsSortedByContract;
export function ClaraService(resource, asker) {
switch (resource) {
case filters:
// switch (resource) {
// case filters:
break;
// break;
case eligible:
// case eligible:
break;