Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/pos-modules.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"modules": {
"profile": "1.0.11",
"profile": "1.1.0",
"user": "3.0.7"
}
}
2 changes: 1 addition & 1 deletion app/pos-modules.lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"modules": {
"profile": "1.0.11",
"profile": "1.1.0",
"user": "3.0.7",
"components": "1.1.3",
"core": "1.5.5"
Expand Down
15 changes: 6 additions & 9 deletions app/views/layouts/application.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{% liquid

function current_profile = 'modules/profile/queries/profiles/find', user_id: context.current_user.id, id: null, uuid: null, first_name: null, last_name: null

{% liquid
assign current_profile = context.exports.current_profile
%}

<!DOCTYPE html>
Expand All @@ -23,7 +21,6 @@
<link rel="stylesheet" href="{{ 'style/app-typography.css' | asset_url }}">
<link rel="stylesheet" href="{{ 'style/app-inbox.css' | asset_url }}">
<link rel="stylesheet" href="{{ 'style/app.css' | asset_url }}">

{% comment %} custom js specific for this app {% endcomment %}
<script defer src="{{ 'js/app.js' | asset_url }}"></script>
<script defer src="{{ 'js/popup.js' | asset_url }}"></script>
Expand All @@ -40,15 +37,15 @@
font-display: swap;
src: url('{{ 'font/SourceCodePro-VariableFont_wght.ttf' | asset_url }}') format('truetype');
}

@font-face {
font-family: 'Source Code Pro';
font-style: italic;
font-weight: 200 900;
font-display: swap;
src: url('{{ 'SourceCodePro-Italic-VariableFont_wght.woff2' | asset_url }}') format('woff2');
}

</style>

</head>
Expand All @@ -57,8 +54,8 @@
{% if current_profile.id %}
{% render 'header', current_profile: current_profile %}
{% endif %}

{{ content_for_layout }}

</body>
</html>
</html>
6 changes: 2 additions & 4 deletions modules/chat/public/views/pages/api/messages/show.json.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ method: get
{% endcomment %}

{% liquid
function current_user = 'modules/user/queries/user/current'
function current_profile = 'modules/profile/helpers/current_profile'

# platformos-check-disable ConvertIncludeToRenderl, UnreachableCode
include 'modules/user/helpers/can_do_or_unauthorized', requester: current_user, do: 'chat.inbox', return_url: '/'
include 'modules/user/helpers/can_do_or_unauthorized', requester: current_profile, do: 'chat.inbox', return_url: '/'
# platformos-check-enable ConvertIncludeToRender, UnreachableCode

function current_profile = 'modules/profile/queries/profiles/find', user_id: current_user.id, id: null, uuid: null, first_name: null, last_name: null

assign conversation_id = context.params.conversation_id
assign page = context.params.page | plus: 0 | default: 1
assign limit = context.params.per_page | plus: 0 | default: 30
Expand Down
7 changes: 2 additions & 5 deletions modules/chat/public/views/pages/inbox.html.liquid
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
slug: inbox
---

{% liquid
function current_user = 'modules/user/queries/user/current'
function current_profile = 'modules/profile/helpers/current_profile'

# platformos-check-disable ConvertIncludeToRenderl, UnreachableCode
include 'modules/user/helpers/can_do_or_unauthorized', requester: current_user, do: 'chat.inbox', return_url: '/'
include 'modules/user/helpers/can_do_or_unauthorized', requester: current_profile, do: 'chat.inbox', return_url: '/'
# platformos-check-enable ConvertIncludeToRender, UnreachableCode

function current_profile = 'modules/profile/queries/profiles/find', user_id: current_user.id, id: null, uuid: null, first_name: null, last_name: null

function record = 'modules/chat/lib/queries/records/find_by_uuid', uuid: context.params['to_uuid']
assign object = null | hash_merge: to_id: record.id, conversation_id: context.params['conversation_id']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
{% endcomment %}

{% liquid
function current_profile = 'modules/profile/queries/profiles/find', user_id: context.current_user.id, id: null, uuid: null, first_name: null, last_name: null
function current_profile = 'modules/profile/helpers/current_profile'

assign room_id = context.params.room_id

function conversation = 'modules/chat/lib/queries/conversations/find_by_participant', id: room_id, participant_id: current_profile.id, include_messages: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% liquid
function current_profile = 'modules/profile/queries/profiles/find', user_id: context.current_user.id, id: null, uuid: null, first_name: null, last_name: null
function current_profile = 'modules/profile/helpers/current_profile'

assign room_id = context.params.room_id
function conversation = 'modules/chat/lib/queries/conversations/find_by_participant', id: room_id, participant_id: current_profile.id, include_messages: null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
assign participants = '[]' | parse_json

for participant_id in conversation.participant_ids
function profile = 'modules/profile/queries/profiles/find_proxy', id: participant_id
function profile = 'modules/profile/queries/profiles/find', id: participant_id
assign participants = participants | add_to_array: profile
endfor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
assign participants = '[]' | parse_json

for participant_id in conversation.participant_ids
function profile = 'modules/profile/queries/profiles/find_proxy', id: participant_id
function profile = 'modules/profile/queries/profiles/find', id: participant_id
assign participants = participants | add_to_array: profile
endfor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
assign participants = '[]' | parse_json

for participant_id in conversation.participant_ids
function profile = 'modules/profile/queries/profiles/find_proxy', id: participant_id
function profile = 'modules/profile/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null
assign participants = participants | add_to_array: profile
endfor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
assign participants = '[]' | parse_json

for participant_id in conversation.participant_ids
function profile = 'modules/profile/queries/profiles/find_proxy', id: participant_id
function profile = 'modules/profile/queries/profiles/find', id: participant_id
assign participants = participants | add_to_array: profile
endfor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
assign participants = '[]' | parse_json

for participant_id in conversation.participant_ids
function profile = 'modules/profile/queries/profiles/find_proxy', id: participant_id
function profile = 'modules/profile/queries/profiles/find', id: participant_id, user_id: null, uuid: null, filters: null
assign participants = participants | add_to_array: profile
endfor

Expand Down
4 changes: 2 additions & 2 deletions modules/chat/template-values.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dependencies": {
"components": "^1.1.3",
"core": "^1.0.0",
"profile": "^1.0.0",
"user": "^1.0.0",
"profile": "^1.1.0",
"user": "^1.0.0"
"common-styling": "0.0.3"
}
}
11 changes: 11 additions & 0 deletions modules/profile/public/lib/helpers/current_profile.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% liquid
function user = 'modules/user/queries/user/current'
if user.id
function current_profile = 'modules/profile/queries/profiles/find', user_id: user.id, id: null, uuid: null, first_name: null, last_name: null
endif

assign current_profile = current_profile | hash_merge: roles: user.roles, permissions: user.permissions, user: user

export current_profile
return current_profile
%}
14 changes: 8 additions & 6 deletions modules/profile/public/lib/helpers/profiles/slugs/build.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{%liquid
assign first_name = current_profile.properties.first_name
assign last_name = current_profile.properties.last_name
assign slug = first_name | append: '-' | append: last_name | append: '-' | append: current_profile.id | slugify
return slug
%}
{% liquid
assign profile = profile | default: current_profile
assign first_name = profile.first_name | default: current_profile.properties.first_name
assign last_name = profile.last_name | default: current_profile.properties.last_name
assign slug = first_name | append: '-' | append: last_name | append: '-' | append: profile.id | slugify

return slug
%}
5 changes: 3 additions & 2 deletions modules/profile/template-values.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "Profile",
"machine_name": "profile",
"type": "module",
"version": "1.0.11",
"version": "1.1.0",
"dependencies": {
"core": "^1.0.0"
"core": "^1.0.0",
"user": "^3.0.0"
}
}