Improve plugin generator

This commit is contained in:
Pierre Burgy 2017-07-01 16:29:35 +02:00
parent 75470ef88c
commit dbd4cd3e21
4 changed files with 150 additions and 2 deletions

View File

@ -21,8 +21,9 @@ module.exports = scope => {
'version': '0.0.0',
'description': 'This is the description of the plugin.',
'strapi': {
'name': scope.name,
'icon': 'ion-document-text'
'name': scope.id,
'icon': 'ion-document-text',
'description': `Description of ${scope.id} plugin.`
},
'scripts': {
'analyze:clean': 'node_modules/strapi-helper-plugin/node_modules/rimraf/bin.js stats.json',

View File

@ -0,0 +1,145 @@
{
"admin": {
"schema": {
"practitioner": {
"label": "Praticien",
"orm": "bookshelf",
"labelPlural": "Praticiens",
"fields": {
"id": {
"label": "Id",
"type": "string"
},
"title": {
"label": "Titre",
"type": "string"
},
"address_1": {
"label": "Adresse ligne 1",
"type": "string"
},
"address_2": {
"label": "Adresse ligne 2",
"type": "string"
},
"url": {
"label": "URL",
"description": "URL de la fiche du praticien (Doctolib...)",
"type": "url"
},
"reviews": {
"label": "Avis",
"description": "Cette valeur doit être un nombre compris entre x et x.",
"type": "integer"
},
"public_car_park": {
"label": "Parking public",
"description": "",
"type": "boolean"
},
"private_car_park": {
"label": "Parking privé",
"description": "",
"type": "boolean"
},
"transport_facility": {
"label": "Facilité de transport",
"description": "Facilité de transport à moins de 500m.",
"type": "boolean"
}
},
"relations": {
"speciality": {
"columnName": "speciality_id",
"model": "speciality",
"attribute": "speciality_id",
"label": "Spécialité",
"description": "Écrivez pour recherchez",
"displayedAttribute": "name"
},
"locality": {
"columnName": "locality_id",
"model": "locality",
"attribute": "locality_id",
"label": "Locality",
"description": "Écrivez pour recherchez",
"displayedAttribute": "name"
}
},
"list": [
"id",
"title"
]
},
"speciality": {
"label": "Spécialité",
"orm": "bookshelf",
"displayed": false,
"labelPlural": "Spécialités",
"fields": {
"id": {
"label": "Id",
"type": "string"
},
"name": {
"label": "Name",
"type": "string"
}
},
"list": [
"id",
"name"
]
},
"user": {
"label": "Utilisateur",
"orm": "bookshelf",
"labelPlural": "Utilisateurs",
"fields": {
"id": {
"label": "Id",
"type": "string"
},
"email": {
"label": "Nom d'utilisateur",
"type": "string"
},
"is_admin": {
"label": "Administrateur",
"type": "boolean"
},
"is_blocked": {
"label": "Bloqué",
"type": "boolean"
}
},
"list": [
"id",
"email",
"is_admin",
"is_blocked"
]
},
"locality": {
"label": "Localité",
"orm": "bookshelf",
"displayed": false,
"labelPlural": "Localités",
"fields": {
"id": {
"label": "Id",
"type": "string"
},
"name": {
"label": "Name",
"type": "string"
}
},
"list": [
"id",
"name"
]
}
}
}
}