Skip to content

No-components alert when importing to DejaCode#40 - #136

Merged
jdaguil merged 3 commits into
developfrom
40-empty-component-summary-alert
Jul 26, 2017
Merged

jdaguil merged 3 commits into
developfrom
40-empty-component-summary-alert

Conversation

@johnmhoran

Copy link
Copy Markdown
Member
  • Deleted button definition (including modal trigger) in
    componentDataTables.js constructor.
  • Button action function added to button definition in
    _createDataTable(tableID), including
    • count based on DataTable parameter dt and
    • if/then test to trigger “Upload Components to DejaCode” modal.
  • Next step: modify to base test on Component table in AboutCodeDB
    rather than DataTable.

Signed-off-by: John M. Horan johnmhoran@gmail.com

  * Deleted button definition (including modal trigger) in
    componentDataTables.js constructor.
  * Button action function added to button definition in
    _createDataTable(tableID), including
    * count based on DataTable parameter “dt” and
    * if/then test to trigger “Upload Components to DejaCode” modal.
  * Next step: modify to base test on Component table in AboutCodeDB
    rather than DataTable.

Signed-off-by: John M. Horan <johnmhoran@gmail.com>
  * Button “action” function converted to fat arrow function.
  * If/then is based on testing length of array returned by
    findAllComponents().

Signed-off-by: John M. Horan <johnmhoran@gmail.com>
@johnmhoran

Copy link
Copy Markdown
Member Author

In my latest commit:

  • The button action function has been converted to a fat arrow function.
  • Rather than testing the number of records in the DataTable, the if/then is now based on testing the length of the array returned by findAllComponents().

Comment thread assets/js/componentDataTables.js Outdated
if (components.length > 0) {
$('#componentExportModal').modal('show');
}
else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put the else on the same line as your if block’s closing brace?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do @jdaguil . (I'll need to do the same for PR #135 but will wait in case you have other comments.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: I meant to refer to issue #135 and PR #137 .

@jdaguil jdaguil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One small change.

  * Moved start of "else" block to same line as "if" block's closing
    brace.

Signed-off-by: John M. Horan <johnmhoran@gmail.com>
@jdaguil jdaguil changed the title No-components alert based on DataTable, not DB #40 No-components alert when importing to DejaCode#40 Jul 26, 2017
@jdaguil

jdaguil commented Jul 26, 2017

Copy link
Copy Markdown
Contributor

LGTM

@jdaguil
jdaguil merged commit b780a46 into develop Jul 26, 2017
@jdaguil
jdaguil deleted the 40-empty-component-summary-alert branch July 26, 2017 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants