Skip to content

Commit 78606e0

Browse files
committed
feat(taglist-order): change default value to alpha-asc;num-desc
1 parent 8bbfc5c commit 78606e0

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
show-catalog-nb-tags="${SHOW_CATALOG_NB_TAGS}"
4848
history-custom-labels="${HISTORY_CUSTOM_LABELS}"
4949
use-control-cache-header="${USE_CONTROL_CACHE_HEADER}"
50-
taglist-order="${TAGLIST_ORDER}
50+
taglist-order="${TAGLIST_ORDER}"
5151
theme="${THEME}"
5252
theme-primary-text="${THEME_PRIMARY_TEXT}"
5353
theme-neutral-text="${THEME_NEUTRAL_TEXT}"
@@ -74,7 +74,7 @@
7474
show-catalog-nb-tags="true"
7575
history-custom-labels="first_custom_labels,second_custom_labels"
7676
use-control-cache-header="false"
77-
taglist-order="alpha-asc;num-desc"
77+
taglist-order=""
7878
theme="auto"
7979
theme-primary-text=""
8080
theme-neutral-text=""

src/scripts/taglist-order.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const taglistOrderVariants = (taglistOrder) => {
1616
return `${taglistOrder};${taglistOrder.startsWith('num') ? 'alpha' : 'num'}-asc`;
1717
default:
1818
if (!taglistOrder) {
19-
return 'num-asc;alpha-asc';
19+
return 'alpha-asc;num-desc';
2020
} else if (TAGLIST_ORDER_REGEX.test(taglistOrder)) {
2121
return taglistOrder;
2222
}

test/taglist-order.test.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ describe('utils tests', () => {
1515
expected.forEach((e) => assert.deepEqual(taglistOrderVariants(e), e));
1616
});
1717

18+
it('should return correct default order', () => {
19+
const expected = 'alpha-asc;num-desc';
20+
[undefined, ''].forEach((e) => assert.deepEqual(taglistOrderVariants(e), expected));
21+
});
22+
1823
it('should return correct variant of `num-asc;alpha-asc`', () => {
1924
const expected = 'num-asc;alpha-asc';
20-
[undefined, '', 'asc', 'num-asc'].forEach((e) => assert.deepEqual(taglistOrderVariants(e), expected));
25+
['asc', 'num-asc'].forEach((e) => assert.deepEqual(taglistOrderVariants(e), expected));
2126
});
2227

2328
it('should return correct variant of `alpha-desc;num-desc`', () => {
@@ -39,7 +44,7 @@ describe('utils tests', () => {
3944

4045
describe('taglistOrderParser', () => {
4146
it('should have default configuration when empty or undefined', () => {
42-
const expected = { numAsc: true, alphaAsc: true, numFirst: true };
47+
const expected = { numAsc: false, alphaAsc: true, numFirst: false };
4348
assert.deepEqual(taglistOrderParser(), expected);
4449
assert.deepEqual(taglistOrderParser(''), expected);
4550
});

0 commit comments

Comments
 (0)