Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit 9d2ebd5

Browse files
committed
feat(feed2): add title link
1 parent 9a220d2 commit 9d2ebd5

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

components/PureRevisionPanel.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<section>
33
<template v-if="infoLoaded">
4-
<h2 class="rev-title">{{item.title}}</h2>
4+
<h2 class="rev-title"><a :href="wikiPageLink(item.wiki, item.title)">{{item.title}}</a></h2>
55
<div class="rev-info">
66
<div class="rev-info__item"><i class="fas fa-faucet fa-fw"></i>{{item.feed || 'default'}}</div>
77
<div class="rev-info__item"><i class="fas fa-info-circle fa-fw"></i>{{item.wiki}}:{{item.revId}}</div>
@@ -36,6 +36,7 @@ import { mapState } from 'vuex';
3636
3737
import { Component, Prop, Vue} from 'nuxt-property-decorator';
3838
import { RevisionPanelItem } from '~/shared/interfaces';
39+
import { wikiPageLink } from '~/shared/mwapi2';
3940
4041
@Component({
4142
components: {
@@ -47,6 +48,8 @@ export default class PureRevisionPanel extends Vue {
4748
@Prop({ type: Boolean}) readonly infoLoaded: boolean;
4849
@Prop({ type: Boolean}) readonly diffLoaded: boolean;
4950
@Prop({ type: Object }) readonly item: RevisionPanelItem;
51+
52+
public wikiPageLink = wikiPageLink;
5053
}
5154
</script>
5255
<style lang="scss" scoped>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"prod:pm2": "npx pm2 start eco.yml --env=production",
2020
"prod": "npm run build && npm run start",
2121
"release": "HUSKY_SKIP_HOOKS=1 standard-version",
22+
"sb": "nuxt storybook",
2223
"start": "npm run dev",
2324
"test:integration": "jest --testPathIgnorePatterns=THIS_SHALL_NEVER_MATCH_ANYTHING --testPathPattern=integration --verbose",
2425
"test:full": "jest --testPathIgnorePatterns=THIS_SHALL_NEVER_MATCH_ANYTHING --verbose",

shared/mwapi2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export interface MwRevisionInfo extends MwPageInfo {
5252
timestampStr:string,
5353
}
5454

55+
export function wikiPageLink(wiki, title) {
56+
let encodedTitle = title.replace(' ', '_');
57+
return `https://${wikiToDomain[wiki]}/wiki/${encodedTitle}`;
58+
}
59+
5560
/**
5661
* An class for utility functions for MediaWiki Action Client.
5762
*/

shared/utility-shared.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export const wikiToLangMap = (function() {
8181
return _wikiToLangMap;
8282
})();
8383

84-
8584
export let getUrlBaseByWiki = function(wiki) {
8685
return `http://${wikiToDomain[wiki]}`;
8786
};

0 commit comments

Comments
 (0)