4.0.1 • Published 2 months ago

@studyportals/search-filters v4.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

search-filters

Studyportals library of filter components to be used in Search pages e.g. StudySearch

Available filters

  • Attendance
  • Certification-type
  • Degree-type
  • Discipline
  • Duration
  • Education-level
  • Educational-form
  • Format
  • Location
  • Area
  • Country
  • Continent
  • Special-programmes
  • Tuition-fee
  • University

Other components

  • SearchFilterContainer (styling included)
  • SelectedFilters (clear filters button and filter tags)

Using filters in your project

Each SearchPage component must supply its own IFilterProvider implementation by leveraging the provide / inject mechanism in Vue when using any Filter.

Each SearchPage component must supply its own ILocationFilterProvider implementation by leveraging the provide / inject mechanism in Vue when using

  • CountryFilter
  • LocationFilter (which is using CountryFilter)

Each SearchPage component must supply its own ICurrencyFilterProvider implementation by leveraging the provide / inject mechanism in Vue when using

  • AttendanceFilter
  • TuitionFeeFilter

Each SearchPage component must supply its own IUniversityFilterProvider implementation by leveraging the provide / inject mechanism in Vue when using

  • UniversityFilter

Every Filter Component has a well-known key that integrating applications must use to configure the injection. The only requirements for the correlation key are:

  1. Uniqueness within the context of a SearchPage component (i.e., must not be shared by multiple filters)
  2. Stability within the lifecycle of the SearchPage component (i.e., must not change)

Interfaces

IFilterProvider

interface IFilterProvider {
  readonly trackedProduct: Product;
  readonly displayFacets: boolean;
  getFilterKeySelection: () => readonly FilterKey[];
  getFilterSelection: (key: FilterKey) => readonly string[];
  getFilterOptionInformation: (
    key: FilterKey
  ) => readonly FilterOptionInformation[];
  getFilterOptionInformationById: (
    key: FilterKey,
    id: string
  ) => FilterOptionInformation | null;
  getFacet: (key: FilterKey, optionValue: string) => number | null;
  isFilterCollapsed: (key: FilterKey) => boolean;
  isFilterRequired: (key: FilterKey) => boolean;
  toggleFilterExpandability: (key: FilterKey) => void;
  processFilterSelection: (payload: IFilterPayload) => Promise<void>;
  processFiltersSelection: (payload: IFilterPayload[]) => Promise<void>;
  clearFilter: (key: FilterKey) => Promise<void>;
  clearFilters: (keys: FilterKey[]) => Promise<void>;
  clearSelection: (payload: IFilterPayload[]) => Promise<void>;
}

ICurrencyFilterProvider

interface ICurrencyFilterProvider {
  getCurrency: () => string;
  requestCurrencyChange: () => void;
  currencyConvert: (
    originalAmount: number,
    originalCurrency: string,
    targetCurrency?: string
  ) => Promise<number>;
  trackCustomClickEvent: (label: string, property: string) => void;
  getAreDependenciesLoaded: () => boolean;
}

ILocationFilterProvider

interface ILocationFilterProvider {
  readonly includeContinents: boolean;
  identifyAreasFor: (countryId: string) => string[];
  identifyTopCountries: () => string[];
  identifyCountryFor: (areaId: string) => string;
}

IUniversityFilterProvider

interface IUniversityFilterProvider {
  retrieveUniversityInfo(id: string): Promise<IUniversityInfo | null>;
}

Deployment

Use the npm CLI to version and publish the package.

Unstable

You may need to publish a number of unstable versions while working on a new feature. You first need to select the new version of the package and then append the prerelease identifier. You can use the preid to contextualize the versions. The resulting version should match the pattern a.b.c-<preid>.0 or a.b.c.-0 if a preid is not necessary. You can use npm version {premajor|preminor|prepatch} --preid=<feature> or make the adjustments manually. Subsequent unstable versions can be incremented using npm version prerelease. You can publish the version using npm publish --tag beta.

Consider publishing unstable versions before the feature has been peer reviewed.

Stable

Use npm version {major|minor|patch}, or adjust the version manually. Use npm publish to publish the package.

DLL

The DLL package must be released for each stable version of the package.

  1. Update the reference to the package in dll/package.json
  2. Adjust the version of the DLL package in dll/package.json
  3. Run npm run deploy-dll from the base directory, or npm publish from the dll directory; for unstable releases use npm run deploy-dll-beta from the base directory, or npm publish --tag beta from the dll directory

ESM modules in Jest

Some of our packages are published as ECMAScript modules. This is the official specification on packaging JavaScript code.

