Add support for tailbone-integration project generator

This commit is contained in:
Lance Edgar 2022-01-29 14:42:52 -06:00
parent 999bb29499
commit 8a08b3f7c7
2 changed files with 65 additions and 0 deletions

View file

@ -10,6 +10,7 @@
<b-select v-model="projectType"> <b-select v-model="projectType">
<option value="rattail">rattail</option> <option value="rattail">rattail</option>
<option value="rattail_integration">rattail-integration</option> <option value="rattail_integration">rattail-integration</option>
<option value="tailbone_integration">tailbone-integration</option>
## <option value="byjove">byjove</option> ## <option value="byjove">byjove</option>
<option value="fabric">fabric</option> <option value="fabric">fabric</option>
</b-select> </b-select>
@ -249,6 +250,46 @@
${h.end_form()} ${h.end_form()}
</div> </div>
<div v-if="projectType == 'tailbone_integration'">
${h.form(request.current_route_url(), ref='tailbone_integrationForm')}
${h.csrf_token(request)}
${h.hidden('project_type', value='tailbone_integration')}
<br />
<div class="card">
<header class="card-header">
<p class="card-header-title">Naming</p>
</header>
<div class="card-content">
<div class="content">
<b-field horizontal label="Integration Name"
message="Name of the system to be integrated">
<b-input name="integration_name" v-model="tailbone_integration.integration_name"></b-input>
</b-field>
<b-field horizontal label="Integration URL"
message="Reference URL for the system to be integrated">
<b-input name="integration_url" v-model="tailbone_integration.integration_url"></b-input>
</b-field>
<b-field horizontal label="Package Name for PyPI"
message="Also will be used as slug, e.g. for folder name">
<b-input name="python_project_name" v-model="tailbone_integration.python_project_name"></b-input>
</b-field>
${h.hidden('slug', **{'v-model': 'tailbone_integration.python_project_name'})}
<b-field horizontal label="Package Name in Python"
:message="`For example, ~/src/${'$'}{tailbone_integration.python_project_name}/${'$'}{tailbone_integration.python_package_name}/__init__.py`">
<b-input name="python_name" v-model="tailbone_integration.python_package_name"></b-input>
</b-field>
</div>
</div>
</div>
${h.end_form()}
</div>
<div v-if="projectType == 'byjove'"> <div v-if="projectType == 'byjove'">
${h.form(request.current_route_url(), ref='byjoveForm')} ${h.form(request.current_route_url(), ref='byjoveForm')}
${h.csrf_token(request)} ${h.csrf_token(request)}
@ -387,6 +428,13 @@
extends_db: true, extends_db: true,
} }
ThisPageData.tailbone_integration = {
integration_name: "Foo",
integration_url: "https://www.example.com/",
python_project_name: "tailbone-foo",
python_package_name: "tailbone_foo",
}
ThisPageData.byjove = { ThisPageData.byjove = {
name: "Okay-Then-Mobile", name: "Okay-Then-Mobile",
slug: "okay-then-mobile", slug: "okay-then-mobile",

View file

@ -100,6 +100,21 @@ class GenerateRattailIntegrationProject(colander.MappingSchema):
extends_db = colander.SchemaNode(colander.Boolean()) extends_db = colander.SchemaNode(colander.Boolean())
class GenerateTailboneIntegrationProject(colander.MappingSchema):
"""
Schema to generate new tailbone-integration project
"""
integration_name = colander.SchemaNode(colander.String())
integration_url = colander.SchemaNode(colander.String())
slug = colander.SchemaNode(colander.String())
python_project_name = colander.SchemaNode(colander.String())
python_name = colander.SchemaNode(colander.String())
class GenerateByjoveProject(colander.MappingSchema): class GenerateByjoveProject(colander.MappingSchema):
""" """
Schema for generating a new 'byjove' project Schema for generating a new 'byjove' project
@ -162,6 +177,8 @@ class GenerateProjectView(View):
schema = GenerateFabricProject schema = GenerateFabricProject
elif project_type == 'rattail_integration': elif project_type == 'rattail_integration':
schema = GenerateRattailIntegrationProject schema = GenerateRattailIntegrationProject
elif project_type == 'tailbone_integration':
schema = GenerateTailboneIntegrationProject
else: else:
schema = GenerateProject schema = GenerateProject
form = forms.Form(schema=schema(), request=self.request, form = forms.Form(schema=schema(), request=self.request,