Skip to content

Commit

Permalink
Update to v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1194 committed Dec 1, 2022
1 parent 5e555c9 commit 671ec9c
Show file tree
Hide file tree
Showing 32 changed files with 166 additions and 136 deletions.
4 changes: 3 additions & 1 deletion license.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright 2022 © Level Up Marketing & Software Development Services
The MIT License

Copyright 2022 Level Up Marketing & Development Services

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ A small plugin for Frappe that displays a list of current active users.
---

### Table of Contents
<ul>
<li><a href="#requirements">Requirements</a></li>
<li>
<a href="#setup">Setup</a>
<ul>
<li><a href="#install">Install</a></li>
<li><a href="#update">Update</a></li>
<li><a href="#uninstall">Uninstall</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#license">License</a></li>
</ul>
- [Requirements](#requirements)
- [Setup](#setup)
- [Install](#install)
- [Update](#update)
- [Uninstall](#uninstall)
- [Usage](#usage)
- [Contributors](#contributors)
- [Issues](#issues)
- [License](#license)

---

Expand Down Expand Up @@ -144,5 +139,10 @@ bench restart

---

### Issues
If you find bug in the plugin, please create a [bug report](https://github.com/kid1194/frappe-active-users/issues/new?assignees=kid1194&labels=bug&template=bug_report.md&title=%5BBUG%5D) and let us know about it.

---

### License
MIT
This repository has been released under the [MIT License](https://github.com/kid1194/frappe-active-users/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion active_users/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


__version__ = "1.0.5"
2 changes: 1 addition & 1 deletion active_users/active_users/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
2 changes: 1 addition & 1 deletion active_users/active_users/doctype/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"actions": [],
"allow_copy": 1,
"allow_import": 1,
"editable_grid": 1,
"autoname": "hash",
"creation": "2022-04-04 04:04:04.119400",
"description": "Active users role visibility",
"doctype": "DocType",
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
"role"
Expand Down Expand Up @@ -30,5 +35,6 @@
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


from frappe.model.document import Document
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"actions": [],
"allow_copy": 1,
"allow_import": 1,
"editable_grid": 1,
"autoname": "hash",
"creation": "2022-04-04 04:04:04.119400",
"description": "Active users user visibility",
"doctype": "DocType",
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
"user"
Expand Down Expand Up @@ -30,5 +35,6 @@
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


from frappe.model.document import Document


class ActiveUsersHasUser(Document):
pass
pass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"actions": [],
"allow_copy": 1,
"allow_import": 1,
"editable_grid": 1,
"autoname": "hash",
"creation": "2022-04-04 04:04:04.119400",
"description": "Active users visible user type",
"doctype": "DocType",
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
"user_type"
Expand Down Expand Up @@ -30,5 +35,6 @@
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


from frappe.model.document import Document


class ActiveUsersHasUserType(Document):
pass
pass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


from frappe.model.document import Document


class ActiveUsersNotificationReceiver(Document):
pass
pass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@
* Active Users © 2022
* Author: Ameen Ahmed
* Company: Level Up Marketing & Software Development Services
* Licence: Please refer to license.txt
* Licence: Please refer to LICENSE file
*/

frappe.provide('frappe._active_users');

frappe.ui.form.on('Active Users Settings', {
setup: function(frm) {
frm.AU = {
update_messages: [
__('No new version is found'),
__('A new version is available'),
],
update_tags: ['span', 'strong'],
update_classes: ['text-muted', 'text-danger'],
};
},
refresh: function(frm) {
let idx = cint(frm.doc.has_update);
frm.get_field('update_note').$wrapper.html(
cint(frm.doc.has_update)
? '<span class="font-weight-bold text-danger">A new version is available</span>'
: '<span class="text-muted">No new version is found</span>'
'<' + frm.AU.update_tags[idx]
+ 'class="' + frm.AU.update_classes[idx] + '">'
+ frm.AU.update_messages[idx]
+ '</' + frm.AU.update_tags[idx] + '>'
);
},
check_for_update: function(frm) {
if (frappe._active_users._init)
frappe._active_users._init.request(
'check_for_update',
function(ret) {
if (ret) frm.reload_doc();
}
function(ret) { frm.reload_doc(); }
);
},
after_save: function(frm) {
if (frappe._active_users._init)
frappe._active_users._init.update_settings();
}
},
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"actions": [],
"creation": "2022-04-04 04:04:04.119400",
"description": "Active users settings",
"doctype": "DocType",
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
"info_section",
Expand Down Expand Up @@ -50,6 +52,7 @@
"label": "Refresh Interval (Minutes)",
"description": "The number of minutes to wait before refreshing the active users list",
"default": "5",
"non_negative": 1,
"read_only_depends_on": "eval:!doc.enabled"
},
{
Expand Down Expand Up @@ -159,8 +162,8 @@
"fieldname": "has_update",
"fieldtype": "Check",
"label": "Has Update",
"hidden": 1,
"is_virtual": 1
"read_only": 1,
"hidden": 1
},
{
"fieldname": "latest_version",
Expand Down Expand Up @@ -192,25 +195,42 @@
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 1,
"share": 1,
"submit": 1,
"write": 1
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Administrator",
"set_user_permissions": 1,
"share": 1,
"submit": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


import frappe
from frappe.model.document import Document

from active_users.utils import clear_document_cache, compare_versions
from active_users import __version__
from active_users.utils.common import clear_document_cache


class ActiveUsersSettings(Document):
@property
def has_update(self):
return 1 if compare_versions(self.latest_version, __version__) > 0 else 0


def before_save(self):
clear_document_cache(self.doctype)
2 changes: 1 addition & 1 deletion active_users/hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Active Users © 2022
# Author: Ameen Ahmed
# Company: Level Up Marketing & Software Development Services
# Licence: Please refer to license.txt
# Licence: Please refer to LICENSE file


from . import __version__ as app_version
Expand Down
Loading

0 comments on commit 671ec9c

Please sign in to comment.