diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 31930f9..a0d08be 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,4 +1,5 @@
name: Lint modules
+run-name: ${{ inputs.module && format('Lint {0}', inputs.module) || ' ' }}
on:
pull_request:
@@ -9,6 +10,26 @@ on:
paths-ignore:
- "**/README.md"
workflow_dispatch:
+ inputs:
+ module:
+ description: 'Module to lint (e.g., common-styling, user, chat)'
+ required: true
+ type: choice
+ options:
+ - chat
+ - common-styling
+ - core
+ - data-export-api
+ - oauth-facebook
+ - oauth-github
+ - oauth-google
+ - openai
+ - payments
+ - payments-example-gateway
+ - payments-stripe
+ - reports
+ - tests
+ - user
jobs:
pre_job:
@@ -25,7 +46,7 @@ jobs:
detect-changes:
needs: pre_job
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
+ if: ${{ github.event_name != 'workflow_dispatch' && needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
changed-modules: ${{ steps.set-matrix.outputs.matrix }}
@@ -74,55 +95,59 @@ jobs:
echo "matrix=$modules" >> $GITHUB_OUTPUT
echo "Changed modules for linting: $modules"
- lint-platformos-check:
- needs: detect-changes
- if: needs.detect-changes.outputs.changed-modules != '[]'
+ run-linter:
+ needs: [pre_job, detect-changes]
+ if: |
+ always() &&
+ needs.pre_job.outputs.should_skip != 'true' &&
+ (github.event_name == 'workflow_dispatch' ||
+ needs.detect-changes.outputs.changed-modules != '[]')
runs-on: ubuntu-latest
strategy:
matrix:
- module: ${{ fromJSON(needs.detect-changes.outputs.changed-modules) }}
+ module: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', inputs.module)) || fromJSON(needs.detect-changes.outputs.changed-modules) }}
fail-fast: false
env:
CI: true
- PLATFORMOS_CHECK_DEBUG: true
- DOCKER_WORKSPACE: ${{ github.workspace }}/pos-module-${{ matrix.module }}
LOGS_DIR: ${{ github.workspace }}/pos-module-${{ matrix.module }}/logs
steps:
- name: Checkout code
uses: actions/checkout@v4
+ - name: Set up Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: '22'
+
+ - name: Install pos-cli
+ id: install_pos_cli
+ run: npm install -g @platformos/pos-cli@latest
+
- name: Set up logs directory
+ if: steps.install_pos_cli.outcome == 'success'
run: |
mkdir -p ${{ env.LOGS_DIR }}
chmod -R 777 ${{ env.LOGS_DIR }}
- - name: Start PlatformOS LSP
- id: start_lsp
+ - name: Install modules
+ if: steps.install_pos_cli.outcome == 'success'
run: |
- docker run -i \
- -v ${{ env.DOCKER_WORKSPACE }}:${{ env.DOCKER_WORKSPACE }} \
- -w ${{ env.DOCKER_WORKSPACE }} \
- -e PLATFORMOS_CHECK_DEBUG=${{ env.PLATFORMOS_CHECK_DEBUG }} \
- -e PLATFORMOS_CHECK_DEBUG_LOG_FILE=${{ env.LOGS_DIR }}/platformos-lsp.log \
- platformos/platformos-lsp:latest
-
- - name: Run platformos-check
- if: steps.start_lsp.outcome == 'success'
+ cd pos-module-${{ matrix.module }}
+ mkdir -p app
+ pos-cli modules install
+
+ - name: Run pos-cli check
+ if: steps.install_pos_cli.outcome == 'success'
id: run_check
run: |
set +e # Disable exit on error
- docker run -i \
- -v ${{ env.DOCKER_WORKSPACE }}:${{ env.DOCKER_WORKSPACE }} \
- -w ${{ env.DOCKER_WORKSPACE }} \
- -e PLATFORMOS_CHECK_DEBUG=${{ env.PLATFORMOS_CHECK_DEBUG }} \
- -e PLATFORMOS_CHECK_DEBUG_LOG_FILE=${{ env.LOGS_DIR }}/platformos-check.log \
- platformos/platformos-check:latest -o json > ${{ env.LOGS_DIR }}/platformos-check-raw.json
- docker_exit_code=$?
+ pos-cli check run pos-module-${{ matrix.module }} -f json > ${{ env.LOGS_DIR }}/platformos-check-raw.json
+ check_exit_code=$? # Capture the exit code
set -e # Re-enable exit on error
jq . ${{ env.LOGS_DIR }}/platformos-check-raw.json | tee ${{ env.LOGS_DIR }}/platformos-check.json
- exit $docker_exit_code
+ exit $check_exit_code
- name: Upload logs
if: always() && steps.run_check.outcome != 'skipped'
@@ -130,7 +155,6 @@ jobs:
with:
name: platformos_check_logs_${{ matrix.module }}_${{ github.run_id }}
path: |
- ${{ env.LOGS_DIR }}/platformos-lsp.log
${{ env.LOGS_DIR }}/platformos-check.json
${{ env.LOGS_DIR }}/platformos-check-raw.json
@@ -142,19 +166,86 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "${{ env.LOGS_DIR }}/platformos-check.json" ]; then
- echo "## Issues Found" >> $GITHUB_STEP_SUMMARY
- echo "| File | Line | Column | Severity | Check | Message |" >> $GITHUB_STEP_SUMMARY
- echo "|------|------|--------|----------|-------|---------|" >> $GITHUB_STEP_SUMMARY
-
- # Try to parse and add issues
- if jq -r '.[] | .path as $file | .offenses[] | "| \($file) | \(.start_row) | \(.start_column) | \(.severity) | \(.check) | \(.message) |"' ${{ env.LOGS_DIR }}/platformos-check.json >> $GITHUB_STEP_SUMMARY 2>&1; then
- echo "Issues table generated successfully"
- else
- echo "| N/A | N/A | N/A | N/A | N/A | Failed to parse JSON - see logs for details |" >> $GITHUB_STEP_SUMMARY
- echo "JSON parse error. File contents:" >> $GITHUB_STEP_SUMMARY
- echo '```json' >> $GITHUB_STEP_SUMMARY
- cat ${{ env.LOGS_DIR }}/platformos-check.json >> $GITHUB_STEP_SUMMARY
- echo '```' >> $GITHUB_STEP_SUMMARY
+ JSON="${{ env.LOGS_DIR }}/platformos-check.json"
+
+ # Summary statistics
+ echo "## Summary" >> $GITHUB_STEP_SUMMARY
+ echo "| Metric | Count |" >> $GITHUB_STEP_SUMMARY
+ echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
+ jq -r '"| Total Offenses | \(.offenseCount) |", "| Files with Issues | \(.fileCount) |", "| Errors | \(.errorCount) |", "| Warnings | \(.warningCount) |", "| Info | \(.infoCount) |"' "$JSON" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+
+ # Offenses by check type
+ echo "## Offenses by Check Type" >> $GITHUB_STEP_SUMMARY
+ echo "| Check | Total | Errors | Warnings |" >> $GITHUB_STEP_SUMMARY
+ echo "|-------|-------|--------|----------|" >> $GITHUB_STEP_SUMMARY
+ jq -r '
+ [.files[].offenses[]] | group_by(.check)
+ | map({
+ check: .[0].check,
+ total: length,
+ errors: map(select(.severity == "error")) | length,
+ warnings: map(select(.severity == "warning")) | length
+ })
+ | sort_by(-.total)
+ | .[]
+ | "| `\(.check)` | \(.total) | \(.errors) | \(.warnings) |"
+ ' "$JSON" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+
+ # Errors section — full detail for files with errors
+ ERROR_FILE_COUNT=$(jq '[.files[] | select(.errorCount > 0)] | length' "$JSON")
+ if [ "$ERROR_FILE_COUNT" -gt 0 ]; then
+ echo "## Errors ($ERROR_FILE_COUNT files)" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ jq -r '
+ [.files[] | select(.errorCount > 0)]
+ | sort_by(-.errorCount)
+ | .[]
+ | "### \u274c `\(.path)`",
+ "",
+ "**Errors:** \(.errorCount) | **Warnings:** \(.warningCount)",
+ "",
+ "| Line | Col | Severity | Check | Message |",
+ "|------|-----|----------|-------|---------|",
+ (.offenses | sort_by(
+ (if .severity == "error" then 0 elif .severity == "warning" then 1 else 2 end),
+ .start_row
+ ) | .[] | "| \(.start_row) | \(.start_column) | \(.severity) | `\(.check)` | \(.message | gsub("\n"; " ")) |"),
+ ""
+ ' "$JSON" >> $GITHUB_STEP_SUMMARY
+ fi
+
+ # Warnings section — collapsed, only top files shown
+ WARNING_ONLY_COUNT=$(jq '[.files[] | select(.errorCount == 0 and .warningCount > 0)] | length' "$JSON")
+ if [ "$WARNING_ONLY_COUNT" -gt 0 ]; then
+ TOTAL_WARNINGS=$(jq '.warningCount' "$JSON")
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "## Warnings — ${TOTAL_WARNINGS} across ${WARNING_ONLY_COUNT} files (click to expand) " >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+
+ # Show top 20 files by warning count
+ jq -r '
+ [.files[] | select(.errorCount == 0 and .warningCount > 0)]
+ | sort_by(-.warningCount)
+ | .[:20]
+ | .[]
+ | "### \u26a0\ufe0f `\(.path)` — \(.warningCount) warnings",
+ "",
+ "| Line | Col | Check | Message |",
+ "|------|-----|-------|---------|",
+ (.offenses | sort_by(.start_row)
+ | .[] | "| \(.start_row) | \(.start_column) | `\(.check)` | \(.message | gsub("\n"; " ")) |"),
+ ""
+ ' "$JSON" >> $GITHUB_STEP_SUMMARY
+
+ REMAINING=$((WARNING_ONLY_COUNT - 20))
+ if [ "$REMAINING" -gt 0 ]; then
+ echo "...and ${REMAINING} more files with warnings only." >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ fi
+
+ echo " " >> $GITHUB_STEP_SUMMARY
fi
else
echo "## No output file found" >> $GITHUB_STEP_SUMMARY
diff --git a/pos-module-chat/modules/chat/public/lib/consumers/chat_message_created/notify_of_new_message.liquid b/pos-module-chat/modules/chat/public/lib/consumers/chat_message_created/notify_of_new_message.liquid
index 6c653ab..5975f6b 100644
--- a/pos-module-chat/modules/chat/public/lib/consumers/chat_message_created/notify_of_new_message.liquid
+++ b/pos-module-chat/modules/chat/public/lib/consumers/chat_message_created/notify_of_new_message.liquid
@@ -7,7 +7,7 @@
assign last_message = g.messages.results.first
if last_message.id == message.id
- assign event_object = null | hash_merge: message_id: message.id, app_host: app_host
+ assign event_object = {"message_id": message.id, "app_host": app_host}
function _ = 'modules/core/commands/events/publish', type: 'message_notification_to_send', object: event_object
endif
diff --git a/pos-module-chat/modules/chat/public/lib/events/chat_message_created.liquid b/pos-module-chat/modules/chat/public/lib/events/chat_message_created.liquid
index ebbac75..8fc8d8b 100644
--- a/pos-module-chat/modules/chat/public/lib/events/chat_message_created.liquid
+++ b/pos-module-chat/modules/chat/public/lib/events/chat_message_created.liquid
@@ -5,7 +5,7 @@ metadata:
app_host
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'message_id'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'app_host'
diff --git a/pos-module-chat/modules/chat/public/lib/events/message_notification_to_send.liquid b/pos-module-chat/modules/chat/public/lib/events/message_notification_to_send.liquid
index ebbac75..8fc8d8b 100644
--- a/pos-module-chat/modules/chat/public/lib/events/message_notification_to_send.liquid
+++ b/pos-module-chat/modules/chat/public/lib/events/message_notification_to_send.liquid
@@ -5,7 +5,7 @@ metadata:
app_host
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'message_id'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'app_host'
diff --git a/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid b/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid
index 530c33a..75f5756 100644
--- a/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid
+++ b/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid
@@ -11,7 +11,7 @@ slug: inbox
if context.params.to_uuid != blank
function record = 'modules/chat/lib/queries/records/find_by_uuid', uuid: context.params['to_uuid']
endif
- assign object = null | hash_merge: to_id: record.id, conversation_id: context.params['conversation_id']
+ assign object = {"to_id": record.id, "conversation_id": context.params['conversation_id']}
if record or context.params.conversation_id
function current_conversation = 'modules/chat/lib/commands/conversations/find_or_create', object: object, current_profile: current_profile
endif
@@ -33,7 +33,7 @@ slug: inbox
if conversations.total_entries > 0
if current_conversation and current_conversation.participants == blank
graphql participants = 'modules/user/profiles/search', ids: current_conversation.participant_ids
- hash_assign current_conversation['participants'] = participants.records.results
+ assign current_conversation.participants = participants.records.results
endif
render 'modules/chat/inbox', current_conversation: current_conversation, conversations: conversations, current_profile: current_profile
diff --git a/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid b/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid
index ae49cbc..eb364f4 100644
--- a/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid
@@ -21,10 +21,7 @@
function conversation = 'modules/chat/lib/queries/conversations/find_by_participant', id: room_id, participant_id: current_profile.id, include_messages: null
if conversation
assign message_safe = context.params.message | raw_escape_string
- assign object = '{}' | parse_json
- hash_assign object['conversation_id'] = conversation.id
- hash_assign object['autor_id'] = current_profile.id
- hash_assign object['message'] = message_safe
+ assign object = { "conversation_id": conversation.id, "autor_id": current_profile.id, "message": message_safe }
function message = 'modules/chat/lib/commands/messages/create', object: object
if message.valid != true
log message, 'ERROR receive message'
diff --git a/pos-module-chat/modules/chat/public/views/partials/inbox.liquid b/pos-module-chat/modules/chat/public/views/partials/inbox.liquid
index 807bb5c..2f3601c 100644
--- a/pos-module-chat/modules/chat/public/views/partials/inbox.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/inbox.liquid
@@ -41,7 +41,7 @@
-{% assign dummy_message = '{ "message": "", "created_at": null }' | parse_json %}
+{% assign dummy_message = { "message": "", "created_at": null } %}
{% render 'modules/chat/message', message: dummy_message, authored: false, timezone: null %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid
index bb3b199..2f469c6 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid
@@ -1,7 +1,5 @@
{% liquid
- assign data = '{}' | parse_json
- hash_assign data['participant_ids'] = object.participant_ids
- hash_assign data['participant_read_ids'] = current_profile.id
+ assign data = { "participant_ids": object.participant_ids, "participant_read_ids": current_profile.id }
return data
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid
index 00c229f..005ff93 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid
@@ -1,12 +1,12 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_ids'
function c = 'modules/core/validations/length', c: c, object: object, field_name: 'participant_ids', minimum: 2, allow_blank: null
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_read_ids'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid
index 6dbbb52..ac83518 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid
@@ -7,7 +7,7 @@
function conversation = 'modules/chat/lib/queries/conversations/find_by_participants', participant_ids: object.participant_ids, include_messages: true
unless conversation
function conversation = 'modules/chat/lib/commands/conversations/create', object: object, current_profile: current_profile
- hash_assign conversation['created'] = true
+ assign conversation.created = true
endunless
endif
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid
index 5716d07..a35f400 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid
@@ -1,8 +1,6 @@
{% liquid
- assign participants = '[]' | parse_json | add_to_array: current_profile.id | add_to_array: object['to_id'] | uniq | compact | sort
- assign data = '{}' | parse_json
- hash_assign data['participant_ids'] = participants
- hash_assign data['conversation_id'] = object.conversation_id
+ assign participants = [current_profile.id, object.to_id] | uniq | compact | sort
+ assign data = { "participant_ids": participants, "conversation_id": object.conversation_id }
return data
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid
index 6391f18..e606409 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid
@@ -4,9 +4,9 @@
assign types = object.participants | map: 'type' | uniq
if types.size == 1 and types.first == 'profile'
- hash_assign object['valid'] = false
+ assign object.valid = false
endif
endcomment
return object
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid
index edb2233..1723801 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid
@@ -1,8 +1,5 @@
{% liquid
- assign data = '{}' | parse_json
- hash_assign data['id'] = conversation.id
- hash_assign data['participant_read_ids'] = conversation.participant_read_ids
- hash_assign data['participant_id'] = participant_id
+ assign data = { "id": conversation.id, "participant_read_ids": conversation.participant_read_ids, "participant_id": participant_id }
return data
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid
index f043e84..11c6623 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid
@@ -1,11 +1,11 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_id'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid
index 96eb24c..2150034 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid
@@ -1,7 +1,5 @@
{% liquid
- assign data = '{}' | parse_json
- hash_assign data['id'] = conversation.id
- hash_assign data['participant_read_ids'] = current_profile.id
+ assign data = { "id": conversation.id, "participant_read_ids": current_profile.id }
return data
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid
index a74aa70..df21af9 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid
@@ -1,11 +1,11 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_read_ids'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create.liquid
index 0e5ac19..455ce2a 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create.liquid
@@ -5,7 +5,7 @@
if object.valid
function object = 'modules/core/commands/execute', mutation_name: 'modules/chat/messages/create' object: object, selection: 'record_create'
- assign event_object = null | hash_merge: message_id: object.id, app_host: context.location.host
+ assign event_object = {"message_id": object.id, "app_host": context.location.host}
function _ = 'modules/core/commands/events/publish', type: 'chat_message_created', object: event_object, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid
index 5c12d58..00baae5 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid
@@ -1,8 +1,5 @@
{% liquid
- assign data = '{}' | parse_json
- hash_assign data['conversation_id'] = object.conversation_id
- hash_assign data['autor_id'] = object.autor_id
- hash_assign data['message'] = object.message
+ assign data = { "conversation_id": object.conversation_id, "autor_id": object.autor_id, "message": object.message }
return data
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid
index b464e90..f8f3e3e 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid
@@ -1,12 +1,12 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'conversation_id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'autor_id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'message'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid
index 7d922a3..0177666 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid
@@ -8,17 +8,14 @@
assign conversation = r.conversations.results.first
- assign participants = '[]' | parse_json
+ assign participants = []
-
- # platformos-check-disable GraphqlInForLoop
for participant_id in conversation.participant_ids
function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null
- assign participants = participants | add_to_array: profile
+ assign participants << profile
endfor
- # platformos-check-enable GraphqlInForLoop
- hash_assign conversation['participants'] = participants
+ assign conversation.participants = participants
return conversation
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid
index a80d216..81fd303 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid
@@ -14,15 +14,15 @@
assign conversation = r.conversations.results.first
if conversation
- assign participants = '[]' | parse_json
+ assign participants = []
for participant_id in conversation.participant_ids
function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null
- assign participants = participants | add_to_array: profile
+ assign participants << profile
endfor
- hash_assign conversation['participants'] = participants
+ assign conversation.participants = participants
endif
return conversation
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid
index 3624d77..c7ecc72 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid
@@ -9,15 +9,15 @@
assign conversation = r.conversations.results.first
if conversation
- assign participants = '[]' | parse_json
+ assign participants = []
for participant_id in conversation.participant_ids
function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null
- assign participants = participants | add_to_array: profile
+ assign participants << profile
endfor
- hash_assign conversation['participants'] = participants
+ assign conversation.participants = participants
endif
return conversation
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid
index 132d680..e775b30 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid
@@ -3,21 +3,21 @@
graphql r = 'modules/chat/conversations/search_by_message', limit: limit, page: page, participant_id: participant_id, message: message
assign result = r.conversations
- assign conversations = '[]' | parse_json
+ assign conversations = []
for conversation in result.results
- assign participants = '[]' | parse_json
+ assign participants = []
for participant_id in conversation.participant_ids
function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null
- assign participants = participants | add_to_array: profile
+ assign participants << profile
endfor
- hash_assign conversation['participants'] = participants
- assign conversations = conversations | add_to_array: conversation
+ assign conversation.participants = participants
+ assign conversations << conversation
endfor
- hash_assign result['results'] = conversations
+ assign result.results = conversations
return result
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid
index 4632f13..4b54064 100644
--- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid
+++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid
@@ -9,21 +9,21 @@
graphql r = 'modules/chat/conversations/search', limit: limit, page: page, participant_id: participant_id
assign result = r.conversations
- assign conversations = '[]' | parse_json
+ assign conversations = []
for conversation in result.results
- assign participants = '[]' | parse_json
+ assign participants = []
for participant_id in conversation.participant_ids
function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null
- assign participants = participants | add_to_array: profile
+ assign participants << profile
endfor
- hash_assign conversation['participants'] = participants
- assign conversations = conversations | add_to_array: conversation
+ assign conversation.participants = participants
+ assign conversations << conversation
endfor
- hash_assign result['results'] = conversations
+ assign result.results = conversations
return result
-%}
+ %}
diff --git a/pos-module-chat/modules/chat/template-values.json b/pos-module-chat/modules/chat/template-values.json
index ca5c942..f9c5f3a 100644
--- a/pos-module-chat/modules/chat/template-values.json
+++ b/pos-module-chat/modules/chat/template-values.json
@@ -2,11 +2,11 @@
"name": "Pos Module Chat",
"machine_name": "chat",
"type": "module",
- "version": "1.1.1",
+ "version": "1.2.0",
"dependencies": {
- "core": "^2.0.6",
+ "core": "^2.1.0",
"profile": "^1.1.1",
- "user": "^5.0.4",
+ "user": "^5.2.0",
"common-styling": "1.11.0"
}
}
diff --git a/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid b/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid
index 4af2559..0972f1b 100644
--- a/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid
+++ b/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid
@@ -1139,9 +1139,9 @@ layout: 'modules/common-styling/style-guide'
for i in (i..10)
assign value = 'value' | append: i
assign label = 'Label for value ' | append: i
- assign example_item = '{}' | parse_json | hash_merge: value: value, label: label
- assign example_list = example_list | add_to_array: example_item
- assign selected = '["value0", "value5", "value6"]' | parse_json
+ assign example_item = { "value": value, "label": label }
+ assign example_list << example_item
+ assign selected = ["value0", "value5", "value6"]
endfor
%}
{% render 'modules/common-styling/forms/multiselect', name: 'styleguide-form-multiselect-test-1', id: 'styleguide-form-multiselect-test-1', list: example_list, showFilter: true, combine_selected: true %}
@@ -1167,7 +1167,7 @@ layout: 'modules/common-styling/style-guide'
There are two partials that can be helpful when dealing with forms validation. One can be added to the input itself to handle usability code and the other can output the error message.
{% liquid
- assign errors = '{ "styleguide-example-error": ["This is a field with two errors", "This is the second error"] }' | parse_json
+ assign errors = { "styleguide-example-error": ["This is a field with two errors", "This is the second error"] }
%}
diff --git a/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/build.liquid b/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/build.liquid
index 6a83151..1fc2591 100644
--- a/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/build.liquid
+++ b/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/build.liquid
@@ -1,4 +1,4 @@
{% liquid
- assign data = null | hash_merge: id: object.id, name: object.name
+ assign data = {"id": object.id, "name": object.name}
return data
%}
diff --git a/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/check.liquid b/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/check.liquid
index 8f3da9c..2c53a6c 100644
--- a/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/check.liquid
+++ b/pos-module-chat/modules/core/generators/command/templates/lib/commands/create/check.liquid
@@ -1,10 +1,12 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'name'
- assign object = object | hash_merge: c
+ assign object.valid = c.valid
+
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/generators/crud/index.js b/pos-module-chat/modules/core/generators/crud/index.js
index a97a592..c51553b 100644
--- a/pos-module-chat/modules/core/generators/crud/index.js
+++ b/pos-module-chat/modules/core/generators/crud/index.js
@@ -8,7 +8,7 @@ module.exports = class extends Generator {
this.description = 'Generate table definition and commands for CRUD with graphql files';
this.argument('modelName', { type: String, required: true, description: 'name of the table' });
- this.argument('attributes', { type: Array, required: false, description: 'table column names with types', default: [] });
+ this.argument('attributes', { type: Array, required: false, description: 'table column names with types', default: "[]" });
this.option('include-views', { type: Boolean, default: false, description: 'generate pages and partials', hide: 'no' });
const attributes = this.options.attributes.map((attr) => {
diff --git a/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/create/check.liquid b/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/create/check.liquid
index df36e79..caf4d8d 100644
--- a/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/create/check.liquid
+++ b/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/create/check.liquid
@@ -1,11 +1,12 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
<% attributes.forEach((attr, i) => { -%>
function c = 'modules/core/validations/presence', c: c, object: object, field_name: '<%= attr.name %>'
<% }); -%>
- assign object = object | hash_merge: valid: c.valid, errors: c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/delete/check.liquid b/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/delete/check.liquid
index 4ae7fc6..4fada40 100644
--- a/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/delete/check.liquid
+++ b/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/delete/check.liquid
@@ -1,9 +1,10 @@
{% liquid
- assign c = '{ "valid": true, "errors": {} }' | parse_json
+ assign c = { "valid": true, "errors": {} }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
- assign object = object | hash_merge: valid: c.valid, errors: c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/update/check.liquid b/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/update/check.liquid
index c991577..cffe564 100644
--- a/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/update/check.liquid
+++ b/pos-module-chat/modules/core/generators/crud/templates/lib/commands/model/update/check.liquid
@@ -1,12 +1,13 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
<% attributes.forEach((attr, i) => { -%>
function c = 'modules/core/validations/presence', c: c, object: object, field_name: '<%= attr.name %>'
<% }); -%>
- assign object = object | hash_merge: valid: c.valid, errors: c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid b/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid
index cb0e37a..43c1b24 100644
--- a/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid
+++ b/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid
@@ -1,4 +1,4 @@
{% liquid
- assign object = '{}' | parse_json
+ assign object = {}
render 'theme/simple/<%= modelNamePlural %>/new', object: object
-%}
+ %}
diff --git a/pos-module-chat/modules/core/public/lib/commands/email/send.liquid b/pos-module-chat/modules/core/public/lib/commands/email/send.liquid
index bd0a46e..08b61e8 100644
--- a/pos-module-chat/modules/core/public/lib/commands/email/send.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/email/send.liquid
@@ -7,8 +7,8 @@
if r.errors
log r.errors, type: 'errors.graphql.invalid'
- hash_assign object['valid'] = false
- hash_assign object['errors'] = r.errors
+ assign object.valid = false
+ assign object.errors = r.errors
endif
else
log object.errors, type: 'payload validation error in core: commands/email'
diff --git a/pos-module-chat/modules/core/public/lib/commands/email/send/check.liquid b/pos-module-chat/modules/core/public/lib/commands/email/send/check.liquid
index 83f4269..b2d0e28 100644
--- a/pos-module-chat/modules/core/public/lib/commands/email/send/check.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/email/send/check.liquid
@@ -1,13 +1,13 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'from'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'to'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'layout'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'partial'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/events/broadcast.liquid b/pos-module-chat/modules/core/public/lib/commands/events/broadcast.liquid
index 5cf9440..6558c07 100644
--- a/pos-module-chat/modules/core/public/lib/commands/events/broadcast.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/events/broadcast.liquid
@@ -8,7 +8,7 @@
assign name = 'consumers/' | append: object.type | append: '/'
graphql consumers = 'modules/core/events/consumers', name: name | fetch: "admin_liquid_partials" | fetch: "results"
- hash_assign object['consumers'] = consumers
+ assign object.consumers = consumers
for consumer in consumers
assign priority = 'default'
if priorities contains consumer.metadata.priority
diff --git a/pos-module-chat/modules/core/public/lib/commands/events/create/build.liquid b/pos-module-chat/modules/core/public/lib/commands/events/create/build.liquid
index 8276ea4..34dd532 100644
--- a/pos-module-chat/modules/core/public/lib/commands/events/create/build.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/events/create/build.liquid
@@ -1,6 +1,8 @@
{% liquid
assign now = 'now' | to_time
- assign data = object | hash_merge: type: type, date: now
+ assign data = object
+ assign data.type = type
+ assign data.date = now
return data
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/events/create/check.liquid b/pos-module-chat/modules/core/public/lib/commands/events/create/check.liquid
index b4f2878..07d352e 100644
--- a/pos-module-chat/modules/core/public/lib/commands/events/create/check.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/events/create/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'type'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'date'
@@ -17,14 +17,16 @@
if event_check_partial
function event_result = event_check_partial.path, event: object
if event_result.valid != true
- hash_assign c['errors']['object'] = event_result.errors
- hash_assign c['valid'] = false
+ assign c.errors.object = event_result.errors
+ assign c.valid = false
endif
else
assign message = 'There is no such event: ' | append: object.type | append: '. Please add event check in events/' | append: object.type
function c = 'modules/core/helpers/register_error', contract: c, field_name: type, message: message
endif
- assign object = object | hash_merge: c
+ assign object.valid = c.valid
+
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/events/create/execute.liquid b/pos-module-chat/modules/core/public/lib/commands/events/create/execute.liquid
index bff75bf..326537b 100644
--- a/pos-module-chat/modules/core/public/lib/commands/events/create/execute.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/events/create/execute.liquid
@@ -2,7 +2,7 @@
graphql r = 'modules/core/events/create', payload: object
assign object = r.activity_create.payload
- hash_assign object['valid'] = true
+ assign object.valid = true
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/execute.liquid b/pos-module-chat/modules/core/public/lib/commands/execute.liquid
index 0c9e1cd..e68f82d 100644
--- a/pos-module-chat/modules/core/public/lib/commands/execute.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/execute.liquid
@@ -7,6 +7,6 @@
endif
assign object = r[selection]
- hash_assign object['valid'] = true
+ assign object.valid = true
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid b/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid
index 64e2245..670f254 100644
--- a/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid
@@ -16,6 +16,6 @@
function _ = implementation.path, params_to_modify: params_to_modify, params: params
endfor
- assign result = '{}' | parse_json | hash_merge: original_params: original_params
+ assign result = { "original_params": original_params }
return result
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid b/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid
index c4956c8..038effd 100644
--- a/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid
@@ -8,9 +8,9 @@
{% endcomment %}
{% liquid
if merge_to_object
- assign results = '{}' | parse_json
+ assign results = {}
else
- assign results = '[]' | parse_json
+ assign results = []
endif
assign hook = '/hook_' | append: hook
@@ -24,7 +24,7 @@
endcomment
if hook_result[0]
for h_result in hook_result
- assign results = results | add_to_array: h_result
+ assign results << h_result
endfor
comment
Check if the result is an object.
@@ -32,7 +32,7 @@
elsif hook_result.first and merge_to_object
assign results = results | hash_merge: hook_result
else
- assign results = results | add_to_array: hook_result
+ assign results << hook_result
endif
endif
endfor
diff --git a/pos-module-chat/modules/core/public/lib/commands/statuses/create/check.liquid b/pos-module-chat/modules/core/public/lib/commands/statuses/create/check.liquid
index acbcb25..a264652 100644
--- a/pos-module-chat/modules/core/public/lib/commands/statuses/create/check.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/statuses/create/check.liquid
@@ -1,13 +1,13 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'name'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'timestamp'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'reference_id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'requester_id'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/statuses/delete/build.liquid b/pos-module-chat/modules/core/public/lib/commands/statuses/delete/build.liquid
index d26bbdf..a596cdb 100644
--- a/pos-module-chat/modules/core/public/lib/commands/statuses/delete/build.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/statuses/delete/build.liquid
@@ -1,4 +1,4 @@
{% liquid
- assign object = null | hash_merge: id: id
+ assign object = {"id": id}
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/commands/statuses/delete/check.liquid b/pos-module-chat/modules/core/public/lib/commands/statuses/delete/check.liquid
index 51f8988..4fada40 100644
--- a/pos-module-chat/modules/core/public/lib/commands/statuses/delete/check.liquid
+++ b/pos-module-chat/modules/core/public/lib/commands/statuses/delete/check.liquid
@@ -1,10 +1,10 @@
{% liquid
- assign c = '{ "valid": true, "errors": {} }' | parse_json
+ assign c = { "valid": true, "errors": {} }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/public/lib/events/status_created.liquid b/pos-module-chat/modules/core/public/lib/events/status_created.liquid
index 6718a16..023c478 100644
--- a/pos-module-chat/modules/core/public/lib/events/status_created.liquid
+++ b/pos-module-chat/modules/core/public/lib/events/status_created.liquid
@@ -8,7 +8,7 @@ metadata:
payload
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'name'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'reference_id'
diff --git a/pos-module-chat/modules/core/public/lib/helpers/hash_to_x_form_encoded.liquid b/pos-module-chat/modules/core/public/lib/helpers/hash_to_x_form_encoded.liquid
index 73e48bb..57ed938 100644
--- a/pos-module-chat/modules/core/public/lib/helpers/hash_to_x_form_encoded.liquid
+++ b/pos-module-chat/modules/core/public/lib/helpers/hash_to_x_form_encoded.liquid
@@ -2,7 +2,7 @@
assign parameters = '' | split: ','
for pair in payload
assign component = pair[0] | append: '={' | append: pair[0] | append: '}'
- assign parameters = parameters | add_to_array: component
+ assign parameters << component
endfor
if parameters.size > 0
assign x_form_encoded = parameters | join: '&' | expand_url_template: payload
diff --git a/pos-module-chat/modules/core/public/lib/helpers/redirect_to.liquid b/pos-module-chat/modules/core/public/lib/helpers/redirect_to.liquid
index 3d430eb..b502e94 100644
--- a/pos-module-chat/modules/core/public/lib/helpers/redirect_to.liquid
+++ b/pos-module-chat/modules/core/public/lib/helpers/redirect_to.liquid
@@ -23,13 +23,12 @@
# platformos-check-enable ConvertIncludeToRender
if format == 'json'
- assign response_json = null | hash_merge: type: 'redirect', url: url
+ assign response_json = {"type": "redirect", "url": url}
if object.valid
echo response_json
else
response_status 422
- assign res = '{ "errors": {} }' | parse_json
- hash_assign res['errors'] = response_json.errors
+ assign res = { "errors": response_json.errors }
echo res
endif
diff --git a/pos-module-chat/modules/core/public/lib/helpers/register_error.liquid b/pos-module-chat/modules/core/public/lib/helpers/register_error.liquid
index 2f252ef..c54314e 100644
--- a/pos-module-chat/modules/core/public/lib/helpers/register_error.liquid
+++ b/pos-module-chat/modules/core/public/lib/helpers/register_error.liquid
@@ -18,10 +18,10 @@
assign errors = contract.errors
assign field_errors = errors[field_name] | default: '[]' | parse_json
- assign field_errors = field_errors | add_to_array: msg
+ assign field_errors << msg
- hash_assign errors[field_name] = field_errors
- hash_assign contract['valid'] = false
+ assign errors[field_name] = field_errors
+ assign contract.valid = false
return contract
%}
diff --git a/pos-module-chat/modules/core/public/lib/queries/registry/search.liquid b/pos-module-chat/modules/core/public/lib/queries/registry/search.liquid
index 60e1126..0e08818 100644
--- a/pos-module-chat/modules/core/public/lib/queries/registry/search.liquid
+++ b/pos-module-chat/modules/core/public/lib/queries/registry/search.liquid
@@ -8,18 +8,18 @@
case type
when 'module'
- assign modules = '[]' | parse_json
+ assign modules = []
for module in registry
if module.type == 'module'
- assign modules = modules | add_to_array: module
+ assign modules << module
endif
endfor
return modules
when 'theme'
- assign themes = '[]' | parse_json
+ assign themes = []
for module in registry
if module.type == 'theme'
- assign themes = themes | add_to_array: module
+ assign themes << module
endif
endfor
return themes
diff --git a/pos-module-chat/modules/core/public/lib/validations/password_complexity.liquid b/pos-module-chat/modules/core/public/lib/validations/password_complexity.liquid
index ad4b34d..9ab7d06 100644
--- a/pos-module-chat/modules/core/public/lib/validations/password_complexity.liquid
+++ b/pos-module-chat/modules/core/public/lib/validations/password_complexity.liquid
@@ -29,7 +29,8 @@
endunless
endif
- function c = 'modules/core/validations/length', c: c, object: object, value: decoded_pw, field_name: field_name, maximum: maximum, minimum: minimum, message_minimum: key: 'modules/core/validation.too_short', allow_blank: null
+ assign message_minimum = 'modules/core/validation.too_short'
+ function c = 'modules/core/validations/length', c: c, object: object, value: decoded_pw, field_name: field_name, maximum: maximum, minimum: minimum, message_minimum: message_minimum, allow_blank: null
return c
%}
diff --git a/pos-module-chat/modules/core/public/lib/validations/valid_object.liquid b/pos-module-chat/modules/core/public/lib/validations/valid_object.liquid
index b29a9b1..41f9359 100644
--- a/pos-module-chat/modules/core/public/lib/validations/valid_object.liquid
+++ b/pos-module-chat/modules/core/public/lib/validations/valid_object.liquid
@@ -12,7 +12,7 @@
if check_object.valid != true
function c = 'modules/core/helpers/register_error', contract: c, field_name: field_name, key: 'modules/core/validation.invalid'
assign errors_key = field_name | append: '_errors'
- hash_assign c['errors'][errors_key] = check_object.errors
+ assign c.errors[errors_key] = check_object.errors
endif
endif
diff --git a/pos-module-chat/modules/core/public/views/pages/_events/trigger.liquid b/pos-module-chat/modules/core/public/views/pages/_events/trigger.liquid
index 9ac9edd..c062670 100644
--- a/pos-module-chat/modules/core/public/views/pages/_events/trigger.liquid
+++ b/pos-module-chat/modules/core/public/views/pages/_events/trigger.liquid
@@ -12,7 +12,7 @@ slug: _events/:uuid/trigger
else
assign name = 'consumers/' | append: event.type | append: '/'
graphql consumers = 'modules/core/events/consumers', name: name | fetch: "admin_liquid_partials" | fetch: "results"
- hash_assign event['consumers'] = consumers
+ assign event.consumers = consumers
endif
render 'modules/core/events/show', event: event
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send.liquid b/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send.liquid
index e6ad1be..1818aa7 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send.liquid
@@ -8,8 +8,8 @@
if r.errors
log r.errors, type: 'errors.graphql.invalid'
- hash_assign object['valid'] = false
- hash_assign object['errors'] = r.errors
+ assign object.valid = false
+ assign object.errors = r.errors
endif
else
log object.errors, type: 'payload validation error in core: lib/commands/email'
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send/check.liquid b/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send/check.liquid
index 83f4269..b2d0e28 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send/check.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/commands/email/send/check.liquid
@@ -1,13 +1,13 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'from'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'to'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'layout'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'partial'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid
index 3418a8a..118bc47 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid
@@ -17,6 +17,6 @@
function _ = implementation.path, params_to_modify: params_to_modify, params: params
endfor
- assign result = '{}' | parse_json | hash_merge: original_params: original_params
+ assign result = { "original_params": original_params }
return result
%}
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid
index 5af969b..c0355d9 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid
@@ -8,9 +8,9 @@
{% endcomment %}
{% liquid
if merge_to_object
- assign results = '{}' | parse_json
+ assign results = {}
else
- assign results = '[]' | parse_json
+ assign results = []
endif
assign hook = '/hook_' | append: hook
@@ -24,7 +24,7 @@
endcomment
if hook_result[0]
for h_result in hook_result
- assign results = results | add_to_array: h_result
+ assign results << h_result
endfor
comment
Check if the result is an object.
@@ -32,7 +32,7 @@
elsif hook_result.first and merge_to_object
assign results = results | hash_merge: hook_result
else
- assign results = results | add_to_array: hook_result
+ assign results << hook_result
endif
endif
endfor
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid b/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid
index 2f252ef..7c49342 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid
@@ -17,11 +17,11 @@
assign errors = contract.errors
- assign field_errors = errors[field_name] | default: '[]' | parse_json
- assign field_errors = field_errors | add_to_array: msg
+ assign field_errors = errors[field_name] | default: "[]"
+ assign field_errors << msg
- hash_assign errors[field_name] = field_errors
- hash_assign contract['valid'] = false
+ assign errors[field_name] = field_errors
+ assign contract.valid = false
return contract
%}
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid b/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid
index 9c2cb22..6e96071 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid
@@ -8,18 +8,18 @@
case type
when 'module'
- assign modules = '[]' | parse_json
+ assign modules = []
for module in registry
if module.type == 'module'
- assign modules = modules | add_to_array: module
+ assign modules << module
endif
endfor
return modules
when 'theme'
- assign themes = '[]' | parse_json
+ assign themes = []
for module in registry
if module.type == 'theme'
- assign themes = themes | add_to_array: module
+ assign themes << module
endif
endfor
return themes
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/validations/password_complexity.liquid b/pos-module-chat/modules/core/public/views/partials/lib/validations/password_complexity.liquid
index d5848f6..e78516e 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/validations/password_complexity.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/validations/password_complexity.liquid
@@ -27,7 +27,8 @@
endunless
endif
- function c = 'modules/core/lib/validations/length', c: c, object: object, value: decoded_pw, field_name: 'password', maximum: 256, minimum: 6, message_minimum: key: 'modules/core/validation.too_short', allow_blank: null
+ assign message_minimum = 'modules/core/validation.too_short'
+ function c = 'modules/core/lib/validations/length', c: c, object: object, value: decoded_pw, field_name: 'password', maximum: 256, minimum: 6, message_minimum: message_minimum, allow_blank: null
return c
%}
diff --git a/pos-module-chat/modules/core/public/views/partials/lib/validations/valid_object.liquid b/pos-module-chat/modules/core/public/views/partials/lib/validations/valid_object.liquid
index 7b1b317..f0adacc 100644
--- a/pos-module-chat/modules/core/public/views/partials/lib/validations/valid_object.liquid
+++ b/pos-module-chat/modules/core/public/views/partials/lib/validations/valid_object.liquid
@@ -13,7 +13,7 @@
if check_object.valid != true
function c = 'modules/core/lib/helpers/register_error', contract: c, field_name: field_name, key: 'modules/core/validation.invalid'
assign errors_key = field_name | append: '_errors'
- hash_assign c['errors'][errors_key] = check_object.errors
+ assign c.errors[errors_key] = check_object.errors
endif
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/authentication_links/create.liquid b/pos-module-chat/modules/user/public/lib/commands/authentication_links/create.liquid
index 3babc6a..4bdb0c9 100644
--- a/pos-module-chat/modules/user/public/lib/commands/authentication_links/create.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/authentication_links/create.liquid
@@ -4,7 +4,7 @@
if object.valid
function object = 'modules/user/commands/authentication_links/create/execute', object: object
- assign event_payload = null | hash_merge: email: email
+ assign event_payload = {"email": email}
function _ = 'modules/core/commands/events/publish', type: 'authentication_link_created', object: event_payload, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/check.liquid b/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/check.liquid
index cdd52a2..d02f145 100644
--- a/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'email'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'host'
@@ -9,8 +9,8 @@
function c = 'modules/core/validations/hcaptcha', c: c, hcaptcha_params: hcaptcha_params
endif
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/execute.liquid b/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/execute.liquid
index 2b5ea1e..2044a86 100644
--- a/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/execute.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/authentication_links/create/execute.liquid
@@ -1,6 +1,6 @@
{% liquid
if object.valid
- hash_assign object['url'] = 'https://{host}/passwords/new?token={token}&email={email}' | expand_url_template: object
+ assign object.url = 'https://{host}/passwords/new?token={token}&email={email}' | expand_url_template: object
endif
return object
diff --git a/pos-module-chat/modules/user/public/lib/commands/oauth/create_user.liquid b/pos-module-chat/modules/user/public/lib/commands/oauth/create_user.liquid
index 682ec96..593beeb 100644
--- a/pos-module-chat/modules/user/public/lib/commands/oauth/create_user.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/oauth/create_user.liquid
@@ -1,8 +1,7 @@
{% liquid
assign password = 30 | random_string
assign full_name = user_first_name | append: " " | append: user_last_name
- assign object = "{}" | parse_json | hash_merge: email: user_email
- assign object = object | hash_merge: firstName: user_first_name, lastName: user_last_name, fullName: full_name
+ assign object = {"email": user_email, "firstName": user_first_name, "lastName": user_last_name, "fullName": full_name}
function new_user = "modules/user/commands/user/create", first_name: user_first_name, last_name: user_last_name, email: user_email, password: password, hook_params: object
return new_user
diff --git a/pos-module-chat/modules/user/public/lib/commands/passwords/create.liquid b/pos-module-chat/modules/user/public/lib/commands/passwords/create.liquid
index fb11f56..061474f 100644
--- a/pos-module-chat/modules/user/public/lib/commands/passwords/create.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/passwords/create.liquid
@@ -4,7 +4,7 @@
if object.valid
function object = 'modules/user/commands/passwords/create/execute', object: object
- assign event_payload = null | hash_merge: user_id: object.user_id
+ assign event_payload = {"user_id": object.user_id}
function _ = 'modules/core/commands/events/publish', type: 'password_created', object: event_payload, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/passwords/create/check.liquid b/pos-module-chat/modules/user/public/lib/commands/passwords/create/check.liquid
index 877fbe9..d89abb5 100644
--- a/pos-module-chat/modules/user/public/lib/commands/passwords/create/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/passwords/create/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'password'
@@ -7,8 +7,8 @@
function c = 'modules/core/validations/equal', c: c, given: object.password, expected: object.password_confirmation, field_name: 'password_confirmation', key: 'modules/user/validation.password.do_not_match', not_verbose: true, message: null
function c = 'modules/core/validations/password_complexity', c: c, object: object, field_name: 'password', key: null
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/passwords/create/execute.liquid b/pos-module-chat/modules/user/public/lib/commands/passwords/create/execute.liquid
index 4c0a7fd..d5a365b 100644
--- a/pos-module-chat/modules/user/public/lib/commands/passwords/create/execute.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/passwords/create/execute.liquid
@@ -4,8 +4,8 @@
if r.errors
log r.errors, type: 'errors.graphql.invalid'
- hash_assign object['valid'] = false
- hash_assign object['errors'] = r.errors
+ assign object.valid = false
+ assign object.errors = r.errors
endif
return object
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid
index ff6f895..3183c3e 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid
@@ -4,11 +4,11 @@
assign uuid = object.uuid | default: uuid_new
assign name = object.first_name | append: ' ' | append: object.last_name
- assign data = null | hash_merge: first_name: object.first_name, last_name: object.last_name, user_id: object.user_id, email: object.email, uuid: uuid, name: name, c__names: tokenized_names
+ assign data = {"first_name": object.first_name, "last_name": object.last_name, "user_id": object.user_id, "email": object.email, "uuid": uuid, "name": name, "c__names": tokenized_names}
if object.roles == null
- assign roles = '[]' | parse_json
+ assign roles = []
if context.constants.USER_DEFAULT_ROLE != blank
- assign roles = roles | array_add: context.constants.USER_DEFAULT_ROLE
+ assign roles << context.constants.USER_DEFAULT_ROLE
endif
else
assign roles_type = object.roles | type_of
@@ -17,16 +17,15 @@
elsif roles_type == 'Array'
assign roles = object.roles
else
- # accepts only String and Array
log object.roles, type: 'ERROR: roles must be an array or a coma separated string'
- assign roles = '[]' | parse_json
+ assign roles = []
if context.constants.USER_DEFAULT_ROLE != blank
- assign roles = roles | array_add: context.constants.USER_DEFAULT_ROLE
+ assign roles << context.constants.USER_DEFAULT_ROLE
endif
endif
endif
- hash_assign data['roles'] = roles
+ assign data.roles = roles
return data
-%}
+ %}
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/create/check.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/create/check.liquid
index 2c9b645..3af8b4b 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/create/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/create/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'user_id'
function c = 'modules/core/validations/uniqueness', c: c, object: object, field_name: 'user_id', table: 'modules/user/profile', scope_name: null, exclude_name: null
@@ -8,7 +8,9 @@
function c = 'modules/core/validations/length', c: c, object: object, field_name: 'first_name', maximum: 40, allow_blank: null
function c = 'modules/core/validations/length', c: c, object: object, field_name: 'last_name', maximum: 40, allow_blank: null
- assign object = object | hash_merge: c
+ assign object.valid = c.valid
+
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/delete/build.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/delete/build.liquid
index d10a19e..3536a27 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/delete/build.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/delete/build.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign data = null | hash_merge: id: object.id
+ assign data = {"id": object.id}
return data
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/delete/check.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/delete/check.liquid
index 67e2c81..de59d59 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/delete/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/delete/check.liquid
@@ -1,9 +1,11 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
- assign object = object | hash_merge: c
+ assign object.valid = c.valid
+
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid
index aabfc15..843fbc5 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid
@@ -1,9 +1,9 @@
{% liquid
- assign object = '{}' | parse_json | hash_merge: valid: true, id: id, role: role
+ assign object = { "valid": true, "id": id, "role": role }
function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/append'
if object.errors == blank
- assign event_payload = null | hash_merge: profile_id: id, role: role
+ assign event_payload = {"profile_id": id, "role": role}
function _ = 'modules/core/commands/events/publish', type: 'user_role_appended', object: event_payload, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid
index 2f6a6da..21e2b56 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid
@@ -1,9 +1,9 @@
{% liquid
- assign object = '{}' | parse_json | hash_merge: valid: true, id: id, role : role
+ assign object = { "valid": true, "id": id, "role": role }
function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/remove'
if object.errors == blank
- assign event_payload = null | hash_merge: profile_id: id, role: role
+ assign event_payload = {"profile_id": id, "role": role}
function _ = 'modules/core/commands/events/publish', type: 'user_role_removed', object: event_payload, delay: null, max_attempts: null
endif
return object
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid
index c1a0f39..e557fc4 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid
@@ -1,9 +1,9 @@
{% liquid
- assign object = '{}' | parse_json | hash_merge: valid: true, id: id, roles: roles
+ assign object = { "valid": true, "id": id, "roles": roles }
function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/set'
if object.errors == blank
- assign event_payload = null | hash_merge: profile_id: id, roles: roles
+ assign event_payload = {"profile_id": id, "roles": roles}
function _ = 'modules/core/commands/events/publish', type: 'user_roles_set', object: event_payload, delay: null, max_attempts: null
endif
return object
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid
index f4b04c8..7155bdc 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid
@@ -1,4 +1,4 @@
{% liquid
- assign tokenized_names = '[]' | parse_json | array_add: object.email | array_add: object.first_name | array_add: object.last_name | compact | uniq | join: ' ' | downcase
+ assign tokenized_names = [] | push: object.email | push: object.first_name | push: object.last_name | compact | uniq | join: ' ' | downcase
return tokenized_names
-%}
+ %}
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/update/build.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/update/build.liquid
index 43f68e6..1095444 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/update/build.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/update/build.liquid
@@ -1,7 +1,7 @@
{% liquid
function tokenized_names = 'modules/user/commands/profiles/tokenize_names', object: object
assign name = object.first_name | append: ' ' | append: object.last_name
- assign data = null | hash_merge: id: profile.id, first_name: object.first_name, last_name: object.last_name, name: name, c__names: tokenized_names, email: profile.email
+ assign data = {"id": profile.id, "first_name": object.first_name, "last_name": object.last_name, "name": name, "c__names": tokenized_names, "email": profile.email}
return data
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/update/check.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/update/check.liquid
index 4704506..7820df7 100644
--- a/pos-module-chat/modules/user/public/lib/commands/profiles/update/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/profiles/update/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/uniqueness', c: c, object: object, field_name: 'email', table: 'modules/user/profile', scope_name: null, exclude_name: null
@@ -8,7 +8,10 @@
function c = 'modules/core/validations/length', c: c, object: object, field_name: 'last_name', maximum: 40, allow_blank: null
- assign object = object | hash_merge: c
+ assign object.valid = c.valid
+
+
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/create.liquid b/pos-module-chat/modules/user/public/lib/commands/session/create.liquid
index 5cffc62..2b54c6a 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/create.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/create.liquid
@@ -30,13 +30,13 @@
function user = 'modules/user/queries/user/load', id: object.id
if user.id
sign_in user_id: user.id
- assign params = '{}' | parse_json | hash_merge: user: user, hook_params: hook_params
+ assign params = { "user": user, "hook_params": hook_params }
function results = 'modules/core/commands/hook/fire', hook: 'user_login', params: params, merge_to_object: true
- hash_assign user['hook_results'] = results
+ assign user.hook_results = results
endif
- hash_assign object['user'] = user
+ assign object.user = user
- assign event_payload = null | hash_merge: user_id: object.id
+ assign event_payload = {"user_id": object.id}
function _ = 'modules/core/commands/events/publish', type: 'user_signed_in', object: event_payload, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/create/check.liquid b/pos-module-chat/modules/user/public/lib/commands/session/create/check.liquid
index a8e6310..8b23983 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/create/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/create/check.liquid
@@ -1,10 +1,10 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid b/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid
index 1ad11d0..55fdfbd 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid
@@ -5,13 +5,13 @@
function current_profile = 'modules/user/helpers/current_profile'
graphql destroy = 'modules/user/session/destroy'
- hash_assign destroy['user'] = current_profile.user
+ assign destroy.user = current_profile.user
unless destroy.errors
- assign params = '{}' | parse_json | hash_merge: destroy: destroy
+ assign params = { "destroy": destroy }
function results = 'modules/core/commands/hook/fire', hook: 'user_logout', params: params, merge_to_object: null
- hash_assign destroy['hook_results'] = results
- assign event_payload = null | hash_merge: user_id: current_profile.user.id
+ assign destroy.hook_results = results
+ assign event_payload = {"user_id": current_profile.user.id}
function _ = 'modules/core/commands/events/publish', type: 'user_logout', object: event_payload, delay: null, max_attempts: null
session original_user_id = null
session return_to = null
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create.liquid b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create.liquid
index 55e3b14..3ac488c 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create.liquid
@@ -5,7 +5,7 @@
sign_in user_id: object.id
session original_user_id = object.current_user_id
- assign event_object = null | hash_merge: actor_id: object.current_user_id, target_id: object.user_id
+ assign event_object = {"actor_id": object.current_user_id, "target_id": object.user_id}
function _ = 'modules/core/commands/events/publish', type: 'impersonation_started', object: event_object, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create/check.liquid b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create/check.liquid
index 3298544..6441fe5 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/create/check.liquid
@@ -1,11 +1,11 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'current_user_id'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy.liquid b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy.liquid
index d50546a..d7f58b4 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy.liquid
@@ -6,7 +6,7 @@
sign_in user_id: object.id
session original_user_id = null
- assign event_object = null | hash_merge: actor_id: object.id , impersonated_user_id: object.current_user_id
+ assign event_object = {"actor_id": object.id, "impersonated_user_id": object.current_user_id}
function _ = 'modules/core/commands/events/publish', type: 'impersonation_ended', object: event_object, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid
index 3298544..6441fe5 100644
--- a/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid
@@ -1,11 +1,11 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'current_user_id'
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/create.liquid b/pos-module-chat/modules/user/public/lib/commands/user/create.liquid
index 29331b6..c779f20 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/create.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/create.liquid
@@ -17,14 +17,14 @@
function object = 'modules/user/commands/user/create/check', object: object
if object.valid
function user = 'modules/core/commands/execute', mutation_name: 'modules/user/user/create', object: object, selection: 'user'
- hash_assign object['user_id'] = user.id
+ assign object.user_id = user.id
function profile = 'modules/user/commands/profiles/create', object: object
if profile.valid != true
return profile
endif
- assign event_payload = null | hash_merge: user_id: user.id
+ assign event_payload = {"user_id": user.id}
function _ = 'modules/core/commands/events/publish', type: 'user_created', object: event_payload, delay: null, max_attempts: null
return user
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/create/build.liquid b/pos-module-chat/modules/user/public/lib/commands/user/create/build.liquid
index 361605f..29e474d 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/create/build.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/create/build.liquid
@@ -8,6 +8,6 @@
}
{% endparse_json %}
-{% hash_assign object['roles'] = roles %}
+{% assign object.roles = roles %}
{% return object %}
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/create/check.liquid b/pos-module-chat/modules/user/public/lib/commands/user/create/check.liquid
index ca33f4e..6ed650f 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/create/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/create/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'first_name'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'last_name'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'password'
@@ -16,8 +16,8 @@
endif
endif
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid b/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid
index 31ba099..4826eb0 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid
@@ -8,11 +8,11 @@
graphql user = 'modules/user/user/delete', id: id
unless user.errors
- assign params = '{}' | parse_json | hash_merge: user: user.user
+ assign params = { "user": user.user }
function results = 'modules/core/commands/hook/fire', hook: 'user_delete', params: params, merge_to_object: null
- hash_assign user['hook_results'] = results
+ assign user.hook_results = results
- assign event_payload = null | hash_merge: user_id: id
+ assign event_payload = {"user_id": id}
function _ = 'modules/core/commands/events/publish', type: 'user_deleted', object: event_payload, delay: null, max_attempts: null
endunless
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/update.liquid b/pos-module-chat/modules/user/public/lib/commands/user/update.liquid
index d2502fa..eab0c9b 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/update.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/update.liquid
@@ -15,23 +15,23 @@
if object.valid
graphql user = 'modules/user/user/update', args: object
- hash_assign object['update_result'] = user
+ assign object.update_result = user
unless user.errors
- assign params = '{}' | parse_json | hash_merge: updated_user: user.user, hook_params: hook_params
+ assign params = { "updated_user": user.user, "hook_params": hook_params }
# todo: merge_to_object for hooks with the same name will overwrite the validity of previous results
function results = 'modules/core/commands/hook/fire', hook: 'user_update', params: params, merge_to_object: true
for result in results
# using the errors key for a quick workaround for now
if result[1].valid == false or result[1].errors != blank
- hash_assign object['valid'] = false
- hash_assign object['errors'] = result[1].errors
+ assign object.valid = false
+ assign object.errors = result[1].errors
break
endif
endfor
- hash_assign object['hook_results'] = results
+ assign object.hook_results = results
endunless
- assign event_payload = null | hash_merge: user_id: object.id
+ assign event_payload = {"user_id": object.id}
function _ = 'modules/core/commands/events/publish', type: 'user_updated', object: event_payload, delay: null, max_attempts: null
endif
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/update/check.liquid b/pos-module-chat/modules/user/public/lib/commands/user/update/check.liquid
index 3719f9e..8b83498 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/update/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/update/check.liquid
@@ -1,12 +1,12 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
if object['email']
function c = 'modules/core/validations/email', c: c, object: object, field_name: 'email'
endif
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/commands/user/verify_password/check.liquid b/pos-module-chat/modules/user/public/lib/commands/user/verify_password/check.liquid
index 19a55b6..390b6df 100644
--- a/pos-module-chat/modules/user/public/lib/commands/user/verify_password/check.liquid
+++ b/pos-module-chat/modules/user/public/lib/commands/user/verify_password/check.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/email', c: c, object: object, field_name: 'email'
function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'email'
@@ -10,11 +10,11 @@
assign user = user.users.results.first
function c = 'modules/core/validations/truthy', c: c, field_name: 'password', object: user.authenticate, key: 'modules/user/validation.invalid_email_or_password'
- hash_assign object['id'] = user.id
+ assign object.id = user.id
endif
- hash_assign object['valid'] = c.valid
- hash_assign object['errors'] = c.errors
+ assign object.valid = c.valid
+ assign object.errors = c.errors
return object
%}
diff --git a/pos-module-chat/modules/user/public/lib/events/authentication_link_created.liquid b/pos-module-chat/modules/user/public/lib/events/authentication_link_created.liquid
index 6a9dfa1..d770000 100644
--- a/pos-module-chat/modules/user/public/lib/events/authentication_link_created.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/authentication_link_created.liquid
@@ -4,7 +4,7 @@ metadata:
email
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'email'
diff --git a/pos-module-chat/modules/user/public/lib/events/impersonation_ended.liquid b/pos-module-chat/modules/user/public/lib/events/impersonation_ended.liquid
index 0281e88..4fac38b 100644
--- a/pos-module-chat/modules/user/public/lib/events/impersonation_ended.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/impersonation_ended.liquid
@@ -5,7 +5,7 @@ metadata:
impersonation_ended
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'actor_id'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'impersonation_ended'
diff --git a/pos-module-chat/modules/user/public/lib/events/impersonation_started.liquid b/pos-module-chat/modules/user/public/lib/events/impersonation_started.liquid
index 258fb32..ae05962 100644
--- a/pos-module-chat/modules/user/public/lib/events/impersonation_started.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/impersonation_started.liquid
@@ -6,7 +6,7 @@ metadata:
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'actor_id'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'target_id'
diff --git a/pos-module-chat/modules/user/public/lib/events/password_created.liquid b/pos-module-chat/modules/user/public/lib/events/password_created.liquid
index 427444a..fb629b9 100644
--- a/pos-module-chat/modules/user/public/lib/events/password_created.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/password_created.liquid
@@ -4,7 +4,7 @@ metadata:
user_id
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'user_id'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_created.liquid b/pos-module-chat/modules/user/public/lib/events/user_created.liquid
index 427444a..fb629b9 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_created.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_created.liquid
@@ -4,7 +4,7 @@ metadata:
user_id
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'user_id'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_deleted.liquid b/pos-module-chat/modules/user/public/lib/events/user_deleted.liquid
index 427444a..fb629b9 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_deleted.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_deleted.liquid
@@ -4,7 +4,7 @@ metadata:
user_id
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'user_id'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_logout.liquid b/pos-module-chat/modules/user/public/lib/events/user_logout.liquid
index 427444a..fb629b9 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_logout.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_logout.liquid
@@ -4,7 +4,7 @@ metadata:
user_id
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'user_id'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_role_appended.liquid b/pos-module-chat/modules/user/public/lib/events/user_role_appended.liquid
index a0936bb..c387738 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_role_appended.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_role_appended.liquid
@@ -5,7 +5,7 @@ metadata:
role
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'profile_id'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'role'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_role_removed.liquid b/pos-module-chat/modules/user/public/lib/events/user_role_removed.liquid
index a0936bb..c387738 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_role_removed.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_role_removed.liquid
@@ -5,7 +5,7 @@ metadata:
role
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'profile_id'
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'role'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_roles_set.liquid b/pos-module-chat/modules/user/public/lib/events/user_roles_set.liquid
index 65253d7..591cfb4 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_roles_set.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_roles_set.liquid
@@ -5,7 +5,7 @@ metadata:
roles
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'profile_id'
function c = 'modules/core/validations/length', c: c, object: event, field_name: 'roles', minimum: 0, allow_blank: false
diff --git a/pos-module-chat/modules/user/public/lib/events/user_signed_in.liquid b/pos-module-chat/modules/user/public/lib/events/user_signed_in.liquid
index 427444a..fb629b9 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_signed_in.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_signed_in.liquid
@@ -4,7 +4,7 @@ metadata:
user_id
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'user_id'
diff --git a/pos-module-chat/modules/user/public/lib/events/user_updated.liquid b/pos-module-chat/modules/user/public/lib/events/user_updated.liquid
index 427444a..fb629b9 100644
--- a/pos-module-chat/modules/user/public/lib/events/user_updated.liquid
+++ b/pos-module-chat/modules/user/public/lib/events/user_updated.liquid
@@ -4,7 +4,7 @@ metadata:
user_id
---
{% liquid
- assign c = '{ "errors": {}, "valid": true }' | parse_json
+ assign c = { "errors": {}, "valid": true }
function c = 'modules/core/validations/presence', c: c, object: event, field_name: 'user_id'
diff --git a/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid b/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid
index 460352f..3dc7e45 100644
--- a/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid
+++ b/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid
@@ -1,17 +1,17 @@
{% liquid
function user = 'modules/user/queries/user/current'
if user.id == null
- assign current_profile = '{ "user": null, "roles": ["anonymous"] }' | parse_json
+ assign current_profile = { "user": null, "roles": ["anonymous"] }
else
function current_profile = 'modules/user/queries/profiles/find', user_id: user.id, id: null, uuid: null, first_name: null, last_name: null
- assign current_profile = current_profile | hash_merge: user: user
+ assign current_profile.user = user
if current_profile.roles != null
- hash_assign current_profile['roles'] = current_profile.roles | array_add: 'authenticated'
+ assign current_profile.roles << 'authenticated'
else
- hash_assign current_profile['roles'] = '["authenticated"]' | parse_json
+ assign current_profile.roles = ["authenticated"]
endif
endif
export current_profile
return current_profile
-%}
+ %}
diff --git a/pos-module-chat/modules/user/public/lib/helpers/flash.liquid b/pos-module-chat/modules/user/public/lib/helpers/flash.liquid
index 5087333..7779ad6 100644
--- a/pos-module-chat/modules/user/public/lib/helpers/flash.liquid
+++ b/pos-module-chat/modules/user/public/lib/helpers/flash.liquid
@@ -14,7 +14,7 @@
assign message = info | t
assign severity = 'info'
endif
- assign flash = null | hash_merge: message: message, severity: severity, from: context.location.pathname, force_clear: force_clear
+ assign flash = {"message": message, "severity": severity, "from": context.location.pathname, "force_clear": force_clear}
function _ = 'modules/core/commands/session/set', key: 'sflash', value: flash
diff --git a/pos-module-chat/modules/user/public/lib/helpers/get_available_oauth_providers.liquid b/pos-module-chat/modules/user/public/lib/helpers/get_available_oauth_providers.liquid
index 86ceef8..7153b6c 100644
--- a/pos-module-chat/modules/user/public/lib/helpers/get_available_oauth_providers.liquid
+++ b/pos-module-chat/modules/user/public/lib/helpers/get_available_oauth_providers.liquid
@@ -1,5 +1,5 @@
{% liquid
- assign available_providers = "{}" | parse_json
+ assign available_providers = {}
assign keys = context.constants | hash_keys
for item in keys
assign starts_with = item | start_with: "OAUTH2_"
@@ -12,13 +12,9 @@
assign client_id_key = "OAUTH2_" | append: provider_id | append: "_CLIENT_ID"
assign secret_value_key = "OAUTH2_" | append: provider_id | append: "_SECRET_VALUE"
- assign provider_data = "{}" | parse_json
- hash_assign provider_data['key'] = context.constants[provider_key]
- hash_assign provider_data['name'] = context.constants[name_key]
- hash_assign provider_data['client_id'] = context.constants[client_id_key]
- hash_assign provider_data['secret_value'] = context.constants[secret_value_key]
+ assign provider_data = { "key": context.constants[provider_key], "name": context.constants[name_key], "client_id": context.constants[client_id_key], "secret_value": context.constants[secret_value_key] }
- hash_assign available_providers[provider_id] = provider_data
+ assign available_providers[provider_id] = provider_data
endif
endfor
diff --git a/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid b/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid
index 0e490b4..85b367f 100644
--- a/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid
+++ b/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid
@@ -1,15 +1,13 @@
-{% parse_json sort_options %}
-{
- "first_name_desc": { "properties": { "name": "first_name", "order": "DESC" }},
- "first_name_desc": { "properties": { "name": "first_name", "order": "ASC" }}
-}
-{% endparse_json %}
{% liquid
- assign filters = '{}' | parse_json
- hash_assign filters['page'] = params.page | to_positive_integer: 1
- hash_assign filters['keyword'] = params.keyword | default: ''
- hash_assign filters['sort_by'] = params.sort_by | default: 'first_name_desc'
- hash_assign filters['sort'] = sort_options[filters.sort_by]
+ assign sort_options = {
+ "first_name_desc": { "properties": { "name": "first_name", "order": "DESC" }},
+ "first_name_asc": { "properties": { "name": "first_name", "order": "ASC" }}
+ }
+ assign filters = {}
+ assign filters.page = params.page | to_positive_integer: 1
+ assign filters.keyword = params.keyword | default: ''
+ assign filters.sort_by = params.sort_by | default: 'first_name_desc'
+ assign filters.sort = sort_options[filters.sort_by]
return filters
-%}
+ %}
diff --git a/pos-module-chat/modules/user/public/lib/queries/profiles/find.liquid b/pos-module-chat/modules/user/public/lib/queries/profiles/find.liquid
index 9c64092..aceb24e 100644
--- a/pos-module-chat/modules/user/public/lib/queries/profiles/find.liquid
+++ b/pos-module-chat/modules/user/public/lib/queries/profiles/find.liquid
@@ -9,7 +9,7 @@
if profile
function slug = 'modules/user/helpers/profiles/slugs/build', current_profile: profile
- hash_assign profile['slug'] = slug
+ assign profile.slug = slug
endif
return profile
diff --git a/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid b/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid
index ec4ed53..1e0ef38 100644
--- a/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid
+++ b/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid
@@ -7,16 +7,16 @@
graphql r = 'modules/user/profiles/search', limit: limit, uuid: uuid, id: id, ids: ids, first_name: first_name , last_name: last_name , user_id: user_id, not_ids: not_ids, query: query, emails: emails, sort: sort, page: page
assign records = r.records
- assign profiles = '[]' | parse_json
+ assign profiles = []
for profile in records.results
function slug = 'modules/user/helpers/profiles/slugs/build' , current_profile: profile
- hash_assign profile['slug'] = slug
+ assign profile.slug = slug
assign p = profile
- assign profiles = profiles | array_add: p
+ assign profiles << p
endfor
- hash_assign records['results'] = profiles
+ assign records.results = profiles
return records
-%}
+ %}
diff --git a/pos-module-chat/modules/user/public/views/pages/passwords/create.liquid b/pos-module-chat/modules/user/public/views/pages/passwords/create.liquid
index d2a7438..4b84587 100644
--- a/pos-module-chat/modules/user/public/views/pages/passwords/create.liquid
+++ b/pos-module-chat/modules/user/public/views/pages/passwords/create.liquid
@@ -5,7 +5,7 @@ method: post
{% liquid
assign input = context.params.password
assign redirect_url = context.params.redirect_to | default: '/'
- hash_assign input['user_id'] = context.session.reset_password_session_user_id
+ assign input.user_id = context.session.reset_password_session_user_id
function object = 'modules/user/commands/passwords/create', object: input
if object.valid
diff --git a/pos-module-chat/modules/user/public/views/pages/users/create.liquid b/pos-module-chat/modules/user/public/views/pages/users/create.liquid
index 35ff4a8..73711c3 100644
--- a/pos-module-chat/modules/user/public/views/pages/users/create.liquid
+++ b/pos-module-chat/modules/user/public/views/pages/users/create.liquid
@@ -12,11 +12,10 @@ slug: users
function _ = 'modules/user/commands/session/create', user_id: object.id, validate_password: false, email: null, password: null, hook_params: null
include 'modules/core/helpers/redirect_to'
else
- assign values = object | default: null | hash_merge: password: ''
-
function registration_fields = 'modules/user/queries/registration_fields/load'
- assign values = params | hash_merge: password: ''
+ assign values = params
+ assign values.password = ''
render 'modules/user/users/new', context: context, registration_fields: registration_fields, errors: object.errors, values: values
endif
%}
diff --git a/pos-module-chat/modules/user/public/views/pages/users/new.liquid b/pos-module-chat/modules/user/public/views/pages/users/new.liquid
index 8affc3d..c2fc4c3 100644
--- a/pos-module-chat/modules/user/public/views/pages/users/new.liquid
+++ b/pos-module-chat/modules/user/public/views/pages/users/new.liquid
@@ -4,7 +4,7 @@
include 'modules/user/helpers/can_do_or_redirect', requester: current_profile, do: 'users.register', redirect_url: "/"
function registration_fields = 'modules/user/queries/registration_fields/load'
- assign values = null | hash_merge: email: context.params.email
+ assign values = {"email": context.params.email}
render 'modules/user/users/new', context: context, registration_fields: registration_fields, values: values
%}
diff --git a/pos-module-chat/modules/user/public/views/partials/admin_pages/list.liquid b/pos-module-chat/modules/user/public/views/partials/admin_pages/list.liquid
index 61021c0..dcffe61 100644
--- a/pos-module-chat/modules/user/public/views/partials/admin_pages/list.liquid
+++ b/pos-module-chat/modules/user/public/views/partials/admin_pages/list.liquid
@@ -1,7 +1,7 @@
{% function users = 'modules/user/queries/user/get_all' %}
- {% theme_render_rc 'components/atoms/heading', content: 'Users', level: 2, classes: 'pb-8' %}
+
Users
diff --git a/pos-module-chat/package.json b/pos-module-chat/package.json
index 768f295..e5c4790 100644
--- a/pos-module-chat/package.json
+++ b/pos-module-chat/package.json
@@ -1,11 +1,11 @@
{
"scripts": {
+ "postinstall": "npx playwright install chromium",
"pw-tests": "playwright test tests --project=test --reporter=list",
- "test": "playwright test",
- "install: playwright": "npx playwright install"
+ "test": "playwright test"
},
"devDependencies": {
- "@playwright/test": "^1.49.1",
+ "@playwright/test": "^1.58.2",
"@types/node": "^22.10.6"
}
}
diff --git a/pos-module-chat/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid b/pos-module-chat/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid
index 2129104..6e2b45b 100644
--- a/pos-module-chat/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid
+++ b/pos-module-chat/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid
@@ -10,19 +10,19 @@
assign name = first_name | append: " " | append: last_name
assign email = "dummy" | append: i | append: "@example.com"
- assign object = null
- assign object = object | hash_merge: email: email
- assign object = object | hash_merge: password: password
- assign object = object | hash_merge: first_name: first_name
- assign object = object | hash_merge: last_name: last_name
- assign object = object | hash_merge: name: name
+ assign object = {}
+ assign object.email = email
+ assign object.password = password
+ assign object.first_name = first_name
+ assign object.last_name = last_name
+ assign object.name = name
function user = 'modules/core/commands/execute', mutation_name: 'modules/user/user/create', object: object, selection: 'user'
- hash_assign object['user_id'] = user.id
+ assign object.user_id = user.id
function profile = 'modules/user/commands/profiles/create', object: object
- assign event_payload = null | hash_merge: user_id: user.id
+ assign event_payload = {"user_id": user.id}
function _ = 'modules/core/commands/events/publish', type: 'user_created', object: event_payload, delay: null, max_attempts: null
endfor
%}
diff --git a/pos-module-chat/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid b/pos-module-chat/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid
index 2ef5e2f..879fc4d 100644
--- a/pos-module-chat/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid
+++ b/pos-module-chat/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid
@@ -16,9 +16,9 @@
assign participant_ids = "" | append: seeded_participant_id | append: "," | append: migrated_participant_id | split: ","
assign participant_read_ids = "" | append: seeded_participant_id
- assign object = null
- assign object = object | hash_merge: participant_ids: participant_ids
- assign object = object | hash_merge: participant_read_ids: participant_read_ids
+ assign object = {}
+ assign object.participant_ids = participant_ids
+ assign object.participant_read_ids = participant_read_ids
function conversation = 'modules/core/commands/execute', mutation_name: 'modules/chat/conversations/create' object: object, selection: 'record_create'
comment
@@ -26,14 +26,14 @@
endcomment
assign messageText = "" | append: "This is migrated message from " | append: seeded_participant_email | append: " to " | append: migrated_participant_email
- assign object = null
- assign object = object | hash_merge: autor_id: seeded_participant_id
- assign object = object | hash_merge: conversation_id: conversation.id
- assign object = object | hash_merge: message: messageText
+ assign object = {}
+ assign object.autor_id = seeded_participant_id
+ assign object.conversation_id = conversation.id
+ assign object.message = messageText
function message = 'modules/core/commands/execute', mutation_name: 'modules/chat/messages/create' object: object, selection: 'record_create'
- assign event_object = null | hash_merge: message_id: object.id, app_host: context.location.host
+ assign event_object = {"message_id": object.id, "app_host": context.location.host}
function _ = 'modules/core/commands/events/publish', type: 'chat_message_created', object: event_object, delay: null, max_attempts: null
endfor
%}
diff --git a/pos-module-common-styling/app/lib/presign_upload.liquid b/pos-module-common-styling/app/lib/presign_upload.liquid
index 4947387..456a3de 100644
--- a/pos-module-common-styling/app/lib/presign_upload.liquid
+++ b/pos-module-common-styling/app/lib/presign_upload.liquid
@@ -1,4 +1,4 @@
{% liquid
function presigned_upload = 'queries/uploads/presign', table: 'uploads', property: 'upload'
- hash_assign context['presigned_upload'] = presigned_upload
+ assign context.presigned_upload = presigned_upload
%}
\ No newline at end of file
diff --git a/pos-module-common-styling/app/lib/queries/uploads/presign.liquid b/pos-module-common-styling/app/lib/queries/uploads/presign.liquid
index 0ac9837..2cf77c9 100644
--- a/pos-module-common-styling/app/lib/queries/uploads/presign.liquid
+++ b/pos-module-common-styling/app/lib/queries/uploads/presign.liquid
@@ -1,3 +1,7 @@
+{% doc %}
+ @param {string} table - database table name
+ @param {string} property - property name for the upload
+{% enddoc %}
{% liquid
graphql presign = 'uploads/presign', table: table, property: property
diff --git a/pos-module-common-styling/modules/common-styling/public/views/layouts/style-guide.liquid b/pos-module-common-styling/modules/common-styling/public/views/layouts/style-guide.liquid
index f0798bc..b4d5ccf 100644
--- a/pos-module-common-styling/modules/common-styling/public/views/layouts/style-guide.liquid
+++ b/pos-module-common-styling/modules/common-styling/public/views/layouts/style-guide.liquid
@@ -19,7 +19,7 @@
{{ content_for_layout }}
{% liquid
- render 'modules/common-styling/toasts'
+ render 'modules/common-styling/toasts', autohide: null, delay: null, message: null, severity: null
%}