Skip to content

Commit

Permalink
refactor(ts): CorpusListing
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Jul 5, 2024
1 parent 741a8b5 commit 2129a39
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 166 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

### Added

- TypeScript typings for config/settings
- TypeScript typings for CQP queries
- TypeScript typings for:
- config/settings
- CQP queries
- CorpusListing

### Changed

- Replaced Raphael library with Chart.js, used in the pie chart over corpus distribution in statistics
- In the `CorpusListing` class, the methods `getLinked` and `getEnabledByLang` have new parameter signatures

### Refactored

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/backend/kwic-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class KwicProxy extends BaseProxy {
}

function getPageInterval(): Interval {
const hpp: string | number = locationSearchGet("hpp")
const hpp = locationSearchGet("hpp")
const itemsPerPage = Number(hpp) || settings.hits_per_page_default
const start = (page || 0) * itemsPerPage
const end = start + itemsPerPage - 1
Expand Down
11 changes: 3 additions & 8 deletions app/scripts/components/corpus-updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import angular, { IScope } from "angular"
import moment from "moment"
import settings from "@/settings"
import { html } from "@/util"
import { LangString } from "@/i18n/types"
import { CorpusTransformed } from "@/settings/config-transformed.types"

export default angular.module("korpApp").component("corpusUpdates", {
template: html`
Expand Down Expand Up @@ -67,13 +67,8 @@ export default angular.module("korpApp").component("corpusUpdates", {

type CorpusUpdatesScope = IScope & {
LIMIT: number
recentUpdates: Corpus[] | null
recentUpdatesFiltered: Corpus[] | null
recentUpdates: CorpusTransformed[] | null
recentUpdatesFiltered: CorpusTransformed[] | null
expanded: boolean
toggleExpanded: (to?: boolean) => void
}

type Corpus = {
info: { Updated: string }
title: LangString
}
Loading

0 comments on commit 2129a39

Please sign in to comment.