Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tive/aiid into add-global-search-bar
  • Loading branch information
lmcnulty committed May 27, 2024
2 parents 6317ab6 + 8131d30 commit 1229173
Show file tree
Hide file tree
Showing 15 changed files with 363 additions and 143 deletions.
2 changes: 2 additions & 0 deletions site/gatsby-site/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ const config = {
{ title: 'Table View', label: 'incidents', url: '/apps/incidents/', items: [] },
{ title: 'Entities', label: 'entities', url: '/entities/', items: [] },
{ title: 'Taxonomies', label: 'taxonomies', url: '/taxonomies/', items: [] },
{ title: 'Random Incident', label: 'random', url: '/random/', items: [] },
{ title: 'Word Counts', label: 'wordcounts', url: '/summaries/wordcounts/', items: [] },
{ title: 'Submit Incident Reports', label: 'submit', url: '/apps/submit/', items: [] },
{ title: 'Risk Checklists', label: 'checklists', url: '/apps/checklists/', items: [] },
{
title: 'Submission Leaderboard',
label: 'leaderboard',
Expand Down
30 changes: 30 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/apps/incidents.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,34 @@ describe('Incidents App', () => {
cy.get('[data-cy="current-page"]').should('have.text', '1');
}
);

conditionalIt(!Cypress.env('isEmptyEnvironment'), 'Should switch between views', () => {
cy.visit(url);

cy.waitForStableDOM();

cy.get('[data-cy="table-view"] button').contains('Issue Reports').click();

cy.waitForStableDOM();

cy.get('[data-cy="row"]').should('have.length.at.least', 10);

cy.get('[data-cy="row"] td a')
.first()
.should('have.attr', 'href')
.and('match', /^\/reports\/\d+$/);

cy.get('[data-cy="table-view"] button')
.contains(/^Reports$/)
.click();

cy.waitForStableDOM();

cy.get('[data-cy="row"]').should('have.length.at.least', 10);

cy.get('[data-cy="row"] td a')
.first()
.should('have.attr', 'href')
.and('match', /^\/cite\/\d+#r\d+$/);
});
});
9 changes: 9 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/random.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe('Random', () => {
const url = '/random';

it('Should navigate to random page', () => {
cy.visit(url);
cy.waitForStableDOM();
cy.location('pathname').should('to.match', new RegExp('/cite/\\d+/'));
});
});
5 changes: 4 additions & 1 deletion site/gatsby-site/i18n/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,8 @@
"Overfitting": "Sobreajuste",
"No classifications with this field": "No hay clasificaciones con este campo",
"Language": "Idioma",
"Read the Source": "Leer la Fuente"
"Read the Source": "Leer la Fuente",
"Redirecting...": "Redirigiendo",
"Random Incident": "Incidente aleatorio",
"Risk Checklists": "Control de Riesgos"
}
5 changes: 4 additions & 1 deletion site/gatsby-site/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,5 +547,8 @@
"Spectrogram": "Spectrogramme",
"Overfitting": "Surajustement",
"No classifications with this field": "Aucune classification pour ce champ",
"Read the Source": "Lire la source"
"Redirecting...": "En train de rediriger...",
"Random Incident": "Incident au hasard",
"Read the Source": "Lire la source",
"Risk Checklists": "Contrôle des risques"
}
5 changes: 4 additions & 1 deletion site/gatsby-site/i18n/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,5 +540,8 @@
"Fewer filters": "フィルタを減らす",
"Tags": "タグ",
"Language": "言語",
"Read the Source": "情報源を読む"
"Read the Source": "情報源を読む",
"Redirecting...": "リダイレクト中...",
"Random Incident": "おまかせ表示",
"Risk Checklists": "Risk Checklists"
}
131 changes: 76 additions & 55 deletions site/gatsby-site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion site/gatsby-site/src/components/checklists/CheckListForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ export default function CheckListForm({
<ExportDropdown checklist={values} generatedRisks={generatedRisks} />
</HeaderControls>
</Header>
<Info>This feature is in development. Data entered will not be retained.</Info>
<Info>
This feature is in beta. Data entered is not guaranteed to be retained while in development.
</Info>
<Info>Checklists are not private data. They will appear in public database snapshots.</Info>
<AboutSystem formAbout={values.about} {...{ debouncedSetFieldValue, userIsOwner }} />
<section>
Expand Down
11 changes: 9 additions & 2 deletions site/gatsby-site/src/components/reports/ReportsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ export default function ReportsTable({ data, isLiveData, setIsLiveData }) {
{
title: t('Report Number'),
accessor: 'report_number',
Cell: ({ row: { values } }) => (
<a className="flex" href={`/reports/${values.report_number}`}>
Cell: ({ row: { values, original } }) => (
<a
className="flex"
href={
original.incident_id
? `/cite/${original.incident_id}#r${values.report_number}`
: `/reports/${values.report_number}`
}
>
Report {values.report_number}
</a>
),
Expand Down
Loading

0 comments on commit 1229173

Please sign in to comment.