Jest does not natively support ESM modules. Attempting the import instruction will result in the following error: SyntaxError: Cannot use import statement outside a module.

To resolve this, add the names of your ESM dependencies in the esmPackages array in the jest.config.js file. This will instruct Jest to transform the ESM modules into CommonJS modules using jest-esm-transformer.

⚠️ The esmPackages array is used to generate a regular expression that matches file paths. Linux and Window use different path separators. @studyportals/<package_name> is a valid path in Linux, but Windows expects the path to be formatted as @studyportals\<package_name>. Use the [/\\\\] separator to cover both cases: @studyportals[/\\\\]<package_name>.

4.0.1

2 months ago

4.0.0

2 months ago

3.7.1-beta.3

2 months ago

3.7.1-beta.2

2 months ago

3.7.1-beta.0

3 months ago

3.7.1-beta.1

3 months ago

3.7.1

3 months ago

3.7.0

3 months ago

3.7.0-beta.2

3 months ago

3.7.0-beta.1

3 months ago

3.7.0-beta.0

3 months ago

3.6.4

3 months ago

3.6.3

3 months ago

3.6.2

3 months ago

3.6.1

3 months ago

3.6.1-1

3 months ago

3.6.0

4 months ago

3.6.0-tracking.6

4 months ago

3.6.0-tracking.3

4 months ago

3.6.0-tracking.4

4 months ago

3.6.0-tracking.5

4 months ago

3.6.0-tracking.0

4 months ago

3.6.0-tracking.1

4 months ago

3.6.0-tracking.2

4 months ago

3.6.0-beta.0

4 months ago

3.5.1

4 months ago

3.5.0

4 months ago

3.5.0-orgf.18

4 months ago

3.5.0-orgf.16

4 months ago

3.5.0-orgf.17

4 months ago

3.5.0-orgf.14

4 months ago

3.5.0-orgf.15

4 months ago

3.5.0-orgf.12

4 months ago

3.5.0-orgf.13

4 months ago

3.5.0-orgf.11

4 months ago

3.5.0-orgf.5

4 months ago

3.5.0-orgf.6

4 months ago

3.5.0-orgf.4

4 months ago

3.5.0-orgf.9

4 months ago

3.5.0-orgf.7

4 months ago

3.5.0-orgf.8

4 months ago

3.5.0-orgf.1

4 months ago

3.5.0-orgf.2

4 months ago

3.5.0-orgf.0

4 months ago

3.5.0-orgf.3

4 months ago

3.5.0-st65620.9

5 months ago

3.5.0-st65620.6

5 months ago

3.5.0-st65620.8

5 months ago

3.5.0-st65620.7

5 months ago

3.5.0-st65620.4

5 months ago

3.5.0-st65620.3

5 months ago

3.5.0-st65620.5

5 months ago

3.5.0-st65620.0

5 months ago

3.5.0-st65620.2

5 months ago

3.5.0-st65620.1

5 months ago

2.0.1-st64080.0

10 months ago

2.0.1-st64080.2

10 months ago

2.0.1-st64080.1

10 months ago

2.0.0

10 months ago

3.2.1

7 months ago

3.2.0

7 months ago

3.2.0-st62700.19

7 months ago

1.1.0-f91070e4.29

11 months ago

1.1.0-f91070e4.28

11 months ago

1.1.0-f91070e4.27

11 months ago

3.2.0-st62700.11

7 months ago

1.1.0-f91070e4.35

10 months ago

3.2.0-st62700.12

7 months ago

1.1.0-f91070e4.34

10 months ago

3.2.0-st62700.13

7 months ago

1.1.0-f91070e4.33

11 months ago

3.2.0-st62700.14

7 months ago

1.1.0-f91070e4.32

11 months ago

3.2.0-st62700.15

7 months ago

1.1.0-f91070e4.31

11 months ago

3.2.0-st62700.16

7 months ago

1.1.0-f91070e4.30

11 months ago

3.2.0-st62700.17

7 months ago

3.2.0-st62700.18

7 months ago

3.2.0-st62700.10

7 months ago

1.1.0

10 months ago

2.0.0-beta.7

10 months ago

3.2.0-st62700.22

7 months ago

3.2.0-st62700.23

7 months ago

3.2.0-st62700.24

7 months ago

3.2.0-st62700.25

7 months ago

3.2.0-st62700.26

7 months ago

3.2.0-st62700.27

7 months ago

3.2.0-st62700.28

7 months ago

3.2.0-st62700.29

7 months ago

2.0.0-beta.0

10 months ago

2.0.0-beta.6

10 months ago

2.0.0-beta.5

10 months ago

3.2.0-st62700.20

