Skip to content

Commit 12b5806

Browse files
committed
Refine the consistency of Product import actions #241
Signed-off-by: tdruez <[email protected]>
1 parent 4e3b875 commit 12b5806

File tree

15 files changed

+48
-40
lines changed

15 files changed

+48
-40
lines changed

dejacode/static/css/dejacode_bootstrap.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,12 @@ div.awesomplete {
590590
[data-bs-theme=dark] .awesomplete > ul {
591591
background: var(--bs-black);
592592
}
593-
594593
#div_id_component .awesomplete {
595594
display: inline-block !important;
596595
}
596+
label.requiredField {
597+
font-weight: bolder;
598+
}
597599

598600
/* -- Products comparison -- */
599601
body.product-comparison tr.unchanged {

dje/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def pull_project_data_from_scancodeio(scancodeproject_uuid):
197197
)
198198

199199
if scancode_project.type == scancode_project.ProjectType.LOAD_SBOMS:
200-
notification_verb = "Load Packages from SBOMs"
200+
notification_verb = "Import SBOM"
201201
else:
202202
notification_verb = "Import packages from ScanCode.io"
203203

docs/reference-1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Reference 1 - Declared License Expression and License Clarity Scoring
55
=====================================================================
66

77
When you scan a Package from DejaCode, you can view the Scan Results in a
8-
:guilabel:`Action` tab on the Package details user view. DejaCode presents a selection of
8+
:guilabel:`Actions` tab on the Package details user view. DejaCode presents a selection of
99
scan details with an emphasis on license detection. You can also download the
1010
complete :guilabel:`Scan Results` in .json format.
1111

docs/tutorial-1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Alternatively, you can conveniently download one of the provided examples from
2929
the following
3030
`GitHub repository <https://github.com/aboutcode-org/dejacode/tree/main/docs/sboms/>`_.
3131

32-
On the Product details page, from the :guilabel:`Action` dropdown, select
33-
:guilabel:`Load Packages from SBOMs`:
32+
On the Product details page, from the :guilabel:`Actions` dropdown, select
33+
:guilabel:`Import SBOM`:
3434

3535
* Click the :guilabel:`Choose File` button on the **SBOM file or zip archive** field.
3636
* Select your SBOM (.cdx.json or .spdx.json) and click the :guilabel:`Open` button.

docs/tutorial-2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Click the green :guilabel:`Add` button.
2121

2222
DejaCode presents the new Package.
2323

24-
- Refresh your browser page to see the :guilabel:`Action` tab.
24+
- Refresh your browser page to see the :guilabel:`Actions` tab.
2525
- Explore the scan results.
2626
- Select values to apply to the new Package definition, such as one or more licenses,
2727
a Copyright statement, and a Primary langauge.
@@ -109,7 +109,7 @@ Improve Package Data by Scanning
109109
Select :guilabel:`Packages` from the main menu bar.
110110

111111
Identify and select a Package that needs to be improved.
112-
Click the :guilabel:`Action` button on the Package details form.
112+
Click the :guilabel:`Actions` button on the Package details form.
113113

114114
Optionally follow the progress of the Scan by selecting the :guilabel:`Scans`
115115
option from the :guilabel:`Tools` dropdown on the main menu bar.

docs/tutorial-4-vulnerabilities.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Load Scan Results to your Product
2626

2727
`<https://github.com/aboutcode-org/dejacode/tree/main/docs/sboms/starship_engine_2.0_scan_results.json>`_.
2828

29-
2. On the Product details page, from the :guilabel:`Action` dropdown, select
30-
:guilabel:`Import from Scan`:
29+
2. On the Product details page, from the :guilabel:`Actions` dropdown, select
30+
:guilabel:`Import ScanCode scan results`:
3131

3232
* Click the :guilabel:`Choose File` button under the **Upload file** field.
3333
* Select the **starship_engine_2.0_scan_results.json** file and click the

docs/tutorial-5-sboms.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Load an SBOM to your Product
2727

2828
`<https://github.com/aboutcode-org/dejacode/raw/refs/heads/main/docs/sboms/storm-core-1.0.1.cdx.json.zip>`_.
2929

