diff --git a/README.md b/README.md
index d0128889..df122450 100644
--- a/README.md
+++ b/README.md
@@ -109,6 +109,10 @@ The following dependencies should be ignored:
- lint-staged:
[v15.0.0](https://github.com/lint-staged/lint-staged/releases/tag/v15.0.0) drops compatibility with Node 16,
which we still use in CI (see also “Prerequisites” above; Node 18 upgrade pending in [T331180](https://phabricator.wikimedia.org/T331180)).
+- Node.js version:
+ The GitHub Workflows here should use the same Node.js version as the `mwgate-nodeXX-docker` CI job in WikibaseLexeme,
+ because that job builds this app for the `test:snl-distnodiff` script.
+ The upgrade to Node 18 there is tracked in [T331180](https://phabricator.wikimedia.org/T331180).
All other dependencies should generally be updated to the latest version.
If you discover that a dependency should not be updated for some reason, please add it to the above list.
diff --git a/index.html b/index.html
index d0ac1876..da0c4d0e 100644
--- a/index.html
+++ b/index.html
@@ -21,6 +21,7 @@
New Lexeme
const config = {
rootSelector: '#app',
isAnonymous: false,
+ tempUserEnabled: false,
licenseUrl: 'https://creativecommons.org/publicdomain/zero/1.0/',
licenseName: 'Creative Commons CC0',
wikibaseLexemeTermLanguages: new Map([
diff --git a/src/components/AnonymousEditWarning.vue b/src/components/AnonymousEditWarning.vue
index 02300f08..ec7ac614 100644
--- a/src/components/AnonymousEditWarning.vue
+++ b/src/components/AnonymousEditWarning.vue
@@ -4,16 +4,21 @@ import { useConfig } from '@/plugins/ConfigPlugin/Config';
import { useMessages } from '@/plugins/MessagesPlugin/Messages';
import { computed } from 'vue';
import { useAuthenticationLinker } from '@/plugins/AuthenticationLinkerPlugin/AuthenticationLinker';
+import MessageKeys from '@/plugins/MessagesPlugin/MessageKeys';
const authenticationLinker = useAuthenticationLinker();
const messages = useMessages();
+const config = useConfig();
+let messageKey: MessageKeys = 'wikibase-anonymouseditwarning';
+if ( config.tempUserEnabled ) {
+ messageKey = 'wikibase-anonymouseditnotificationtempuser';
+}
const warning = computed(
() => messages.get(
- 'wikibase-anonymouseditwarning',
+ messageKey,
authenticationLinker.getLoginLink(),
authenticationLinker.getCreateAccountLink(),
) );
-const config = useConfig();
diff --git a/src/plugins/ConfigPlugin/Config.ts b/src/plugins/ConfigPlugin/Config.ts
index 08210065..f4b922ab 100644
--- a/src/plugins/ConfigPlugin/Config.ts
+++ b/src/plugins/ConfigPlugin/Config.ts
@@ -8,6 +8,7 @@ export interface Config {
readonly isAnonymous: boolean;
readonly licenseUrl: string;
readonly licenseName: string;
+ readonly tempUserEnabled: boolean;
readonly wikibaseLexemeTermLanguages: Map;
readonly lexicalCategorySuggestions: SearchedItemOption[];
readonly placeholderExampleData: {
diff --git a/src/plugins/MessagesPlugin/DevMessagesRepository.ts b/src/plugins/MessagesPlugin/DevMessagesRepository.ts
index 50f45d9b..4d82859d 100644
--- a/src/plugins/MessagesPlugin/DevMessagesRepository.ts
+++ b/src/plugins/MessagesPlugin/DevMessagesRepository.ts
@@ -25,6 +25,7 @@ const messages: Record = {
'wikibaselexeme-newlexeme-submitting': 'Creating Lexeme...',
'wikibaselexeme-newlexeme-lemma-too-long-error': 'The Lemma field is too long; please make an entry no longer than $1 characters.',
'wikibaselexeme-newlexeme-invalid-language-code-warning': 'This Item has an unrecognized language code. Please select one below.',
+ 'wikibase-anonymouseditnotificationtempuser': 'If you log in or create an account ...',
'wikibase-anonymouseditwarning': 'Warning: You are not logged in. Your IP address will be publicly visible ... If you log in or create an account ...',
'wikibase-lexeme-lemma-language-option': '$1 ($2)',
'wikibase-entityselector-notfound': 'No match was found',
diff --git a/src/plugins/MessagesPlugin/MessageKeys.ts b/src/plugins/MessagesPlugin/MessageKeys.ts
index be212ad9..d3e349fb 100644
--- a/src/plugins/MessagesPlugin/MessageKeys.ts
+++ b/src/plugins/MessagesPlugin/MessageKeys.ts
@@ -23,6 +23,7 @@ type MessageKeys
| 'wikibaselexeme-newlexeme-lemma-too-long-error'
| 'wikibaselexeme-newlexeme-invalid-language-code-warning'
| 'wikibase-anonymouseditwarning'
+ | 'wikibase-anonymouseditnotificationtempuser'
| 'wikibase-lexeme-lemma-language-option'
| 'wikibase-entityselector-notfound'
| 'wikibase-shortcopyrightwarning'
diff --git a/tests/integration/App.test.ts b/tests/integration/App.test.ts
index 8175ed3d..87ff1b0d 100644
--- a/tests/integration/App.test.ts
+++ b/tests/integration/App.test.ts
@@ -52,6 +52,7 @@ describe( 'App.vue', () => {
},
maxLemmaLength: 1000,
availableSearchProfiles: [],
+ tempUserEnabled: false,
};
const lexemeNS = 146;
const testUrl = 'https://example.com';
diff --git a/tests/integration/NewLexemeForm.test.ts b/tests/integration/NewLexemeForm.test.ts
index be75f215..e4e1fa49 100644
--- a/tests/integration/NewLexemeForm.test.ts
+++ b/tests/integration/NewLexemeForm.test.ts
@@ -35,6 +35,7 @@ describe( 'NewLexemeForm', () => {
},
maxLemmaLength: 1000,
availableSearchProfiles: [],
+ tempUserEnabled: false,
};
function mountForm( storeServices: Partial = {}, pluginOverrides = {} ) {
diff --git a/tests/unit/components/AnonymousEditWarning.test.ts b/tests/unit/components/AnonymousEditWarning.test.ts
index 91d2f729..d2fa3297 100644
--- a/tests/unit/components/AnonymousEditWarning.test.ts
+++ b/tests/unit/components/AnonymousEditWarning.test.ts
@@ -50,4 +50,26 @@ describe( 'AnonymousEditWarning', () => {
expect( messages.get ).toHaveBeenCalledWith( 'wikibase-anonymouseditwarning', 'loginLink', 'createAccountLink' );
} );
+ it( 'uses alternative message if tempuser is enabled', () => {
+ const messages = { get: jest.fn().mockImplementation( ( ...params ) =>
+ `(${params.join( ', ' )})`,
+ ) };
+ const authenticationLinker = {
+ getLoginLink: jest.fn().mockReturnValue( 'loginLink' ),
+ getCreateAccountLink: jest.fn().mockReturnValue( 'createAccountLink' ),
+ };
+ const warning = mount( AnonymousEditWarning, {
+ global: {
+ provide: {
+ [ ConfigKey as symbol ]: { isAnonymous: true, tempUserEnabled: true },
+ [ MessagesKey as symbol ]: messages,
+ [ AuthenticationLinkerKey as symbol ]: authenticationLinker,
+ },
+ },
+ } );
+
+ expect( warning.html() ).toMatchSnapshot();
+ expect( messages.get ).toHaveBeenCalledWith( 'wikibase-anonymouseditnotificationtempuser', 'loginLink', 'createAccountLink' );
+ } );
+
} );
diff --git a/tests/unit/components/__snapshots__/AnonymousEditWarning.test.ts.snap b/tests/unit/components/__snapshots__/AnonymousEditWarning.test.ts.snap
index de03082a..97ff8874 100644
--- a/tests/unit/components/__snapshots__/AnonymousEditWarning.test.ts.snap
+++ b/tests/unit/components/__snapshots__/AnonymousEditWarning.test.ts.snap
@@ -1,3 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AnonymousEditWarning matches snapshot if anonymous 1`] = `"