fix: Update user login activity diagram to include successful login step and stop flow

feat: Refactor user use case diagram for clarity and add missing user interactions
fix: Adjust z-index values in CSS for proper element stacking
fix: Enable hidden widget for partner and department fields in AddSchema
fix: Clean up whitespace and formatting in DeTable class
feat: Enhance TableWidget to include additional DataTables plugins
1 parent 18629401
...@@ -11,10 +11,11 @@ partition "System" { ...@@ -11,10 +11,11 @@ partition "System" {
if (Credentials are valid?) then (yes) if (Credentials are valid?) then (yes)
:Log in successful; :Log in successful;
:Redirect to dashboard; :Redirect to dashboard;
stop
else (no) else (no)
:Display error message; :Display error message;
endif endif
stop
} }
@enduml @enduml
@startuml uc_user @startuml uc_users
left to right direction left to right direction
actor User actor User
rectangle "User Use Case" { rectangle "User Use Case" {
User -- (Register) (Home) as home
User -- (Login) (Password Reset) as passwordReset
User -- (Request Password Reset) (Change Password) as changePassword
User -- (Update Profile) (Login) as login
User -- (Logout) (Logout) as logout
User -- (Change Password) (Update Profile) as updateProfile
(Update Profile)..> (Login):include (Register) as register
(Logout)..> (Login):include
(Change Password)..> (Login):include
} }
passwordReset ..> changePassword : extend
changePassword ..> login:include
User -- passwordReset
User -- changePassword
User -- register
User -- login
User -- updateProfile
User -- logout
User -- home
@enduml @enduml
...@@ -439,7 +439,7 @@ div.col-md-6 { ...@@ -439,7 +439,7 @@ div.col-md-6 {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index:2; z-index:auto;
} }
.twitter-typeahead .tt-query, .twitter-typeahead .tt-hint { .twitter-typeahead .tt-query, .twitter-typeahead .tt-hint {
...@@ -450,7 +450,7 @@ div.col-md-6 { ...@@ -450,7 +450,7 @@ div.col-md-6 {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index:2; z-index:auto;
} }
.table-responsive { .table-responsive {
......
...@@ -29,7 +29,7 @@ class AddSchema(colander.Schema): ...@@ -29,7 +29,7 @@ class AddSchema(colander.Schema):
partner_id = colander.SchemaNode( partner_id = colander.SchemaNode(
colander.Integer(), colander.Integer(),
oid="partner_id", oid="partner_id",
# widget=widget.HiddenWidget(), widget=widget.HiddenWidget(),
) )
nama = colander.SchemaNode( nama = colander.SchemaNode(
colander.String(), colander.String(),
...@@ -38,7 +38,7 @@ class AddSchema(colander.Schema): ...@@ -38,7 +38,7 @@ class AddSchema(colander.Schema):
departemen_id = colander.SchemaNode( departemen_id = colander.SchemaNode(
colander.Integer(), colander.Integer(),
oid="departemen_id", oid="departemen_id",
# widget=widget.HiddenWidget(), widget=widget.HiddenWidget(),
) )
departemen = colander.SchemaNode( departemen = colander.SchemaNode(
colander.String(), colander.String(),
......
...@@ -95,6 +95,7 @@ class DeTable(field.Field): ...@@ -95,6 +95,7 @@ class DeTable(field.Field):
css_class = "deform" # bw compat only; pass a widget to override css_class = "deform" # bw compat only; pass a widget to override
def __init__( def __init__(
self, self,
schema, schema,
...@@ -121,7 +122,7 @@ class DeTable(field.Field): ...@@ -121,7 +122,7 @@ class DeTable(field.Field):
scroll_y=False, scroll_y=False,
**kw **kw
): ):
kw.pop("parent", None) kw.pop("parent", None)
super().__init__(schema, **kw) super().__init__(schema, **kw)
self.request = kw.get("request") self.request = kw.get("request")
self.rows = kw.get("rows") self.rows = kw.get("rows")
...@@ -161,8 +162,8 @@ class DeTable(field.Field): ...@@ -161,8 +162,8 @@ class DeTable(field.Field):
"view": "{window.location = o%sUri+'/'+m%sID+'/view%s';}" % ( "view": "{window.location = o%sUri+'/'+m%sID+'/view%s';}" % (
tableid, tableid, params), tableid, tableid, params),
"delete": not self.allow_check and "{window.location = o%sUri+'/'+m%sID+'/delete%s';}" % ( "delete": not self.allow_check and "{window.location = o%sUri+'/'+m%sID+'/delete%s';}" % (
tableid, tableid, params) or \ tableid, tableid, params) or
"""{ """{
var cnt = m%sCheckList.length; var cnt = m%sCheckList.length;
if (cnt > 0){ if (cnt > 0){
if (confirm('Menghapus '+cnt+' data, pastikan data yang dipilih sudah benar!')){ if (confirm('Menghapus '+cnt+' data, pastikan data yang dipilih sudah benar!')){
...@@ -204,12 +205,12 @@ class DeTable(field.Field): ...@@ -204,12 +205,12 @@ class DeTable(field.Field):
""") """)
if dict_buttons.get(button.name): if dict_buttons.get(button.name):
_scripts.append(f'$("#{tableid + button.name}").click(function ()' + _scripts.append(f'$("#{tableid + button.name}").click(function ()' +
dict_buttons[button.name] + ');') dict_buttons[button.name] + ');')
else: else:
url = "{window.location = o%sUri+'/" % tableid url = "{window.location = o%sUri+'/" % tableid
url += f"{button.name}';"+"}" url += f"{button.name}';"+"}"
_scripts.append(f'$("#{tableid + button.name}").click(function ()' + _scripts.append(f'$("#{tableid + button.name}").click(function ()' +
url + url +
');') ');')
if html_buttons: if html_buttons:
...@@ -389,7 +390,8 @@ class DeTable(field.Field): ...@@ -389,7 +390,8 @@ class DeTable(field.Field):
def widget_select(self, column): def widget_select(self, column):
d = {} d = {}
d["wg_select"] = True d["wg_select"] = True
d["wg_select_val"] = type(column.widget.values) == list and dict(column.widget.values) or column.widget.values d["wg_select_val"] = type(column.widget.values) == list and dict(
column.widget.values) or column.widget.values
if column.widget.values: if column.widget.values:
for val in column.widget.values: for val in column.widget.values:
if hasattr(column, f"color_{val}"): if hasattr(column, f"color_{val}"):
......
...@@ -37,4 +37,10 @@ class TableWidget(MappingWidget): ...@@ -37,4 +37,10 @@ class TableWidget(MappingWidget):
template = "detable.pt" template = "detable.pt"
readonly_template = "detable.pt" readonly_template = "detable.pt"
requirements = (("deform", None), requirements = (("deform", None),
{"js": "opensipkd.base:static/v3/js/plugin/datatables/jquery.dataTables.min.js"}) {"js": ["opensipkd.base:static/v3/js/plugin/datatables/jquery.dataTables.min.js",
"opensipkd.base:static/v3/js/plugin/datatables/dataTables.colVis.min.js",
# "opensipkd.base:static/v3/js/plugin/datatables/dataTables.tableTools.min.js",
"opensipkd.base:static/v3/js/plugin/datatables/dataTables.bootstrap.min.js",
"opensipkd.base:static/v3/js/plugin/datatable-responsive/datatables.responsive.min.js",
]
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!