Skip to content

Commit

Permalink
editor: fix patron editor
Browse files Browse the repository at this point in the history
In the patron editor, if the current edited patron doesn't have the
'patron' role, we need to remove all informations linked to this
profile (mainly the default expiration_date setted in
`preprocessRecordEditor` function).

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed Nov 24, 2020
1 parent 723dcb3 commit bb59378
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
43 changes: 31 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
# Changelog

## [v0.8.0](https://github.com/rero/rero-ils-ui/tree/v0.8.0) (2020-11-24)

[Full Changelog](https://github.com/rero/rero-ils-ui/compare/v0.7.1...v0.8.0)

**Merged pull requests:**

- holdings: fix prediction preview [\#437](https://github.com/rero/rero-ils-ui/pull/437) ([jma](https://github.com/jma))
- items: fix display notes content. [\#436](https://github.com/rero/rero-ils-ui/pull/436) ([zannkukai](https://github.com/zannkukai))
- ui: adapt templates for cypress tests [\#435](https://github.com/rero/rero-ils-ui/pull/435) ([AoNoOokami](https://github.com/AoNoOokami))
- ui: fix translation issues [\#424](https://github.com/rero/rero-ils-ui/pull/424) ([AoNoOokami](https://github.com/AoNoOokami))
- contribution: implements organisation agents [\#398](https://github.com/rero/rero-ils-ui/pull/398) ([Garfield-fr](https://github.com/Garfield-fr))

## [v0.7.1](https://github.com/rero/rero-ils-ui/tree/v0.7.1) (2020-11-16)

[Full Changelog](https://github.com/rero/rero-ils-ui/compare/v0.7.0...v0.7.1)

**Merged pull requests:**

- release: v0.7.1 [\#434](https://github.com/rero/rero-ils-ui/pull/434) ([jma](https://github.com/jma))

## [v0.7.0](https://github.com/rero/rero-ils-ui/tree/v0.7.0) (2020-11-16)

[Full Changelog](https://github.com/rero/rero-ils-ui/compare/v0.6.1...v0.7.0)

**Merged pull requests:**

- release: v0.7.0 [\#433](https://github.com/rero/rero-ils-ui/pull/433) ([jma](https://github.com/jma))
- bugs: fix several bugs into UI [\#430](https://github.com/rero/rero-ils-ui/pull/430) ([zannkukai](https://github.com/zannkukai))
- ui: implement basic keyboard shortcuts [\#429](https://github.com/rero/rero-ils-ui/pull/429) ([zannkukai](https://github.com/zannkukai))
- requests: improves the main request screen. [\#426](https://github.com/rero/rero-ils-ui/pull/426) ([zannkukai](https://github.com/zannkukai))
Expand All @@ -18,6 +39,11 @@
- merge temporary v0.14 branch to dev [\#415](https://github.com/rero/rero-ils-ui/pull/415) ([zannkukai](https://github.com/zannkukai))
- holdings: improve editor preview rendering [\#413](https://github.com/rero/rero-ils-ui/pull/413) ([jma](https://github.com/jma))
- patron: allows librarians to update user password [\#411](https://github.com/rero/rero-ils-ui/pull/411) ([jma](https://github.com/jma))
- sercurity: update dependencies [\#237](https://github.com/rero/rero-ils-ui/pull/237) ([jma](https://github.com/jma))
- tests: fix random failures [\#236](https://github.com/rero/rero-ils-ui/pull/236) ([jma](https://github.com/jma))
- translation: fix some source string issues [\#222](https://github.com/rero/rero-ils-ui/pull/222) ([iGormilhit](https://github.com/iGormilhit))
- document: display title in brief and detail views [\#217](https://github.com/rero/rero-ils-ui/pull/217) ([AoNoOokami](https://github.com/AoNoOokami))
- Adding guards to solved editor access using direct URL [\#214](https://github.com/rero/rero-ils-ui/pull/214) ([zannkukai](https://github.com/zannkukai))

## [v0.6.1](https://github.com/rero/rero-ils-ui/tree/v0.6.1) (2020-11-02)

Expand Down Expand Up @@ -47,6 +73,7 @@
- holding: fix holding display problem. [\#378](https://github.com/rero/rero-ils-ui/pull/378) ([zannkukai](https://github.com/zannkukai))
- app: standardize initialization [\#377](https://github.com/rero/rero-ils-ui/pull/377) ([Garfield-fr](https://github.com/Garfield-fr))
- collection: create public and professional views [\#376](https://github.com/rero/rero-ils-ui/pull/376) ([AoNoOokami](https://github.com/AoNoOokami))
- document: allow record duplication [\#367](https://github.com/rero/rero-ils-ui/pull/367) ([Garfield-fr](https://github.com/Garfield-fr))
- application: compatibility with Elasticsearch 7 [\#366](https://github.com/rero/rero-ils-ui/pull/366) ([Garfield-fr](https://github.com/Garfield-fr))

## [v0.5.2](https://github.com/rero/rero-ils-ui/tree/v0.5.2) (2020-09-21)
Expand All @@ -62,7 +89,6 @@
- translations: for release 0.5.2 [\#375](https://github.com/rero/rero-ils-ui/pull/375) ([jma](https://github.com/jma))
- form: improve toogle switch [\#372](https://github.com/rero/rero-ils-ui/pull/372) ([Garfield-fr](https://github.com/Garfield-fr))
- translations: fix show more item link [\#370](https://github.com/rero/rero-ils-ui/pull/370) ([zannkukai](https://github.com/zannkukai))
- document: allow record duplication [\#367](https://github.com/rero/rero-ils-ui/pull/367) ([Garfield-fr](https://github.com/Garfield-fr))

## [v0.5.1](https://github.com/rero/rero-ils-ui/tree/v0.5.1) (2020-09-14)

Expand Down Expand Up @@ -102,8 +128,6 @@
- ui: add `id=` HTML attributes on item lists [\#330](https://github.com/rero/rero-ils-ui/pull/330) ([blankoworld](https://github.com/blankoworld))
- Translations update from Weblate [\#329](https://github.com/rero/rero-ils-ui/pull/329) ([weblate](https://github.com/weblate))
- document: adapt detailed view for cypress tests [\#324](https://github.com/rero/rero-ils-ui/pull/324) ([AoNoOokami](https://github.com/AoNoOokami))
- Us1491 item inventory list [\#323](https://github.com/rero/rero-ils-ui/pull/323) ([jma](https://github.com/jma))
- ui: replace getId\(\) by idAttribute Pipe [\#321](https://github.com/rero/rero-ils-ui/pull/321) ([blankoworld](https://github.com/blankoworld))
- Merge the update of invenio-circulation and major refactoring of RERO ILS circulation module \(US 1394\) [\#320](https://github.com/rero/rero-ils-ui/pull/320) ([AoNoOokami](https://github.com/AoNoOokami))
- Translations update from Weblate [\#310](https://github.com/rero/rero-ils-ui/pull/310) ([weblate](https://github.com/weblate))

Expand All @@ -115,7 +139,9 @@

- release: v0.4.0 [\#326](https://github.com/rero/rero-ils-ui/pull/326) ([jma](https://github.com/jma))
- document: fix holding type serial detection [\#325](https://github.com/rero/rero-ils-ui/pull/325) ([jma](https://github.com/jma))
- Us1491 item inventory list [\#323](https://github.com/rero/rero-ils-ui/pull/323) ([jma](https://github.com/jma))
- document editor: fix bnf import [\#322](https://github.com/rero/rero-ils-ui/pull/322) ([jma](https://github.com/jma))
- ui: replace getId\(\) by idAttribute Pipe [\#321](https://github.com/rero/rero-ils-ui/pull/321) ([blankoworld](https://github.com/blankoworld))
- documentation: add badges to the README [\#319](https://github.com/rero/rero-ils-ui/pull/319) ([iGormilhit](https://github.com/iGormilhit))
- package: upgrade ng-core to version 0.6.0 [\#315](https://github.com/rero/rero-ils-ui/pull/315) ([Garfield-fr](https://github.com/Garfield-fr))
- project: downgrade ngx-spinner version [\#314](https://github.com/rero/rero-ils-ui/pull/314) ([lauren-d](https://github.com/lauren-d))
Expand All @@ -126,8 +152,6 @@
- ui: better request badge into circulation module [\#304](https://github.com/rero/rero-ils-ui/pull/304) ([zannkukai](https://github.com/zannkukai))
- ui: add directive to sort tabs [\#302](https://github.com/rero/rero-ils-ui/pull/302) ([zannkukai](https://github.com/zannkukai))
- package: upgrade to NodeJS 12 [\#301](https://github.com/rero/rero-ils-ui/pull/301) ([blankoworld](https://github.com/blankoworld))
- circulation: adapt 'add request' [\#298](https://github.com/rero/rero-ils-ui/pull/298) ([AoNoOokami](https://github.com/AoNoOokami))
- circulation: adapt loan object [\#294](https://github.com/rero/rero-ils-ui/pull/294) ([AoNoOokami](https://github.com/AoNoOokami))
- document: adapts detailed view for series statements fields [\#283](https://github.com/rero/rero-ils-ui/pull/283) ([AoNoOokami](https://github.com/AoNoOokami))

## [v0.3.0](https://github.com/rero/rero-ils-ui/tree/v0.3.0) (2020-06-30)
Expand Down Expand Up @@ -193,6 +217,7 @@
- editor: link persons to source instead of MEF [\#269](https://github.com/rero/rero-ils-ui/pull/269) ([rerowep](https://github.com/rerowep))
- permissions: refactoring permissions usage [\#268](https://github.com/rero/rero-ils-ui/pull/268) ([zannkukai](https://github.com/zannkukai))
- locations: paging request adaptation [\#266](https://github.com/rero/rero-ils-ui/pull/266) ([zannkukai](https://github.com/zannkukai))
- search: add simple params for the backend calls [\#265](https://github.com/rero/rero-ils-ui/pull/265) ([jma](https://github.com/jma))
- circulation: past participle used when action done [\#263](https://github.com/rero/rero-ils-ui/pull/263) ([zannkukai](https://github.com/zannkukai))
- document: adapt detail view [\#261](https://github.com/rero/rero-ils-ui/pull/261) ([AoNoOokami](https://github.com/AoNoOokami))
- general: MainTitle as a pipe and test imports refactoring. [\#245](https://github.com/rero/rero-ils-ui/pull/245) ([zannkukai](https://github.com/zannkukai))
Expand All @@ -204,7 +229,6 @@

**Merged pull requests:**

- search: add simple params for the backend calls [\#265](https://github.com/rero/rero-ils-ui/pull/265) ([jma](https://github.com/jma))
- release: v0.1.2 [\#264](https://github.com/rero/rero-ils-ui/pull/264) ([jma](https://github.com/jma))
- autocomplete: fix suggestions list [\#260](https://github.com/rero/rero-ils-ui/pull/260) ([jma](https://github.com/jma))
- request: fix pickup location update [\#258](https://github.com/rero/rero-ils-ui/pull/258) ([AoNoOokami](https://github.com/AoNoOokami))
Expand Down Expand Up @@ -234,7 +258,6 @@

- search view: hide the add button for public views [\#243](https://github.com/rero/rero-ils-ui/pull/243) ([jma](https://github.com/jma))
- release: v0.1.0 [\#242](https://github.com/rero/rero-ils-ui/pull/242) ([jma](https://github.com/jma))
- translation: fix some source string issues [\#222](https://github.com/rero/rero-ils-ui/pull/222) ([iGormilhit](https://github.com/iGormilhit))

## [v0.0.13](https://github.com/rero/rero-ils-ui/tree/v0.0.13) (2020-04-09)

Expand All @@ -257,8 +280,6 @@
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'fr' [\#240](https://github.com/rero/rero-ils-ui/pull/240) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'de' [\#239](https://github.com/rero/rero-ils-ui/pull/239) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'it' [\#238](https://github.com/rero/rero-ils-ui/pull/238) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- sercurity: update dependencies [\#237](https://github.com/rero/rero-ils-ui/pull/237) ([jma](https://github.com/jma))
- tests: fix random failures [\#236](https://github.com/rero/rero-ils-ui/pull/236) ([jma](https://github.com/jma))
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'ar' [\#235](https://github.com/rero/rero-ils-ui/pull/235) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'ar' [\#233](https://github.com/rero/rero-ils-ui/pull/233) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'es' [\#232](https://github.com/rero/rero-ils-ui/pull/232) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
Expand All @@ -271,8 +292,6 @@
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'fr' [\#220](https://github.com/rero/rero-ils-ui/pull/220) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- search: remove useless code [\#219](https://github.com/rero/rero-ils-ui/pull/219) ([AoNoOokami](https://github.com/AoNoOokami))
- transactions: bug fixing [\#218](https://github.com/rero/rero-ils-ui/pull/218) ([zannkukai](https://github.com/zannkukai))
- document: display title in brief and detail views [\#217](https://github.com/rero/rero-ils-ui/pull/217) ([AoNoOokami](https://github.com/AoNoOokami))
- Adding guards to solved editor access using direct URL [\#214](https://github.com/rero/rero-ils-ui/pull/214) ([zannkukai](https://github.com/zannkukai))
- editor: fix uniqueness check value for locations [\#210](https://github.com/rero/rero-ils-ui/pull/210) ([jma](https://github.com/jma))
- document: fix cover image in brief view [\#205](https://github.com/rero/rero-ils-ui/pull/205) ([AoNoOokami](https://github.com/AoNoOokami))
- project code: rename a component [\#204](https://github.com/rero/rero-ils-ui/pull/204) ([AoNoOokami](https://github.com/AoNoOokami))
Expand All @@ -287,6 +306,7 @@
- document: display url in detail view [\#180](https://github.com/rero/rero-ils-ui/pull/180) ([AoNoOokami](https://github.com/AoNoOokami))
- document: add "show more" link [\#166](https://github.com/rero/rero-ils-ui/pull/166) ([zannkukai](https://github.com/zannkukai))
- circulation: Fees tab implementation [\#155](https://github.com/rero/rero-ils-ui/pull/155) ([zannkukai](https://github.com/zannkukai))
- item: add request on item by librarian [\#147](https://github.com/rero/rero-ils-ui/pull/147) ([Garfield-fr](https://github.com/Garfield-fr))

## [v0.0.12](https://github.com/rero/rero-ils-ui/tree/v0.0.12) (2020-03-02)

Expand Down Expand Up @@ -347,7 +367,6 @@
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'fr' [\#150](https://github.com/rero/rero-ils-ui/pull/150) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- Translate '/projects/admin/src/app/translate/i18n/en\_US.json' in 'de' [\#149](https://github.com/rero/rero-ils-ui/pull/149) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- Translate '/projects/public-search/src/app/translate/i18n/en\_US.json' in 'de' [\#148](https://github.com/rero/rero-ils-ui/pull/148) ([transifex-integration[bot]](https://github.com/apps/transifex-integration))
- item: add request on item by librarian [\#147](https://github.com/rero/rero-ils-ui/pull/147) ([Garfield-fr](https://github.com/Garfield-fr))
- circulation: fix on loan tab behaviour [\#146](https://github.com/rero/rero-ils-ui/pull/146) ([AoNoOokami](https://github.com/AoNoOokami))
- switch library: fix the display of the switch menu on the homepage [\#144](https://github.com/rero/rero-ils-ui/pull/144) ([Garfield-fr](https://github.com/Garfield-fr))
- header: fix broken rero ils source \(base64 convert\) [\#143](https://github.com/rero/rero-ils-ui/pull/143) ([Garfield-fr](https://github.com/Garfield-fr))
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rero/rero-ils-ui",
"version": "0.7.1",
"version": "0.8.0",
"license": "AGPL-3.0-only",
"author": {
"name": "RERO",
Expand Down Expand Up @@ -74,7 +74,7 @@
"@ngx-formly/bootstrap": "^5.10.5",
"@ngx-formly/core": "^5.10.5",
"@ngx-translate/core": "^12.1.1",
"@rero/ng-core": "^0.14.1",
"@rero/ng-core": "^0.14.2",
"bootstrap": "^4.3.1",
"crypto-js": "^3.1.9-1",
"document-register-element": "^1.7.2",
Expand Down
4 changes: 4 additions & 0 deletions projects/admin/src/app/routes/patrons-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export class PatronsRoute extends BaseRoute implements RouteInterface {
if (record.blocked === false) {
delete record.blocked_note;
}
// Clean-up 'patron' data from record if the patron doesn't have the 'patron' role
if (!record.roles.includes('patron') && 'patron' in record) {
delete record.patron;
}
return record;
},
formFieldMap: (field: FormlyFieldConfig, jsonSchema: JSONSchema7): FormlyFieldConfig => {
Expand Down

0 comments on commit bb59378

Please sign in to comment.