Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/results permissions #62

Open
wants to merge 3 commits into
base: beta-1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions slots/ui_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ class Slot: # pylint: disable=E1101,R0903
"permissions": ["performance.ui_performance_results"]
})
def content(self, context, slot, payload):
log.info('slot: [%s] || payload: [%s]', slot, payload)
log.info('payload request args: [%s]', payload.request.args)
result_id = payload.request.args.get('result_id')
if result_id:
# test_data = context.rpc_manager.call.ui_results_or_404(result_id)
test_data = self.results_or_404(result_id)
if not self.context.rpc_manager.call.admin_check_user_in_project(
project_id=test_data['project_id'],
user_id=payload.auth.id
):
return theme.access_denied_part

with context.app.app_context():
return self.descriptor.render_template(
Expand All @@ -26,8 +29,6 @@ def content(self, context, slot, payload):

@web.slot('ui_results_scripts')
def scripts(self, context, slot, payload):
from pylon.core.tools import log
log.info('slot: [%s], payload: %s', slot, payload)
result_id = payload.request.args.get('result_id')
source_data = {}
if result_id:
Expand All @@ -42,8 +43,6 @@ def scripts(self, context, slot, payload):

@web.slot('ui_results_styles')
def styles(self, context, slot, payload):
from pylon.core.tools import log
log.info('slot: [%s], payload: %s', slot, payload)
with context.app.app_context():
return self.descriptor.render_template(
'results/styles.html',
Expand Down
13 changes: 8 additions & 5 deletions static/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,17 @@ const UiTestCreateModal = {

<div class="form-group mt-3">
<div class="form-group">
<p class="font-h5 font-semibold">Entrypoint</p>
<p class="font-h6 font-weight-400">Script name</p>
<input type="text" class="form-control form-control-alternative mt-2"
<label class="d-block">
<p class="font-h5 font-semibold">Entrypoint</p>
<p class="font-h6 font-weight-400">Script name</p>
<input type="text" class="form-control form-control-alternative mt-2"
placeholder="sitespeed.js"
name="ui_entrypoint"
v-model='entrypoint'
:class="{ 'is-invalid': errors?.entrypoint }"
>
<div class="invalid-feedback">[[ get_error_msg('entrypoint') ]]</div>
>
<div class="invalid-feedback">[[ get_error_msg('entrypoint') ]]</div>
</label>
</div>
</div>
<div class="form-group mt-3">
Expand Down