Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kavigupta committed Sep 1, 2024
1 parent 4d201c9 commit 6c1a49c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions react/src/components/article-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function ArticlePanelRows(props: { article_row: Article, longname: string, short
<StatisticRowRaw is_header={false} _idx={i} key={row.statname} index={i} {...row}
onReplace={x => { document.location = article_link(curr_universe, x) }}
simple={simple_ordinals}
longname={props.longname}
shortname={props.shortname}
screenshot_mode={props.screenshot_mode}
/>)}
Expand Down
6 changes: 3 additions & 3 deletions react/src/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type StatisticRowRawProps = {
}
)

export function StatisticRowRaw(props: StatisticRowRawProps & { index: number, shortname?: string, screenshot_mode: boolean }) {
export function StatisticRowRaw(props: StatisticRowRawProps & { index: number, longname?: string, shortname?: string, screenshot_mode: boolean }) {

const [expanded] = useSetting(row_expanded_key(props.is_header ? "header" : props.statname));

Expand Down Expand Up @@ -190,7 +190,7 @@ export function StatisticRowRawCellContents(props: StatisticRowRawProps & {

export function StatisticName(props: {
statname: string, article_type: string, ordinal: number,
longname?: string, rendered_statname: string,
longname: string, rendered_statname: string,
curr_universe: string,
use_toggle: boolean,
screenshot_mode: boolean
Expand All @@ -200,7 +200,7 @@ export function StatisticName(props: {
statistic_link(
props.curr_universe,
props.statname, props.article_type, props.ordinal,
20, undefined, props.longname!
20, undefined, props.longname
)
}>{props.rendered_statname}</a>
if (props.use_toggle && !props.screenshot_mode) {
Expand Down
1 change: 0 additions & 1 deletion react/src/page_template/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export class Settings {
}

setSetting<K extends keyof SettingsDictionary>(key: K, newValue: SettingsDictionary[K]): void {
console.log(`Setting ${key} to ${newValue}`)
this.settings[key] = newValue
localStorage.setItem("settings", JSON.stringify(this.settings))
this.observers.get(key).forEach(observer => observer())
Expand Down
3 changes: 3 additions & 0 deletions react/test/statistics_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ test('statistics-page', async t => {
await t.expect(getLocation())
.eql(TARGET + '/statistic.html?statname=Population&article_type=Hospital+Referral+Region&start=21&amount=20&universe=USA');
await screencap(t, "statistics/population");
const count = Selector('div').withAttribute('style', /background-color: rgb\(212, 181, 226\);/)
.withText(/Indianapolis IN HRR, USA/);
await t.expect(count.count).gte(1, "Need highlighting");
// click link "Data Explanation and Credit"
await t
.click(Selector('a').withText(/^Data Explanation and Credit$/));
Expand Down

0 comments on commit 6c1a49c

Please sign in to comment.