Skip to content

Commit

Permalink
change living parameter to blp in banner shell (#402)
Browse files Browse the repository at this point in the history
* living>blp

living>blp

* living>blp

* living>blp

* fix value

* fix value

* fix value

---------

Co-authored-by: NovemLinguae <[email protected]>
  • Loading branch information
DreamRimmer and NovemLinguae authored Jan 19, 2025
1 parent 3541123 commit cba88e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/modules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1679,17 +1679,17 @@
// delete existing biography banner. when accepting, reviewer is forced to choose if it's a biography or not, so we'll add (or not add) our own biography banner later
banners = banners.filter( ( value ) => !value.match( /^{{WikiProject Biography/i ) );

// add biography banner to array. and add |living= and |listas= to banner shell
// add biography banner to array. and add |blp= and |listas= to banner shell
let bannerShellExtraParams = '';
if ( isBiography ) {
banners.push(
'{{WikiProject Biography}}'
);

if ( lifeStatus === 'living' ) {
bannerShellExtraParams += ' |living=yes';
bannerShellExtraParams += ' |blp=yes';
} else if ( lifeStatus === 'dead' ) {
bannerShellExtraParams += ' |living=no';
bannerShellExtraParams += ' |blp=no';
}

if ( subjectName ) {
Expand Down
8 changes: 4 additions & 4 deletions tests/test-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = 'Lazarut, Raluca';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell |living=yes |listas=Lazarut, Raluca |1=
`{{WikiProject banner shell |blp=yes |listas=Lazarut, Raluca |1=
{{subst:WPAFC/article |oldid=592507}}
{{WikiProject Film}}
{{WikiProject Women}}
Expand Down Expand Up @@ -326,7 +326,7 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = 'Jones, Bob';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell |class=B |living=yes |listas=Jones, Bob |1=
`{{WikiProject banner shell |class=B |blp=yes |listas=Jones, Bob |1=
{{subst:WPAFC/article |oldid=592496}}
{{WikiProject Biography}}
{{WikiProject Africa}}
Expand All @@ -345,7 +345,7 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="
const subjectName = '';
const output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName );
expect( output ).toBe(
`{{WikiProject banner shell |living=no |1=
`{{WikiProject banner shell |blp=no |1=
{{subst:WPAFC/article |oldid=592496}}
{{WikiProject Biography}}
}}`
Expand All @@ -354,7 +354,7 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|<span style="

it.skip( 'talk page has {{wikiproject biography}}, and user selects that it\'s not a biography, so should remove {{wikiproject biography}}', () => {
const wikicode =
`{{wikiproject biography|living=yes|class=B|listas=Jones, Bob}}
`{{wikiproject biography|blp=yes|class=B|listas=Jones, Bob}}
{{WikiProject Somalia}}`;
const newAssessment = '';
const revId = 592496;
Expand Down

0 comments on commit cba88e4

Please sign in to comment.