chore: Improvements at response from API when generate root certificate#5198
chore: Improvements at response from API when generate root certificate#5198vitormattos merged 15 commits intomainfrom
Conversation
195b468 to
abfb7e6
Compare
vitormattos
left a comment
There was a problem hiding this comment.
Now you need to recreate src/helpers/certification.js to send it to the front end. I think the best way is via an initial state, perhaps named certification_rules.
It might be a good idea to create a toArray method in the RulesServices class. This could be a good way to transform the PHP code into JavaScript Object Notation and send it serialized to the front end via the initial state.
And then, remove the src/helpers/certification.js matching the suggestion that was exposed at the issue:
To do this you will need to move the file apps-extra/libresign/src/helpers/certification.js to be a helper in API side and return this as JSON in an initial state to frontend.
77b64e6 to
82548ab
Compare
cb4a7ad to
148d991
Compare
AntDavidLima
left a comment
There was a problem hiding this comment.
Everything looks right to me. Great job!
I've just requested some changes related to some minor, not that important things.
| throw new LibresignException('Parameter id is required!', 400); | ||
| } | ||
| $names[$item['id']]['value'] = $this->trimAndThrowIfEmpty($item['id'], $item['value']); | ||
| $names[$item['id']]['value'] = trim((string)$item['value']); |
There was a problem hiding this comment.
It may be good to rewrite this line in multiple lines, to make it easier to read. Something like:
$itemId = $item['id'];
$itemValue = strval($item['value']);
$names[$itemId]['value'] = trim($itemValue);It's something silly, but may help people new to the application to understand it's code.
There was a problem hiding this comment.
Maybe would be best create a fallback issue to implement a NormalizeService class to add the trim rule into all values and also add an uppercase rule into Country and maintain the scope of this PR more amalgamated with the issue that motivated this PR.
| if ($length > $rule['max'] || $length < $rule['min']) { | ||
| throw new InvalidArgumentException( | ||
| $this->l10n->t( | ||
| "Parameter '%s' should be between %s and %s.", |
There was a problem hiding this comment.
Parameter '%s' should be between %s and %s characters. will be clearer, I think.
There was a problem hiding this comment.
characters only make sense when is about a string. The interval is numeric.
Signed-off-by: Crisciany Souza <crisciany.souza@librecode.coop>
Signed-off-by: Crisciany Souza <crisciany.souza@librecode.coop> Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
I changed because the previous scenaio name was a copy paste of first scenario. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The entire name of this field is Common Name and not only Name. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
5740a33 to
4b43967
Compare
|
I only made a rebase without any change at commits of this PR |
| throw new LibresignException('Parameter id is required!', 400); | ||
| } | ||
| $names[$item['id']]['value'] = $this->trimAndThrowIfEmpty($item['id'], $item['value']); | ||
| $names[$item['id']]['value'] = trim((string)$item['value']); |
There was a problem hiding this comment.
Maybe would be best create a fallback issue to implement a NormalizeService class to add the trim rule into all values and also add an uppercase rule into Country and maintain the scope of this PR more amalgamated with the issue that motivated this PR.
|
/backport to stable31 |
|
/backport to stable30 |
Pull Request Description
Related Issue
Issue Number: #1967
Pull Request Type
Chore