30-
2. On the Product details page, from the :guilabel:`Action` dropdown, select
31-
:guilabel:`Load Packages from SBOMs`:
30+
2. On the Product details page, from the :guilabel:`Actions` dropdown, select
31+
:guilabel:`Import SBOM`:
3232

3333
* Click the Browse field beneath :guilabel:`SBOM file or zip archive`
3434
* Select the **storm-core-1.0.cdx.json** file and leave the additional options
@@ -46,7 +46,7 @@ Load an SBOM to your Product
4646
.. image:: images/tutorial-5-sboms/inventory-tab-1.jpg
4747

4848
5. You can enrich the data provided by your supplier,
49-
From the :guilabel:`Action` dropdown, select
49+
From the :guilabel:`Actions` dropdown, select
5050
:guilabel:`Improve Packages from PurlDB`:
5151

5252
.. image:: images/tutorial-5-sboms/improve-packages-from-purldb.jpg

product_portfolio/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def perform_create(self, serializer):
349349
@action(detail=True, methods=["post"], serializer_class=LoadSBOMsFormSerializer)
350350
def load_sboms(self, request, *args, **kwargs):
351351
"""
352-
Load Packages from SBOMs.
352+
Import SBOM.
353353
354354
DejaCode supports the following SBOM formats:
355355
* CycloneDX BOM as JSON bom.json and .cdx.json,

product_portfolio/forms.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,10 @@ class Meta(BaseAddToProductForm.Meta):
535535

536536

537537
class ImportFromScanForm(forms.Form):
538-
upload_file = SmartFileField(extensions=["json"])
538+
upload_file = SmartFileField(
539+
label=_("Scan results JSON file"),
540+
extensions=["json"],
541+
)
539542
create_codebase_resources = forms.BooleanField(
540543
label=_('Create Codebase Resources (from <code>"files"</code>)'),
541544
required=False,
@@ -566,7 +569,7 @@ def __init__(self, user, *args, **kwargs):
566569
@property
567570
def helper(self):
568571
helper = FormHelper()
569-
helper.add_input(Submit("import", "Import"))
572+
helper.add_input(Submit("submit", "Import", css_class="btn-success"))
570573
return helper
571574

572575
def save(self, product):
@@ -636,7 +639,7 @@ def helper(self):
636639
helper.form_method = "post"
637640
helper.form_id = "import-manifest-form"
638641
helper.attrs = {"autocomplete": "off"}
639-
helper.add_input(Submit("submit", "Load Packages", css_class="btn-success"))
642+
helper.add_input(Submit("submit", "Import", css_class="btn-success"))
640643
return helper
641644

642645
def submit(self, product, user):

product_portfolio/templates/product_portfolio/import_from_scan.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% load crispy_forms_tags %}
44

55
{% block page_title %}
6-
Import from Scan
6+
Import ScanCode scan results
77
{% endblock %}
88

99
{% block content %}
@@ -17,7 +17,7 @@
1717
<a href="{{ product.get_absolute_url }}">{{ product }}</a>
1818
</div>
1919
<h1 class="header-title">
20-
Import from Scan
20+
Import ScanCode scan results
2121
</h1>
2222
</div>
2323
</div>
@@ -37,15 +37,15 @@ <h1 class="header-title">
3737
</div>
3838

3939
<div class="alert alert-dark bg-body-tertiary">
40-
<h5>Option 1: From a ScanCode-toolkit scan output</h5>
40+
<h5>Option 1: from a ScanCode-toolkit scan output</h5>
4141
<div class="mb-2">
4242
Upload a ScanCode-toolkit JSON output file, generated with <strong>version 31.2.3 or later</strong>, the following <strong>options are mandatory</strong>:
4343
</div>
4444
<kbd>$ scancode --copyright --license --info --package --json {file_output.json} {input_directory}</kbd>
4545
</div>
4646

4747
<div class="alert alert-dark bg-body-tertiary">
48-
<h5>Option 2: From ScanCode.io pipeline results</h5>
48+
<h5>Option 2: from ScanCode.io pipeline results</h5>
4949
<p class="mb-1">
5050
Upload a ScanCode.io JSON output file, <strong>generated with one of the following pipelines:</strong>
5151
</p>

0 commit comments

Comments
 (0)