Skip to content

Commit

Permalink
Additional UI bugfixes (#124)
Browse files Browse the repository at this point in the history
Co-authored-by: Viktor Sandström <v.sandstrom@icloud.com>
  • Loading branch information
akochari and sandstromviktor authored Jan 17, 2024
1 parent 0a0f24a commit c12d787
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def update_resource(self, request, appinstance, current_release_name):

@permission_required_or_403("can_view_project", (Project, "slug", "project"))
def create_releasename(request, user, project, app_slug):
pattern = re.compile("^[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$")
pattern = re.compile("^[a-z0-9][a-z0-9-]+[a-z0-9]$")
available = "invalid"
system_subdomains = ["keycloak", "grafana", "prometheus", "studio"]
if pattern.match(request.POST.get("rn")):
Expand Down
2 changes: 1 addition & 1 deletion projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def post(self, request, *args, **kwargs):
success = True

template_id = request.POST.get("template_id")
name = request.POST.get("name", "default")
name = request.POST.get("name", "default")[:200]
description = request.POST.get("description", "")

# Try to create database project object.
Expand Down
2 changes: 1 addition & 1 deletion templates/apps/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ <h6> {{ vals.meta_title }}</h6>
}
$('#rn').addClass('is-invalid');
if (data.available == "invalid") {
$('#subdomain-invalid').text("Subdomain is invalid. Please choose another.");
$('#subdomain-invalid').text("Subdomain is invalid. Only lowercase English letters (a-z), numbers (0-9) and hyphens (-) are allowed; hyphen cannot be the first or last character.");
} else {
$('#subdomain-invalid').text("Subdomain already exists. Please choose another.");
}
Expand Down
12 changes: 7 additions & 5 deletions templates/apps/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ <h1 class="h3 mb-3">Settings {{ app.name }}</h1>
<div class="row">
<div class="col-12 mt-2 mb-4">
{% if app.slug == 'customapp' %}
This form allows you to host an app that fulfills certain requirements on SciLifeLab Serve (the app itself can be built on any framework). Please read our <a href="/docs/application-hosting/other/">documentation page on custom apps</a> for the list of requirements and step-by-step instructions on deployment.
<p>This form allows you to host an app that fulfills certain requirements on SciLifeLab Serve (the app itself can be built on any framework). Please read our <a href="/docs/application-hosting/other/">documentation page on custom apps</a> for the list of requirements and step-by-step instructions on deployment.</p>
{% elif app.slug == 'dashapp' %}
This form allows you to host a Dash app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/dash/">documentation page on Dash apps</a> for step-by-step instructions.
<p>This form allows you to host a Dash app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/dash/">documentation page on Dash apps</a> for step-by-step instructions.</p>
{% elif app.slug in 'shinyapp,shinyproxyapp' %}
This form allows you to host a Shiny app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/shiny/">documentation page on Shiny apps</a> for step-by-step instructions.
<p>This form allows you to host a Shiny app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/shiny/">documentation page on Shiny apps</a> for step-by-step instructions.</p>
{% endif %}
{% if app.slug in 'jupyter-lab,rstudio,vscode' %}
<p>Note that <b>after 7 days the created {{ app.name }} instance will be deleted</b>, only the files saved in 'project-vol' will stay available.</p>
Expand Down Expand Up @@ -332,13 +332,14 @@ <h6> {{ vals.meta_title }}</h6>
</div>
</div>

{% if app.category.pk == 'serve' %}
<div class="row pt-3">

<div class="col-12 col-xl-6">

<div class="card shadow border-0 p-3">
<h3 class="card-title">Tags</h3>

<p>Add relevant keywords to help users find your app in our catalog of public apps.</p>

<form method="POST" action="{% url 'apps:add_tag' request.user project.slug appinstance.pk %}">

Expand Down Expand Up @@ -382,6 +383,7 @@ <h3 class="card-title">Tags</h3>
</div>
</div>
</div>
{% endif %}
</div>

<script>
Expand Down Expand Up @@ -486,7 +488,7 @@ <h3 class="card-title">Tags</h3>
}
$('#rn').addClass('is-invalid');
if (data.available == "invalid") {
$('#subdomain-invalid').text("Subdomain is invalid. Please choose another.");
$('#subdomain-invalid').text("Subdomain is invalid. Only lowercase English letters (a-z), numbers (0-9) and hyphens (-) are allowed; hyphen cannot be the first or last character.");
} else {
$('#subdomain-invalid').text("Subdomain already exists. Please choose another.");
}
Expand Down
2 changes: 1 addition & 1 deletion templates/projects/project_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3>New project</h3>

<div class="row pb-3">
<div class="col-12">
<input type="text" class="form-control" placeholder="Name" id="name" name="name" required>
<input type="text" class="form-control" placeholder="Name" id="name" name="name" maxlength="200" required>
</div>
{% if form.name.errors %}
<div class="pt-1">
Expand Down

0 comments on commit c12d787

Please sign in to comment.