7 months ago

2.0.0-beta.4

10 months ago

3.2.0-st62700.21

7 months ago

2.0.0-beta.3

10 months ago

2.0.0-st63714.0

10 months ago

3.1.0

10 months ago

3.3.1-st60000.0

7 months ago

3.2.0-st62700.9

8 months ago

3.2.0-st62700.8

8 months ago

2.0.0-st63714.2

10 months ago

2.0.0-st63714.1

10 months ago

3.2.0-st62700.33

7 months ago

3.2.0-st62700.3

8 months ago

3.2.0-st62700.34

7 months ago

3.2.0-st62700.2

8 months ago

3.2.0-st62700.35

7 months ago

3.2.0-st62700.1

8 months ago

3.0.0-1

10 months ago

3.2.0-st62700.36

7 months ago

3.2.0-st62700.0

8 months ago

3.0.0-0

10 months ago

3.2.0-st62700.37

7 months ago

3.2.0-st62700.7

8 months ago

3.2.0-st62700.38

7 months ago

3.2.0-st62700.6

8 months ago

3.2.0-st62700.39

7 months ago

3.2.0-st62700.5

8 months ago

3.2.0-st62700.4

8 months ago

3.2.0-st62700.30

7 months ago

3.2.0-st62700.31

7 months ago

3.2.0-st62700.32

7 months ago

3.2.0-st62700.44

7 months ago

3.2.0-st62700.45

7 months ago

3.2.0-st62700.46

7 months ago

3.2.0-st62700.47

7 months ago

3.2.0-st62700.48

7 months ago

3.2.0-st62700.49

7 months ago

3.4.0-ST65052.0

6 months ago

3.2.0-st62700.40

7 months ago

3.2.0-st62700.41

7 months ago

3.2.0-st62700.42

7 months ago

3.2.0-st62700.43

7 months ago

3.4.0

6 months ago

3.1.1-beta.10000

9 months ago

3.3.0-st62724.5

7 months ago

3.0.0

10 months ago

3.3.0-st62724.4

7 months ago

3.3.0-st62724.3

7 months ago

3.3.0-st62724.2

7 months ago

3.3.0-st62724.1

7 months ago

1.1.0-f91070e4.36

10 months ago

3.1.0-beta.1

10 months ago

3.1.0-beta.2

10 months ago

3.1.0-beta.0

10 months ago

3.3.1

7 months ago

3.3.0

7 months ago

3.2.0-hackday.3

8 months ago

3.2.0-hackday.4

8 months ago

3.2.0-hackday.0

8 months ago

3.2.0-hackday.1

8 months ago

3.2.0-hackday.2

8 months ago

1.1.0-f91070e4.1

11 months ago

1.1.0-f91070e4.2

11 months ago

1.1.0-f91070e4.3

11 months ago

1.0.0

12 months ago

1.1.0-f91070e4.4

11 months ago

1.1.0-f91070e4.9

11 months ago

1.1.0-f91070e4.19

11 months ago

1.1.0-f91070e4.18

11 months ago

1.1.0-f91070e4.17

11 months ago

1.1.0-f91070e4.5

11 months ago

1.1.0-f91070e4.16

11 months ago

1.1.0-f91070e4.6

11 months ago

1.1.0-f91070e4.15

11 months ago

1.1.0-f91070e4.7

11 months ago

1.1.0-f91070e4.14

11 months ago

1.1.0-f91070e4.8

11 months ago

1.1.0-f91070e4.24

11 months ago

1.1.0-f91070e4.23

11 months ago

1.1.0-f91070e4.22

11 months ago

1.1.0-f91070e4.21

11 months ago

1.1.0-f91070e4.20

11 months ago

1.1.0-f91070e4.26

11 months ago

1.1.0-f91070e4.25

11 months ago

1.1.0-f91070e4.13

11 months ago

1.1.0-f91070e4.12

11 months ago

1.1.0-f91070e4.11

11 months ago

1.1.0-f91070e4.10

11 months ago

1.0.0-536a3c47.8

12 months ago

1.0.0-536a3c47.9

12 months ago

1.0.0-536a3c47.10

12 months ago

1.0.0-536a3c47.12

12 months ago

1.0.0-536a3c47.11

12 months ago

1.0.0-536a3c47.7

12 months ago

1.0.0-536a3c47.6

12 months ago

1.0.0-536a3c47.5

12 months ago

1.0.0-536a3c47.4

12 months ago

1.0.0-536a3c47.3

12 months ago

1.0.0-536a3c47.2

12 months ago

1.0.0-536a3c47.1

12 months ago

1.0.0-536a3c47.0

12 months ago