Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ import {notifier, notifierXHR} from '../../../plugins/utils/notifiers-utils';
import Evidence from '../../../models/business-models/evidence';
import * as businessModels from '../../../models/business-models';
import {getAjaxErrorInfo} from '../../../plugins/utils/errors-utils';

import {backendGdriveClient} from '../../../plugins/ggrc-gapi-client';
import {ggrcAjax} from '../../../plugins/ajax_extensions';
/**
* Assessment Specific Info Pane View Component
*/
Expand Down Expand Up @@ -366,6 +367,16 @@ export default canComponent.extend({
assessment.attr(path, [related]);
}
},
onClick() {
backendGdriveClient.withAuth(() => ggrcAjax({
type: 'POST',
headers: {
'Content-Type': 'application/json',
},
url: '/api/testendpoint',
data: '{data: "HELLO MAXIM. I AM GGRC!"}',
}));
},
addRelatedItem: function (event, type) {
let self = this;
let assessment = this.attr('instance');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
instance:from="instance">
<div class="info-pane__section-title">Assessment Procedure</div>
</assessment-inline-item>
<button on:el:click="onClick()">#CLICKME</button>
</div>
{{/if}}
{{#if instance.issueCreated}}
Expand Down
1 change: 1 addition & 0 deletions src/ggrc/converters/handlers/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def set_obj_attr(self):
is_status_changing = self.row_converter.obj.status in \
Statusable.DONE_STATES
if is_updated and is_status_changing and not self.row_converter.is_new:
self.obj.status = "In Progress"
self.add_warning(errors.STATE_WILL_BE_IGNORED,
column_name=self.display_name)

Expand Down
2 changes: 2 additions & 0 deletions src/ggrc/converters/handlers/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ def parse_item(self):
if self.value_explicitly_empty(self.raw_value):
if not self.mandatory:
self.set_empty = True
statusch = self.row_converter.attrs.get("Status")
statusch.ignore = True
return None
return self._missed_mandatory_person()

Expand Down
47 changes: 46 additions & 1 deletion src/ggrc/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import datetime
import json
import logging

import time
import sqlalchemy
import flask
from werkzeug import exceptions
Expand Down Expand Up @@ -1174,6 +1174,51 @@ def generate_wf_tasks_notifs():
[('Content-Type', 'text/html')])))



@app.route(
"/_background_tasks/_testep", methods=["POST"]
)
@background_task.queued_task
def test_staff(task):
logger.warning("111")
time.sleep(20)
flask.session['credentials'] = task.parameters["cred"]

from ggrc.gdrive.file_actions import process_gdrive_file
logger.warning("inside")

response = process_gdrive_file("1zjOApUXO5MkIiPPydkZ-BNVILjwBygcBeh_5259Syhg",
"1jDsATaOSVIUIEUqChNk3wJnWAN1vsC73",
is_uploaded=False)
logger.warning(response)
time.sleep(1000)


@app.route("/api/testendpoint", methods=["POST"])
@login.login_required
def make_test_bg_task():
"""testbgtask"""
from ggrc.gdrive import get_http_auth
from ggrc import gdrive

try:
get_http_auth()
except gdrive.GdriveUnauthorized:
res = app.make_response(("auth", 401, [("Content-Type", "text/html")]))
return res

bg_task = background_task.create_task(
name="test_staff",
url=flask.url_for(test_staff.__name__),
queued_callback=lambda _: None,
parameters={"cred": flask.session['credentials'], "state": flask.session['state']}
)
db.session.commit()
return bg_task.make_response(
app.make_response(("scheduled %s" % bg_task.name, 200,
[('Content-Type', 'text/html')])))


class UnmapObjectsView(flask.views.MethodView):
"""View for unmaping objects by deletion of relationships."""

Expand Down