mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Move the ordered import formats into one registry consumed by both renderers. Give cookieless clients a signed, keyboard-accessible source picker at the existing import URLs, retain branded WeKan naming, and compare the Trello picker in same-URL screenshots.
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
// One ordered source registry for the HTML5 picker and the progressively
|
|
// enhanced HTML4 baseline. A source key is also the final /import/:source path
|
|
// segment, so keep keys URL-safe and stable for bookmarks.
|
|
const IMPORT_SOURCES = Object.freeze([
|
|
{ key: 'wekan', product: true },
|
|
{ key: 'trello', name: 'Trello' },
|
|
{ key: 'csv', name: 'CSV / TSV' },
|
|
{ key: 'excel', name: 'Excel' },
|
|
{ key: 'jira', name: 'Jira' },
|
|
{ key: 'kanboard', name: 'Kanboard' },
|
|
{ key: 'deck', name: 'NextCloud Deck' },
|
|
{ key: 'openproject', name: 'OpenProject' },
|
|
{ key: 'github', name: 'GitHub' },
|
|
{ key: 'gitlab', name: 'GitLab' },
|
|
{ key: 'gitea', name: 'Gitea' },
|
|
{ key: 'forgejo', name: 'Forgejo' },
|
|
{ key: 'asana', name: 'Asana' },
|
|
{ key: 'zenkit', name: 'Zenkit' },
|
|
]);
|
|
|
|
function importSourceByKey(key) {
|
|
return IMPORT_SOURCES.find(source => source.key === key) || null;
|
|
}
|
|
|
|
function importSourceName(source, productName = 'WeKan') {
|
|
if (!source) return '';
|
|
return source.product ? `${productName || 'WeKan'} (JSON, .zip)` : source.name;
|
|
}
|
|
|
|
module.exports = { IMPORT_SOURCES, importSourceByKey, importSourceName };
|