Skip to content

Commit

Permalink
Stuff from today
Browse files Browse the repository at this point in the history
- Update viur-core 3.7.0.dev3
- PhoneBone
- subskel tests
- TodoAddForm reset for presentation and profit
- ActionSkel tests
  • Loading branch information
phorward committed Sep 19, 2024
1 parent dfe2919 commit 43ddca2
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[packages]
viur-core = "==3.7.0.dev2"
viur-core = "==3.7.0.dev3"

[dev-packages]
viur-cli = "~=2.0"
Expand Down
78 changes: 39 additions & 39 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 27 additions & 16 deletions deploy/modules/todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ class Todo(List):
"firstname",
"subject",
),
"actions":["assign"],
"customActions":{
"actions": ["assign"],
"customActions": {
"assign": {
"name": "Zuweisen", # button name
"access": ["todo-edit", "root"], # wer darf triggern
"icon": "person-plus-fill", # button icon
"variant":"success", # button color
"outline":True, # button outline style
"action": "action",
"url": "/todo/assign", # actionSkel initial url
"enabled": 'True', # regel wann button aktiv "TRUE" === immer
"show_label":True, # button ohne label
"target":"popup" # popup, tab
},
"name": "Zuweisen", # button name
"access": ["todo-edit", "root"], # Who may trigger?
"icon": "person-plus-fill", # button icon
"variant": "success", # button color
"outline": True, # button outline style
"action": "action", # ActionSkel
"url": "/{{module}}/assign", # actionSkel initial url
"enabled": 'True', # regel wann button aktiv "TRUE" === immer
"show_label": True, # button ohne label
"target": "popup", # popup, tab
},
}
}

Expand All @@ -42,14 +42,19 @@ def canAdd(self):
return True # everyone can add entries!

def addSkel(self):
# TODO: new skel.sub_skel() feature!
# skel = self._resolveSkelCls().subskel(("subject", "message", "*stname"))
# skel = self._resolveSkelCls().subskel("add")
# skel = self._resolveSkelCls().subskel(("message", ), "add")
# return skel

skel = super().addSkel().clone()
#skel.status = None
skel.status = None
skel.user = None
return skel

@exposed
@skey(allow_empty=True)
@access("root", "todo-edit")
@access("todo-edit")
def assign(self, **kwargs):

# ActionSkel for assigning multiple todos to one user
Expand All @@ -59,6 +64,11 @@ class TodoAssignSkel(ActionSkel):
descr="Todos",
multiple=True,
required=True,
format="$(dest.lastname) - $(dest.subject)",
refKeys={
"lastname",
"subject",
}
)

user = UserBone(
Expand All @@ -73,6 +83,7 @@ class TodoAssignSkel(ActionSkel):
return self.render.edit(action_skel, "assign")

# TODO: Add program logic here
# TODO: Create skel.update() function for transactional in-place update
for todo in action_skel["todo"]:
skel = self.editSkel()
skel.fromDB(todo["dest"]["key"])
Expand Down
12 changes: 10 additions & 2 deletions deploy/skeletons/todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@


class TodoSkel(skeleton.Skeleton):
subSkels = {
"*": ("*name", ),
"add": ["subject"],
}

creationdate = DateBone(
descr="Erstellt am",
readOnly=True,
Expand All @@ -11,7 +16,6 @@ class TodoSkel(skeleton.Skeleton):
compute=Compute(fn=utils.utcNow, interval=ComputeInterval(ComputeMethod.Once)),
)


firstname = StringBone(
descr="Vorname",
)
Expand All @@ -21,6 +25,11 @@ class TodoSkel(skeleton.Skeleton):
required=True,
)

phone = PhoneBone(
descr="Telefon",
default_country_code="+49",
)

category = SelectBone(
descr="Kategorie",
defaultValue="question",
Expand All @@ -43,7 +52,6 @@ class TodoSkel(skeleton.Skeleton):
validHtml=None,
)


status = SelectBone(
descr="Status",
required=True,
Expand Down
4 changes: 0 additions & 4 deletions deploy/skeletons/user.py

This file was deleted.

7 changes: 1 addition & 6 deletions sources/site/vue/components/TodoAddForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
ref="addform"
module="todo"
action="add"
:useCategories="false"
:layout="TodoAddFormLayout"
>
</vi-form>
</div>
Expand All @@ -29,11 +27,8 @@
</template>
<script setup>
/*
:useCategories="false"
:layout="TodoAddFormLayout"
*/
import {ref, reactive, computed} from 'vue'
import loader from '@viur/vue-utils/generic/Loader.vue'
Expand Down

0 comments on commit 43ddca2

Please sign in to comment.