Skip to content

Commit dd953bb

Browse files
committed
Merge branch 'release/v0.13.0'
2 parents 9b3ea90 + 75e2e88 commit dd953bb

30 files changed

Lines changed: 529 additions & 48 deletions

RELEASE-NOTES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
### v0.13.0
2+
3+
##### Features
4+
5+
- Feature report list view ([#579](https://github.com/Code-Poets/sheetstorm/pull/579))
6+
- Feature update employees list view ([#580](https://github.com/Code-Poets/sheetstorm/pull/580))
7+
- Feature add customizable settings ([#590](https://github.com/Code-Poets/sheetstorm/pull/590))
8+
- Feature add popup messages for create and update users and reports ([#598](https://github.com/Code-Poets/sheetstorm/pull/598))
9+
- Feature create user with random password ([#595](https://github.com/Code-Poets/sheetstorm/pull/595))
10+
11+
##### Bugfixes
12+
13+
- Bugfix application admin has access to django admin panel ([#591](https://github.com/Code-Poets/sheetstorm/pull/591))
14+
- Bugfix account details update by admin ([#593](https://github.com/Code-Poets/sheetstorm/pull/593))
15+
- Bugfix draggable month selector and autocomplete in modal forms ([#596](https://github.com/Code-Poets/sheetstorm/pull/596))
16+
- Bugfix create report form is cleaned on close ([#597](https://github.com/Code-Poets/sheetstorm/pull/597))
17+
- Bugfix employees list view styles ([#599](https://github.com/Code-Poets/sheetstorm/pull/599))
18+
- Bugfix admin not able to create user ([#603](https://github.com/Code-Poets/sheetstorm/pull/603))
19+
20+
21+
122
### v0.12.5
223

324
##### Bugfixes

employees/common/strings.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,12 @@ class ReportValidationStrings(NotCallableMixin, Enum):
122122
class MonthNavigationText(NotCallableMixin, Enum):
123123
SWITCH_MONTH = _("Go")
124124
CURRENT_MONTH = _("Current month")
125+
126+
127+
class SuccessPopUpMessages(Enum):
128+
REPORT_CREATE = _("You have successfully created report for project {project_name}")
129+
REPORT_UPDATE = _("You have successfully updated report from {report_date} for project {project_name}")
130+
REPORT_UPDATE_BY_ADMIN = _(
131+
"You have successfully updated report of user with email {report_author_email} from {report_date} for project {project_name}"
132+
)
133+
REPORT_DELETE = _("You have successfully deleted report")

employees/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Meta:
1212
model = Report
1313

1414
date = factory.Faker("date")
15-
author = factory.SubFactory("users.factories.UserFactory")
15+
author = factory.SubFactory("users.factories.UserFactory", preferences=None)
1616
project = factory.SubFactory("managers.factories.ProjectFactory")
1717
work_hours = factory.LazyFunction(lambda: datetime.timedelta(hours=8))
1818
description = factory.fuzzy.FuzzyText()

employees/static/employees/scripts/expandReportList.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
window.expandReportList = function (element, numberOfReports){
2-
var currentRow = element.parentElement.parentElement
2+
var currentRow = element.parentElement.parentElement;
33
var nextTableRow = currentRow.nextElementSibling;
44

55
var tipIcon = element.getElementsByClassName("rotated-tip")[0];
66
var verticalLineIcon = element.getElementsByClassName("report-list-vl")[0];
77

8-
while (nextTableRow.className !== "tr-next-day-separator"){
8+
let expandReportTitle = "Expand report list"
9+
if (element.getAttribute("title") === expandReportTitle) {
10+
element.setAttribute("title", "Roll report list")
11+
}
12+
else {
13+
element.setAttribute("title", expandReportTitle)
14+
}
15+
16+
while (nextTableRow.className !== "tr-next-day-separator") {
917
nextTableRow.classList.toggle("visible-hidden-report")
1018
nextTableRow = nextTableRow.nextElementSibling;
1119
}

employees/static/employees/scripts/modalsFunctionality.js

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
const reportFormFieldsSelectorsMap = {
2+
"project": "select[name=project]",
3+
"taskActivity": "select[name=task_activity]",
4+
"workHours": "input[name=work_hours]",
5+
"description": "textarea[name=description]",
6+
};
7+
18
$(function() {
29
$(".bs-modal").each(function () {
310
$(this).modalForm({
@@ -26,8 +33,44 @@ $(function() {
2633
document.activeElement.blur();
2734
});
2835

29-
$("#modal").on('shown.bs.modal', function() {
36+
$("#modal").on('show.bs.modal', function () {
37+
let reportForm = $(this).find("form")
38+
if (reportForm.attr("name") === "create-report-form") {
39+
getFieldsValuesFromLocalStorage(reportForm);
40+
}
41+
42+
}).on('shown.bs.modal', function() {
3043
$("body").removeClass("modal-open");
3144
$(".custom-modal").removeClass("modal");
45+
46+
}).on('hide.bs.modal', function() {
47+
let reportForm = $(this).find("form")
48+
if (reportForm.attr("name") === "create-report-form") {
49+
storeReportFormValuesToLocalStorage(reportForm);
50+
}
3251
});
52+
53+
resetLocalStorage();
3354
});
55+
56+
function storeReportFormValuesToLocalStorage(form) {
57+
var createReportFields = {}
58+
for (let[formField, formFieldSelector] of Object.entries(reportFormFieldsSelectorsMap)) {
59+
createReportFields[formField] = form.find(formFieldSelector).val()
60+
}
61+
localStorage.setItem("createReportFields", JSON.stringify(createReportFields));
62+
}
63+
64+
function getFieldsValuesFromLocalStorage(form) {
65+
if (localStorage.getItem("createReportFields") !== null) {
66+
var storedCreateReportFields = JSON.parse(localStorage.getItem("createReportFields"));
67+
68+
for (let[formField, formFieldSelector] of Object.entries(reportFormFieldsSelectorsMap)) {
69+
form.find(formFieldSelector).val(storedCreateReportFields[formField]);
70+
}
71+
}
72+
}
73+
74+
function resetLocalStorage() {
75+
localStorage.removeItem("createReportFields");
76+
}

employees/static/employees/style.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,32 @@ table.table {
417417
margin: 0;
418418
}
419419

420+
.alert-custom {
421+
background-color: #d6e7f5;
422+
color: #2768a5;
423+
}
424+
425+
.alert-popup-top {
426+
position: absolute;
427+
z-index: 1000;
428+
width: 78%;
429+
margin-top: -38px;
430+
}
431+
420432
@media (max-width: 995px) {
421433
.export-csv, .export-xlsx {
422434
text-align: center;
423435
}
424436
}
437+
438+
@media (max-width: 890px) {
439+
.alert-popup-top {
440+
position: relative;
441+
z-index: 0;
442+
width: auto;
443+
margin-top: auto;
444+
}
445+
}
425446
@media (max-width: 769px) {
426447
.add-report-form-join-project-field {
427448
margin-left: 50px;

employees/templates/employees/author_report_list.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
{{ UI_text.RETURN_BUTTON_MESSAGE.value }}
2828
</a>
2929
<div class="container main-white-container margin-top-space">
30+
{% include "common/popup_message.html" %}
3031
{% include "employees/partial/modal_forms/modal_base.html" %}
3132
{% include "employees/partial/month_navigation/report_list_navigation_bar.html" %}
3233
{% include "employees/partial/display_reports/display_user_reports.html" with user=object reports=object.get_reports_created %}
@@ -46,4 +47,9 @@
4647
integrity="{% staticinline 'employees/scripts/modalsFunctionality.js' encode="sri" %}"
4748
crossorigin="anonymous">
4849
</script>
50+
<script
51+
src="{% static 'users/scripts/hidePopupMessage.js' %}"
52+
integrity="{% staticinline 'users/scripts/hidePopupMessage.js' encode='sri' %}"
53+
crossorigin="anonymous">
54+
</script>
4955
{% endblock %}

employees/templates/employees/partial/modal_forms/create_and_update_report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load crispy_forms_tags %}
22
{% load static %}
33

4-
<form method="post" action="" data-task-activities-url="{% url 'ajax-load-task-activities' %}" id="reportForm">
4+
<form method="post" action="" data-task-activities-url="{% url 'ajax-load-task-activities' %}" id="reportForm" {% if is_create_report_form %} name="create-report-form" {% else %} name="update-report-form" {% endif %}>
55
{% csrf_token %}
66
<div class="modal-header margin-top-space">
77
<img class="add-report-form-header-icon modal-title" alt="report icon" src="{% static 'users/images/grey/ico-05.png' %}"/>

employees/templates/employees/project_report_list.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
{% block content %}
2525
<div class="container main-white-container margin-top-space">
26+
{% include "common/popup_message.html" %}
2627
{% include "employees/partial/modal_forms/modal_base.html" %}
2728
{% include "employees/partial/month_navigation/report_list_navigation_bar.html" %}
2829
<h1>
@@ -53,4 +54,9 @@ <h1>
5354
integrity="{% staticinline 'employees/scripts/modalsFunctionality.js' encode="sri" %}"
5455
crossorigin="anonymous">
5556
</script>
57+
<script
58+
src="{% static 'users/scripts/hidePopupMessage.js' %}"
59+
integrity="{% staticinline 'users/scripts/hidePopupMessage.js' encode='sri' %}"
60+
crossorigin="anonymous">
61+
</script>
5662
{% endblock %}

employees/templates/employees/report_list.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
{% block content %}
3232
<div class="container main-white-container margin-top-space">
33+
{% include "common/popup_message.html" %}
3334
{% include "employees/partial/modal_forms/modal_base.html" %}
3435
{% include "employees/partial/month_navigation/report_list_navigation_bar.html" %}
3536
{% include "employees/partial/display_reports/display_user_reports.html" with user=request.user reports=object_list %}
@@ -56,4 +57,9 @@
5657
integrity="{% staticinline 'employees/scripts/modalsFunctionality.js' encode="sri" %}"
5758
crossorigin="anonymous">
5859
</script>
60+
<script
61+
src="{% static 'users/scripts/hidePopupMessage.js' %}"
62+
integrity="{% staticinline 'users/scripts/hidePopupMessage.js' encode='sri' %}"
63+
crossorigin="anonymous">
64+
</script>
5965
{% endblock %}

0 commit comments

Comments
 (0)