@controleonline/ui-crm 1.0.42 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/integration-source-gate.yml +82 -0
- package/.github/workflows/manager-worker.yml +7 -155
- package/.github/workflows/publish-npm.yml +73 -22
- package/AGENTS.md +2 -0
- package/package.json +2 -2
- package/src/react/pages/crm/hooks/useCrmData.js +23 -17
- package/src/react/pages/proposals/CreateProposalsModal.js +1 -0
- package/src/react/pages/proposals/index.js +14 -33
- package/src/react/pages/settings/GeneralSettings.styles.js +2 -0
- package/src/react/pages/settings/sections/LoyaltyProductPicker.js +58 -145
- package/src/react/pages/settings/sections/LoyaltySection.js +35 -9
- package/src/react/pages/settings/sections/MapsFranchisePreview.js +102 -0
- package/src/react/pages/settings/sections/MapsMapasControls.js +262 -0
- package/src/react/pages/settings/sections/MapsSection.js +71 -247
- package/src/react/pages/settings/sections/loyaltyProductCompany.js +57 -0
- package/src/react/pages/settings/sections/mapsSectionHelpers.js +137 -0
- package/src/react/pages/settings/sections/shop/ShopFranchiseLocatorSection.js +7 -28
- package/src/react/pages/settings/sections/shop/ShopLoyaltySection.js +54 -8
- package/src/react/pages/settings/sections/shop/shopSettingsShared.js +32 -11
- package/src/react/utils/clientDetailsNavigation.js +56 -0
- package/src/react/utils/clientSellerVisibility.js +60 -0
- package/src/react/utils/proposalProductSelection.js +103 -13
- package/src/react/utils/proposalStatus.js +160 -0
- package/src/tests/browser/crm/create-proposal-product-category-filter.spec.js +25 -0
- package/src/tests/browser/manager/general-settings-maps.spec.js +173 -347
- package/src/tests/react/pages/settings/sections/loyaltyProductCompany.test.js +41 -0
- package/src/tests/react/pages/settings/sections/mapsSectionHelpers.test.js +38 -0
- package/src/tests/react/utils/clientDetailsNavigation.test.js +98 -0
- package/src/tests/react/utils/clientSellerVisibility.test.js +74 -0
- package/src/tests/react/utils/proposalProductSelection.test.js +57 -1
- package/src/tests/react/utils/proposalStatus.test.mjs +77 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: Integration source gate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [dev, staging, master]
|
|
6
|
+
types: [opened, synchronize, reopened, edited, ready_for_review]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pull-requests: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
source-policy:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Enforce task or frozen RC source
|
|
17
|
+
env:
|
|
18
|
+
HEAD_REF: ${{ github.head_ref }}
|
|
19
|
+
BASE_REF: ${{ github.base_ref }}
|
|
20
|
+
run: |
|
|
21
|
+
set -eu
|
|
22
|
+
if [ "$BASE_REF" = "dev" ]; then
|
|
23
|
+
echo "$HEAD_REF" | grep -Eq '^task-[1-9][0-9]*$' || {
|
|
24
|
+
echo "::error::dev only accepts task-<numeric issue>."
|
|
25
|
+
exit 1
|
|
26
|
+
}
|
|
27
|
+
exit 0
|
|
28
|
+
fi
|
|
29
|
+
echo "$HEAD_REF" | grep -Eq '^rc/[0-9]+\.[0-9]+\.[0-9]+-rc\.[1-9][0-9]*$' || {
|
|
30
|
+
echo "::error::$BASE_REF only accepts a frozen rc/X.Y.Z-rc.N source."
|
|
31
|
+
exit 1
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
if: github.base_ref != 'dev'
|
|
36
|
+
with:
|
|
37
|
+
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
38
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
39
|
+
persist-credentials: false
|
|
40
|
+
|
|
41
|
+
- name: Validate checked-out pull request head
|
|
42
|
+
if: github.base_ref != 'dev'
|
|
43
|
+
env:
|
|
44
|
+
EXPECTED_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
45
|
+
run: |
|
|
46
|
+
set -eu
|
|
47
|
+
actual=$(git rev-parse HEAD)
|
|
48
|
+
test "$actual" = "$EXPECTED_HEAD_SHA" || {
|
|
49
|
+
echo "::error::Checked out $actual, expected pull request head $EXPECTED_HEAD_SHA."
|
|
50
|
+
exit 1
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- name: Validate frozen RC manifest
|
|
54
|
+
if: github.base_ref != 'dev'
|
|
55
|
+
env:
|
|
56
|
+
HEAD_REF: ${{ github.head_ref }}
|
|
57
|
+
run: |
|
|
58
|
+
set -eu
|
|
59
|
+
test -f .release/rc-manifest.json || {
|
|
60
|
+
echo "::error::Missing .release/rc-manifest.json"
|
|
61
|
+
exit 1
|
|
62
|
+
}
|
|
63
|
+
node --input-type=module <<'NODE'
|
|
64
|
+
import fs from 'node:fs';
|
|
65
|
+
const m = JSON.parse(fs.readFileSync('.release/rc-manifest.json', 'utf8'));
|
|
66
|
+
const branch = process.env.HEAD_REF;
|
|
67
|
+
const match = /^rc\/(\d+\.\d+\.\d+)-rc\.([1-9][0-9]*)$/.exec(branch);
|
|
68
|
+
if (!match) throw new Error('invalid RC branch');
|
|
69
|
+
if (m.branch !== branch || m.version !== match[1] || Number(m.rc) !== Number(match[2])) throw new Error('manifest identity mismatch');
|
|
70
|
+
if (m.frozen !== true) throw new Error('manifest is not frozen');
|
|
71
|
+
if (!Array.isArray(m.tasks) || m.tasks.length < 1 || m.tasks.length > 5) throw new Error('RC must contain 1..5 tasks');
|
|
72
|
+
const tasks = m.tasks.map(Number);
|
|
73
|
+
if (tasks.some((id) => !Number.isInteger(id) || id < 1)) throw new Error('invalid task id');
|
|
74
|
+
if (new Set(tasks).size !== tasks.length) throw new Error('duplicate RC tasks');
|
|
75
|
+
if (!/^[0-9a-f]{40}$/i.test(String(m.baseMaster || ''))) throw new Error('invalid baseMaster');
|
|
76
|
+
const repos = m.repositories || {};
|
|
77
|
+
if (!Object.keys(repos).length) throw new Error('empty repositories manifest');
|
|
78
|
+
for (const [repo, sha] of Object.entries(repos)) {
|
|
79
|
+
if (!/^ControleOnline\/[A-Za-z0-9_.-]+$/.test(repo) || !/^[0-9a-f]{40}$/i.test(String(sha))) throw new Error('invalid repository manifest entry');
|
|
80
|
+
}
|
|
81
|
+
console.log('Frozen RC manifest valid:', branch, tasks);
|
|
82
|
+
NODE
|
|
@@ -1,167 +1,19 @@
|
|
|
1
1
|
name: Manager Worker
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
# PAUSA CTO ControleOnline/agents-mcp#201 (2026-08-29)
|
|
7
|
+
# Trigger original desativado: push em master, dev, staging.
|
|
6
8
|
|
|
7
9
|
permissions:
|
|
8
|
-
contents:
|
|
10
|
+
contents: read
|
|
9
11
|
issues: write
|
|
10
12
|
pull-requests: write
|
|
11
13
|
|
|
12
|
-
# Orquestrador: Manager resolve/cria issue e decide quais workers invocar.
|
|
13
|
-
# Padrão de branch da org = master (não usar main).
|
|
14
14
|
jobs:
|
|
15
15
|
manager:
|
|
16
|
-
name: Manager —
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
outputs:
|
|
19
|
-
issue_number: ${{ steps.mgr.outputs.issue_number }}
|
|
20
|
-
created: ${{ steps.mgr.outputs.created }}
|
|
21
|
-
run_qa: ${{ steps.mgr.outputs.run_qa }}
|
|
22
|
-
run_security: ${{ steps.mgr.outputs.run_security }}
|
|
23
|
-
run_docs: ${{ steps.mgr.outputs.run_docs }}
|
|
24
|
-
run_gates: ${{ steps.mgr.outputs.run_gates }}
|
|
25
|
-
base_branch: ${{ steps.mgr.outputs.base_branch }}
|
|
26
|
-
steps:
|
|
27
|
-
- uses: actions/checkout@v4
|
|
28
|
-
with:
|
|
29
|
-
fetch-depth: 0
|
|
30
|
-
|
|
31
|
-
- name: Manager subworker
|
|
32
|
-
id: mgr
|
|
33
|
-
uses: ./.github/actions/workers/manager
|
|
34
|
-
with:
|
|
35
|
-
gh_token: ${{ secrets.GH_TOKEN }}
|
|
36
|
-
branch: ${{ github.ref_name }}
|
|
37
|
-
|
|
38
|
-
# Workers invocados pelo plano do Manager (paralelo quando ambos true)
|
|
39
|
-
qa:
|
|
40
|
-
name: QA (invocado pelo Manager)
|
|
41
|
-
needs: manager
|
|
42
|
-
if: needs.manager.outputs.run_qa == 'true'
|
|
43
|
-
runs-on: ubuntu-latest
|
|
44
|
-
steps:
|
|
45
|
-
- uses: actions/checkout@v4
|
|
46
|
-
- uses: ./.github/actions/workers/qa
|
|
47
|
-
with:
|
|
48
|
-
gh_token: ${{ secrets.GH_TOKEN }}
|
|
49
|
-
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
50
|
-
base_branch: ${{ needs.manager.outputs.base_branch }}
|
|
51
|
-
|
|
52
|
-
security:
|
|
53
|
-
name: Security (invocado pelo Manager)
|
|
54
|
-
needs: manager
|
|
55
|
-
if: needs.manager.outputs.run_security == 'true'
|
|
56
|
-
runs-on: ubuntu-latest
|
|
57
|
-
steps:
|
|
58
|
-
- uses: actions/checkout@v4
|
|
59
|
-
- uses: ./.github/actions/workers/security
|
|
60
|
-
with:
|
|
61
|
-
gh_token: ${{ secrets.GH_TOKEN }}
|
|
62
|
-
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
63
|
-
base_branch: ${{ needs.manager.outputs.base_branch }}
|
|
64
|
-
|
|
65
|
-
technical-documenter:
|
|
66
|
-
name: Technical Documenter (invocado pelo Manager)
|
|
67
|
-
needs: manager
|
|
68
|
-
if: needs.manager.outputs.run_docs == 'true'
|
|
69
|
-
runs-on: ubuntu-latest
|
|
70
|
-
steps:
|
|
71
|
-
- uses: actions/checkout@v4
|
|
72
|
-
- uses: ./.github/actions/workers/technical-documenter
|
|
73
|
-
with:
|
|
74
|
-
gh_token: ${{ secrets.GH_TOKEN }}
|
|
75
|
-
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
76
|
-
base_branch: ${{ needs.manager.outputs.base_branch }}
|
|
77
|
-
|
|
78
|
-
# master: se faltar gate do quarteto → tags + workers faltantes
|
|
79
|
-
master-gates:
|
|
80
|
-
name: Master gates (quarteto)
|
|
81
|
-
needs: manager
|
|
82
|
-
if: needs.manager.outputs.run_gates == 'true'
|
|
83
|
-
runs-on: ubuntu-latest
|
|
84
|
-
outputs:
|
|
85
|
-
need_qa: ${{ steps.check.outputs.need_qa }}
|
|
86
|
-
need_security: ${{ steps.check.outputs.need_security }}
|
|
87
|
-
need_docs: ${{ steps.check.outputs.need_docs }}
|
|
88
|
-
steps:
|
|
89
|
-
- uses: actions/checkout@v4
|
|
90
|
-
- name: Inspect quarteto e tags
|
|
91
|
-
id: check
|
|
92
|
-
env:
|
|
93
|
-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
94
|
-
ISSUE: ${{ needs.manager.outputs.issue_number }}
|
|
95
|
-
REPO: ${{ github.repository }}
|
|
96
|
-
run: |
|
|
97
|
-
set -euo pipefail
|
|
98
|
-
LABELS=$(gh issue view "$ISSUE" --repo "$REPO" --json labels --jq '[.labels[].name] | join(",")')
|
|
99
|
-
echo "Labels: $LABELS"
|
|
100
|
-
|
|
101
|
-
need_qa=false
|
|
102
|
-
need_security=false
|
|
103
|
-
need_docs=false
|
|
104
|
-
|
|
105
|
-
echo "$LABELS" | grep -q 'qa:accepted' || need_qa=true
|
|
106
|
-
echo "$LABELS" | grep -q 'security:accepted' || need_security=true
|
|
107
|
-
echo "$LABELS" | grep -q 'agent:technical-documenter:done' || need_docs=true
|
|
108
|
-
|
|
109
|
-
echo "need_qa=$need_qa" >> "$GITHUB_OUTPUT"
|
|
110
|
-
echo "need_security=$need_security" >> "$GITHUB_OUTPUT"
|
|
111
|
-
echo "need_docs=$need_docs" >> "$GITHUB_OUTPUT"
|
|
112
|
-
|
|
113
|
-
[ "$need_qa" = true ] && gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:qa" || true
|
|
114
|
-
[ "$need_security" = true ] && gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:security" || true
|
|
115
|
-
[ "$need_docs" = true ] && gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:technical-documenter" || true
|
|
116
|
-
|
|
117
|
-
gh issue comment "$ISSUE" --repo "$REPO" --body \
|
|
118
|
-
"Master gates (Manager): need_qa=$need_qa need_security=$need_security need_docs=$need_docs"
|
|
119
|
-
|
|
120
|
-
master-qa:
|
|
121
|
-
name: QA (master gap via Manager)
|
|
122
|
-
needs: [manager, master-gates]
|
|
123
|
-
if: needs.master-gates.outputs.need_qa == 'true'
|
|
16
|
+
name: Manager — paused
|
|
124
17
|
runs-on: ubuntu-latest
|
|
125
18
|
steps:
|
|
126
|
-
-
|
|
127
|
-
- uses: ./.github/actions/workers/qa
|
|
128
|
-
with:
|
|
129
|
-
gh_token: ${{ secrets.GH_TOKEN }}
|
|
130
|
-
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
131
|
-
base_branch: master
|
|
132
|
-
|
|
133
|
-
master-security:
|
|
134
|
-
name: Security (master gap via Manager)
|
|
135
|
-
needs: [manager, master-gates]
|
|
136
|
-
if: needs.master-gates.outputs.need_security == 'true'
|
|
137
|
-
runs-on: ubuntu-latest
|
|
138
|
-
steps:
|
|
139
|
-
- uses: actions/checkout@v4
|
|
140
|
-
- uses: ./.github/actions/workers/security
|
|
141
|
-
with:
|
|
142
|
-
gh_token: ${{ secrets.GH_TOKEN }}
|
|
143
|
-
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
144
|
-
base_branch: master
|
|
145
|
-
|
|
146
|
-
# Em push para master: bump patch + cria tag vX.Y.Z (dispara publish-npm.yml)
|
|
147
|
-
# Ignora commits de release ([skip bump]) para evitar loop.
|
|
148
|
-
version-tag:
|
|
149
|
-
name: Bump version + tag
|
|
150
|
-
if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip bump]')
|
|
151
|
-
runs-on: ubuntu-latest
|
|
152
|
-
steps:
|
|
153
|
-
- uses: actions/checkout@v4
|
|
154
|
-
with:
|
|
155
|
-
fetch-depth: 0
|
|
156
|
-
token: ${{ secrets.GH_TOKEN }}
|
|
157
|
-
|
|
158
|
-
- uses: actions/setup-node@v4
|
|
159
|
-
with:
|
|
160
|
-
node-version: '24'
|
|
161
|
-
|
|
162
|
-
- name: Bump patch + tag
|
|
163
|
-
run: |
|
|
164
|
-
git config user.name "github-actions[bot]"
|
|
165
|
-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
166
|
-
npm version patch -m "chore(release): %s [skip bump]"
|
|
167
|
-
git push origin HEAD:master --follow-tags
|
|
19
|
+
- run: echo "Manager Worker paused by ControleOnline/agents-mcp#201"
|
|
@@ -2,39 +2,90 @@ name: Publish Package to npmjs
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
5
|
|
|
8
6
|
permissions:
|
|
7
|
+
contents: write
|
|
9
8
|
id-token: write
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.repository }}-npm-release
|
|
12
|
+
cancel-in-progress: false
|
|
11
13
|
|
|
12
14
|
jobs:
|
|
13
15
|
publish:
|
|
16
|
+
if: ${{ github.repository_owner == 'ControleOnline' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) }}
|
|
14
17
|
runs-on: ubuntu-latest
|
|
15
|
-
permissions:
|
|
16
|
-
id-token: write
|
|
17
|
-
contents: read
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@v4
|
|
20
|
-
|
|
20
|
+
with:
|
|
21
|
+
ref: ${{ github.ref }}
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
- name: Validate package metadata and create version tag
|
|
24
|
+
id: release
|
|
25
|
+
env:
|
|
26
|
+
REF_TYPE: ${{ github.ref_type }}
|
|
27
|
+
REF_NAME: ${{ github.ref_name }}
|
|
28
|
+
EXPECTED_REPOSITORY: ${{ github.repository }}
|
|
29
|
+
run: |
|
|
30
|
+
node <<'NODE'
|
|
31
|
+
const fs = require('node:fs');
|
|
32
|
+
const cp = require('node:child_process');
|
|
33
|
+
const pkg = require('./package.json');
|
|
34
|
+
const expectedUrl = `https://github.com/${process.env.EXPECTED_REPOSITORY}`;
|
|
35
|
+
if (!/^\d+\.\d+\.\d+$/.test(String(pkg.version))) throw new Error(`Expected stable X.Y.Z, got ${pkg.version}`);
|
|
36
|
+
if (pkg.repository?.url !== expectedUrl) throw new Error(`repository.url must be ${expectedUrl}; got ${pkg.repository?.url}`);
|
|
37
|
+
const sourceSha = cp.execFileSync('git', ['rev-parse', 'HEAD'], {encoding:'utf8'}).trim();
|
|
38
|
+
let tag = '';
|
|
39
|
+
if (process.env.REF_TYPE === 'tag') {
|
|
40
|
+
tag = process.env.REF_NAME;
|
|
41
|
+
if (tag !== `v${pkg.version}`) throw new Error(`Tag ${tag} does not match package version ${pkg.version}`);
|
|
42
|
+
} else {
|
|
43
|
+
let previous = '';
|
|
44
|
+
try { previous = JSON.parse(cp.execFileSync('git', ['show', `${sourceSha}^:package.json`], {encoding:'utf8'})).version || ''; } catch {}
|
|
45
|
+
if (previous === pkg.version) { fs.appendFileSync(process.env.GITHUB_OUTPUT, 'release_tag=\n'); process.exit(0); }
|
|
46
|
+
const parts = String(pkg.version).split('.').map(Number);
|
|
47
|
+
if (previous) {
|
|
48
|
+
const old = String(previous).split('.').map(Number);
|
|
49
|
+
let cmp = 0; for (let i=0;i<3;i++) { if ((parts[i]||0)!==(old[i]||0)) { cmp=(parts[i]||0)>(old[i]||0)?1:-1; break; } }
|
|
50
|
+
if (cmp <= 0) throw new Error(`Version ${pkg.version} must be greater than first-parent version ${previous}`);
|
|
51
|
+
}
|
|
52
|
+
tag = `v${pkg.version}`;
|
|
53
|
+
const existing = cp.spawnSync('git', ['ls-remote', '--exit-code', '--refs', 'origin', `refs/tags/${tag}`], {encoding:'utf8'});
|
|
54
|
+
if (existing.status === 0) {
|
|
55
|
+
cp.execFileSync('git', ['fetch', 'origin', `refs/tags/${tag}:refs/tags/${tag}`], {stdio:'inherit'});
|
|
56
|
+
const tagged = cp.execFileSync('git', ['rev-parse', `${tag}^{commit}`], {encoding:'utf8'}).trim();
|
|
57
|
+
if (tagged !== sourceSha) throw new Error(`Immutable tag ${tag} already points at ${tagged}, not ${sourceSha}`);
|
|
58
|
+
} else {
|
|
59
|
+
cp.execFileSync('git', ['config', 'user.name', 'github-actions[bot]']);
|
|
60
|
+
cp.execFileSync('git', ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com']);
|
|
61
|
+
cp.execFileSync('git', ['tag', '-a', tag, sourceSha, '-m', `Release ${pkg.name}@${pkg.version}`], {stdio:'inherit'});
|
|
62
|
+
cp.execFileSync('git', ['push', 'origin', `refs/tags/${tag}`], {stdio:'inherit'});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
fs.appendFileSync(process.env.GITHUB_OUTPUT, `release_tag=${tag}\n`);
|
|
66
|
+
console.log(`Validated ${pkg.name}@${pkg.version} from ${sourceSha}; release tag ${tag}`);
|
|
67
|
+
NODE
|
|
21
68
|
- uses: actions/setup-node@v4
|
|
69
|
+
if: steps.release.outputs.release_tag != ''
|
|
22
70
|
with:
|
|
23
|
-
node-version:
|
|
24
|
-
|
|
71
|
+
node-version: 24
|
|
25
72
|
- name: Ensure npm 11.5.1+ (OIDC support)
|
|
73
|
+
if: steps.release.outputs.release_tag != ''
|
|
26
74
|
run: |
|
|
27
|
-
npm install
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
unset NODE_AUTH_TOKEN NPM_TOKEN || true
|
|
33
|
-
rm -f .npmrc "$HOME/.npmrc" || true
|
|
34
|
-
npm config delete //registry.npmjs.org/:_authToken 2>/dev/null || true
|
|
35
|
-
npm config set registry https://registry.npmjs.org/
|
|
36
|
-
|
|
37
|
-
- name: Publish to npmjs (Trusted Publishing / OIDC)
|
|
75
|
+
npm install --global npm@latest
|
|
76
|
+
npm --version
|
|
77
|
+
- name: Skip if version is already on npm
|
|
78
|
+
id: registry
|
|
79
|
+
if: steps.release.outputs.release_tag != ''
|
|
38
80
|
run: |
|
|
39
|
-
|
|
40
|
-
|
|
81
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
82
|
+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
83
|
+
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version >/dev/null 2>&1; then
|
|
84
|
+
echo 'published=true' >> "$GITHUB_OUTPUT"
|
|
85
|
+
echo "$PACKAGE_NAME@$PACKAGE_VERSION is already published; skipping duplicate publish"
|
|
86
|
+
else
|
|
87
|
+
echo 'published=false' >> "$GITHUB_OUTPUT"
|
|
88
|
+
fi
|
|
89
|
+
- name: Publish to npmjs with trusted publishing
|
|
90
|
+
if: steps.release.outputs.release_tag != '' && steps.registry.outputs.published != 'true'
|
|
91
|
+
run: npm publish --access public --loglevel verbose
|
package/AGENTS.md
CHANGED
|
@@ -26,12 +26,14 @@ Sempre comece pela **Home** da wiki e siga as categorias abaixo.
|
|
|
26
26
|
| [Oportunidades — ordenação por data de retorno](https://github.com/ControleOnline/ui-crm/wiki/Oportunidades-Ordenacao-por-Data-de-Retorno) | Ordenação client-side por dueDate/alterDate (mais antiga → mais nova) |
|
|
27
27
|
| [Income Statements — Demonstrativo geral](https://github.com/ControleOnline/ui-crm/wiki) | Visão empresa por categorias (comission/royalties); ver `docs/technical/Income-Statements-Demonstrativo.md` |
|
|
28
28
|
| [Visão Vendedor — Comissões](https://github.com/ControleOnline/ui-crm/wiki/Visao-Vendedor-Comissoes) | Invoices tipo `comission`; vendedor recebe; filtro cliente + período |
|
|
29
|
+
| [Royalties a pagar — visão Franqueado](https://github.com/ControleOnline/ui-crm/wiki/Royalties-a-pagar-Franqueado) | Invoices tipo `royalties`; franqueado paga à franqueadora; payer=currentCompany |
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
Cópias versionadas no Git:
|
|
32
33
|
- `docs/technical/Cliente-Vendedor-Vinculo-e-Permissoes.md`
|
|
33
34
|
- `docs/technical/Propostas-Filtro-de-Status.md`
|
|
34
35
|
- `docs/technical/Visao-Vendedor-Comissoes.md`
|
|
36
|
+
- `docs/technical/Royalties-a-pagar-Franqueado.md`
|
|
35
37
|
|
|
36
38
|
### Visão deste módulo
|
|
37
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@controleonline/ui-crm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.44",
|
|
4
4
|
"author": "ControleOnline",
|
|
5
5
|
"description": "ControleOnline CRM Quasar UI Component",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/
|
|
29
|
+
"url": "https://github.com/ControleOnline/ui-crm"
|
|
30
30
|
},
|
|
31
31
|
"bugs": "",
|
|
32
32
|
"homepage": "https://www.controleonline.com/devs/plugins",
|
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
} from '../../../utils/opportunityPeople';
|
|
17
17
|
|
|
18
18
|
const { getOpportunityEmptyStateMode } = require('../../../utils/opportunityEmptyState');
|
|
19
|
+
const {
|
|
20
|
+
resolveClientDetailsNavigation,
|
|
21
|
+
} = require('../../../utils/clientDetailsNavigation');
|
|
19
22
|
|
|
20
23
|
const getStatusFilterLabel = item => {
|
|
21
24
|
const normalized = String(item?.realStatus || item?.status || '')
|
|
@@ -418,28 +421,31 @@ const useCrmData = ({ iconComponent, navigation, showError }) => {
|
|
|
418
421
|
const handleEditProvider = useCallback(
|
|
419
422
|
opportunity => {
|
|
420
423
|
const reference = normalizePeopleReferenceValue(opportunity?.client);
|
|
421
|
-
|
|
424
|
+
const matchedPerson = getPersonByReference(opportunity?.client);
|
|
425
|
+
const navigationContext = resolveClientDetailsNavigation({
|
|
426
|
+
reference,
|
|
427
|
+
matchedPerson,
|
|
428
|
+
opportunityClient: opportunity?.client,
|
|
429
|
+
fallbackName:
|
|
430
|
+
getProviderName(opportunity?.client) ||
|
|
431
|
+
global.t?.t('people', 'label', 'client'),
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
if (!navigationContext) {
|
|
422
435
|
showError?.(global.t?.t('people', 'toast', 'providerNotIdentified'));
|
|
423
436
|
return;
|
|
424
437
|
}
|
|
425
438
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
matchedPerson ||
|
|
429
|
-
(typeof opportunity?.client === 'object' && opportunity?.client
|
|
430
|
-
? opportunity.client
|
|
431
|
-
: null) ||
|
|
432
|
-
{
|
|
433
|
-
id: String(reference || '').replace(/\D/g, ''),
|
|
434
|
-
'@id': reference,
|
|
435
|
-
name:
|
|
436
|
-
getProviderName(opportunity?.client) ||
|
|
437
|
-
global.t?.t('people', 'label', 'client'),
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
navigation.navigate('ClientDetails', { client: selectedClient });
|
|
439
|
+
peopleActions?.setItem?.(navigationContext.selectedClient);
|
|
440
|
+
navigation.navigate('ClientDetails', navigationContext.params);
|
|
441
441
|
},
|
|
442
|
-
[
|
|
442
|
+
[
|
|
443
|
+
getPersonByReference,
|
|
444
|
+
getProviderName,
|
|
445
|
+
navigation,
|
|
446
|
+
peopleActions,
|
|
447
|
+
showError,
|
|
448
|
+
],
|
|
443
449
|
);
|
|
444
450
|
|
|
445
451
|
return {
|
|
@@ -106,6 +106,7 @@ const CreateProposalsModal = ({ visible, onClose, onSuccess }) => {
|
|
|
106
106
|
const results = await searchCompanyProducts({
|
|
107
107
|
companyId: currentCompany.id,
|
|
108
108
|
query: productQuery,
|
|
109
|
+
categoryId: selectedModelCategoryId,
|
|
109
110
|
});
|
|
110
111
|
|
|
111
112
|
const filteredResults = filterProductsByModelCategory({
|
|
@@ -7,22 +7,16 @@ import Icon from 'react-native-vector-icons/FontAwesome';
|
|
|
7
7
|
import IconAdd from 'react-native-vector-icons/MaterialIcons';
|
|
8
8
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
|
|
9
9
|
import CreateProposalsModal from './CreateProposalsModal';
|
|
10
|
-
import ProposalCard from './ProposalCard';
|
|
11
|
-
import {
|
|
12
|
-
normalizeDigits,
|
|
13
|
-
normalizeStatusKey,
|
|
14
|
-
getStatusColor,
|
|
15
|
-
getStatusLabel,
|
|
16
|
-
extractPeopleId,
|
|
17
|
-
resolvePeopleName,
|
|
18
|
-
getContractPartyCandidates,
|
|
19
|
-
isIgnoredContractPartyId,
|
|
20
|
-
getResolvedPeopleName,
|
|
21
|
-
getContractClientName as resolveContractClientName,
|
|
22
|
-
isContractClientPendingResolution as resolveContractClientPending,
|
|
23
|
-
} from './proposalListHelpers';
|
|
24
10
|
import Formatter from '@controleonline/ui-common/src/utils/formatter';
|
|
25
11
|
import { getPeopleDisplayName } from '@controleonline/ui-common/src/react/utils/peopleDisplay';
|
|
12
|
+
import {
|
|
13
|
+
normalizeProposalStatusKey,
|
|
14
|
+
getProposalStatusColor,
|
|
15
|
+
getProposalStatusLabel,
|
|
16
|
+
getProposalStatusFilterKey,
|
|
17
|
+
buildProposalStatusFilterOptions,
|
|
18
|
+
proposalMatchesStatusFilter,
|
|
19
|
+
} from '../../utils/proposalStatus';
|
|
26
20
|
import styles from './index.styles';
|
|
27
21
|
import { inlineStyle_669_129 } from './index.styles';
|
|
28
22
|
|
|
@@ -198,28 +192,15 @@ const ProposalsPage = () => {
|
|
|
198
192
|
setRefreshing(false);
|
|
199
193
|
}, [fetchContracts, searchQuery]);
|
|
200
194
|
|
|
201
|
-
|
|
202
|
-
|
|
195
|
+
const normalizeStatusKey = normalizeProposalStatusKey;
|
|
196
|
+
const getStatusColor = getProposalStatusColor;
|
|
197
|
+
const getStatusLabel = status => getProposalStatusLabel(status, global.t?.t);
|
|
203
198
|
const getStatusFilterKey = useCallback(
|
|
204
|
-
item =>
|
|
205
|
-
|
|
206
|
-
return '';
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (item['@id']) {
|
|
210
|
-
return item['@id'];
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (item.id != null) {
|
|
214
|
-
return `/statuses/${item.id}`;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const normalized = normalizeStatusKey(item.realStatus || item.status);
|
|
218
|
-
return normalized ? `realStatus:${normalized}` : '';
|
|
219
|
-
},
|
|
220
|
-
[normalizeStatusKey],
|
|
199
|
+
item => getProposalStatusFilterKey(item),
|
|
200
|
+
[],
|
|
221
201
|
);
|
|
222
202
|
|
|
203
|
+
|
|
223
204
|
const statusFilterOptions = React.useMemo(
|
|
224
205
|
() => {
|
|
225
206
|
const options = [
|
|
@@ -393,6 +393,8 @@ export const createGeneralSettingsStyles = palette =>
|
|
|
393
393
|
primaryButton: {
|
|
394
394
|
marginTop: 16,
|
|
395
395
|
justifyContent: 'center',
|
|
396
|
+
backgroundColor: palette.buttonBackground,
|
|
397
|
+
borderColor: palette.buttonBorder,
|
|
396
398
|
},
|
|
397
399
|
secondaryButton: {
|
|
398
400
|
marginTop: 10,
|