Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
e-epal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
7ea9ab97
Commit
7ea9ab97
authored
Aug 07, 2017
by
Χάρης Παπαδόπουλος
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-dview-response' into 'develop'
Distinguish empty set from errors See merge request !256
parents
143dc6c9
2c501c64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
12 deletions
+38
-12
drupal/modules/epal/src/Controller/DirectorView.php
drupal/modules/epal/src/Controller/DirectorView.php
+6
-7
source/components/director/director-view.ts
source/components/director/director-view.ts
+32
-5
No files found.
drupal/modules/epal/src/Controller/DirectorView.php
View file @
7ea9ab97
...
...
@@ -170,22 +170,21 @@ class DirectorView extends ControllerBase
);
}
}
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
'Students not found!'
),
],
Response
::
HTTP_FORBIDDEN
);
return
$this
->
respondWithStatus
([
'message'
=>
t
(
'Students not found!'
),
],
Response
::
HTTP_NOT_FOUND
);
}
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
'User not found!'
),
'message'
=>
t
(
'User not found!'
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
catch
(
\
Exception
$e
)
{
$this
->
logger
->
warning
(
$e
->
getMessage
());
return
$this
->
respondWithStatus
([
'message'
=>
t
(
'Unexpected Error'
),
'message'
=>
t
(
'Unexpected Error'
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
...
...
source/components/director/director-view.ts
View file @
7ea9ab97
...
...
@@ -235,9 +235,27 @@ import { HelperDataService } from "../../services/helper-data-service";
</div>
</div>
<div id="errorselection" (onHidden)="onHidden('#errorselection')" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<h3 class="modal-title pull-left"><i class="fa fa-ban"></i> Προέκυψε σφάλμα</h3>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#errorselection')">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<p>Προέκυψε σφάλμα κατά τη διαδικασία άντλησης των στοιχείων δήλωσης προτίμησης στο συγκεκριμένο τμήμα του σχολείου σας.</p>
<p>Παρακαλώ προσπαθείστε ξανά αργότερα.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Κλείσιμο</button>
</div>
</div>
</div>
</div>
<div id="emptyselection" (onHidden)="onHidden('#emptyselection')"
class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div id="emptyselection" (onHidden)="onHidden('#emptyselection')" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-danger">
...
...
@@ -255,7 +273,7 @@ import { HelperDataService } from "../../services/helper-data-service";
</div>
</div>
</div>
`
`
})
@
Injectable
()
export
default
class
DirectorClassCapacity
implements
OnInit
,
OnDestroy
{
...
...
@@ -326,6 +344,7 @@ import { HelperDataService } from "../../services/helper-data-service";
(
<
any
>
$
(
"
#checksaved
"
)).
appendTo
(
"
body
"
);
(
<
any
>
$
(
"
#dangermodal
"
)).
appendTo
(
"
body
"
);
(
<
any
>
$
(
"
#emptyselection
"
)).
appendTo
(
"
body
"
);
(
<
any
>
$
(
"
#errorselection
"
)).
appendTo
(
"
body
"
);
(
<
any
>
$
(
"
#applicationDeleteConfirm
"
)).
appendTo
(
"
body
"
);
(
<
any
>
$
(
"
#applicationDeleteError
"
)).
appendTo
(
"
body
"
);
this
.
showLoader
.
next
(
true
);
...
...
@@ -353,7 +372,11 @@ import { HelperDataService } from "../../services/helper-data-service";
this
.
StudentInfo$
.
next
([{}]);
console
.
log
(
"
Error Getting Students
"
);
this
.
showLoader
.
next
(
false
);
this
.
showModal
(
"
#emptyselection
"
);
if
(
error
.
status
===
404
)
{
this
.
showModal
(
"
#emptyselection
"
);
}
else
{
this
.
showModal
(
"
#errorselection
"
);
}
});
}
...
...
@@ -449,7 +472,11 @@ import { HelperDataService } from "../../services/helper-data-service";
this
.
StudentInfo$
.
next
([{}]);
console
.
log
(
"
Error Getting Students
"
);
this
.
showLoader
.
next
(
false
);
this
.
showModal
(
"
#emptyselection
"
);
if
(
error
.
status
===
404
)
{
this
.
showModal
(
"
#emptyselection
"
);
}
else
{
this
.
showModal
(
"
#errorselection
"
);
}
});
}).
catch
(
err
=>
{
this
.
showErrorModal
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment