Skip to content

Commit 526c1a8

Browse files
committed
Rename RouterNames -> RouteNames
1 parent a2f4c9a commit 526c1a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+258
-259
lines changed

contentcuration/contentcuration/frontend/administration/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const RouterNames = {
1+
export const RouteNames = {
22
CHANNELS: 'CHANNELS',
33
CHANNEL: 'CHANNEL',
44
USERS: 'USERS',

contentcuration/contentcuration/frontend/administration/pages/AdministrationAppError.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<script>
2828
29-
import { RouterNames } from '../constants';
29+
import { RouteNames } from '../constants';
3030
import PermissionsError from 'shared/views/errors/PermissionsError';
3131
import ChannelNotFoundError from 'shared/views/errors/ChannelNotFoundError';
3232
import PageNotFoundError from 'shared/views/errors/PageNotFoundError';
@@ -61,10 +61,10 @@
6161
backFromCurrentPageUrl() {
6262
const currentPage = this.$route.name;
6363
let toName;
64-
if (currentPage === RouterNames.USER) {
65-
toName = RouterNames.USERS;
64+
if (currentPage === RouteNames.USER) {
65+
toName = RouteNames.USERS;
6666
} else {
67-
toName = RouterNames.CHANNELS;
67+
toName = RouteNames.CHANNELS;
6868
}
6969
return {
7070
to: { name: toName },

contentcuration/contentcuration/frontend/administration/pages/AdministrationIndex.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<script>
3030
31-
import { RouterNames } from '../constants';
31+
import { RouteNames } from '../constants';
3232
import AdministrationAppError from './AdministrationAppError';
3333
import AppBar from 'shared/views/AppBar';
3434
import GlobalSnackbar from 'shared/views/GlobalSnackbar';
@@ -52,12 +52,12 @@
5252
},
5353
channelsLink() {
5454
return {
55-
name: RouterNames.CHANNELS,
55+
name: RouteNames.CHANNELS,
5656
};
5757
},
5858
usersLink() {
5959
return {
60-
name: RouterNames.USERS,
60+
name: RouteNames.USERS,
6161
};
6262
},
6363
},

contentcuration/contentcuration/frontend/administration/pages/Channels/ChannelActionsDropdown.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
120120
import { mapActions, mapGetters } from 'vuex';
121121
import ConfirmationDialog from '../../components/ConfirmationDialog';
122-
import { RouterNames } from '../../constants';
122+
import { RouteNames } from '../../constants';
123123
import { channelExportMixin } from 'shared/views/channel/mixins';
124124
125125
export default {
@@ -151,7 +151,7 @@
151151
},
152152
searchChannelEditorsLink() {
153153
return {
154-
name: RouterNames.USERS,
154+
name: RouteNames.USERS,
155155
query: {
156156
search: `${this.name} ${this.channel.id}`,
157157
},

contentcuration/contentcuration/frontend/administration/pages/Channels/ChannelDetails.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<script>
5555
5656
import { mapActions, mapGetters } from 'vuex';
57-
import { RouterNames } from '../../constants';
57+
import { RouteNames } from '../../constants';
5858
import ChannelActionsDropdown from './ChannelActionsDropdown';
5959
import ChannelSharing from 'shared/views/channel/ChannelSharing';
6060
import Details from 'shared/views/details/Details';
@@ -109,7 +109,7 @@
109109
},
110110
backLink() {
111111
return {
112-
name: RouterNames.CHANNELS,
112+
name: RouteNames.CHANNELS,
113113
query: this.$route.query,
114114
};
115115
},

contentcuration/contentcuration/frontend/administration/pages/Channels/ChannelItem.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
175175
import { mapGetters, mapActions } from 'vuex';
176176
import ClipboardChip from '../../components/ClipboardChip';
177-
import { RouterNames } from '../../constants';
177+
import { RouteNames } from '../../constants';
178178
import ChannelActionsDropdown from './ChannelActionsDropdown';
179179
import Checkbox from 'shared/views/form/Checkbox';
180180
import { fileSizeMixin } from 'shared/mixins';
@@ -220,7 +220,7 @@
220220
},
221221
channelModalLink() {
222222
return {
223-
name: RouterNames.CHANNEL,
223+
name: RouteNames.CHANNEL,
224224
params: { channelId: this.channelId },
225225
query: this.$route.query,
226226
};
@@ -230,7 +230,7 @@
230230
},
231231
searchChannelEditorsLink() {
232232
return {
233-
name: RouterNames.USERS,
233+
name: RouteNames.USERS,
234234
query: {
235235
keywords: `${this.channel.name} ${this.channelId}`,
236236
},

contentcuration/contentcuration/frontend/administration/pages/Channels/ChannelTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
102102
import { mapGetters, mapActions } from 'vuex';
103103
import { tableMixin, generateFilterMixin } from '../../mixins';
104-
import { RouterNames, rowsPerPageItems } from '../../constants';
104+
import { RouteNames, rowsPerPageItems } from '../../constants';
105105
import ChannelItem from './ChannelItem';
106106
import { channelExportMixin } from 'shared/views/channel/mixins';
107107
import { routerMixin } from 'shared/mixins';
@@ -195,7 +195,7 @@
195195
$route: {
196196
deep: true,
197197
handler(newRoute, oldRoute) {
198-
if (newRoute.name === oldRoute.name && newRoute.name === RouterNames.CHANNELS)
198+
if (newRoute.name === oldRoute.name && newRoute.name === RouteNames.CHANNELS)
199199
this.selected = [];
200200
},
201201
},

contentcuration/contentcuration/frontend/administration/pages/Channels/__tests__/channelDetails.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { mount } from '@vue/test-utils';
22
import router from '../../../router';
33
import { factory } from '../../../store';
4-
import { RouterNames } from '../../../constants';
4+
import { RouteNames } from '../../../constants';
55
import ChannelDetails from './../ChannelDetails';
66

77
const store = factory();
88

99
const channelId = '11111111111111111111111111111111';
1010

1111
function makeWrapper() {
12-
router.replace({ name: RouterNames.CHANNEL, params: { channelId } });
12+
router.replace({ name: RouteNames.CHANNEL, params: { channelId } });
1313
return mount(ChannelDetails, {
1414
router,
1515
store,
@@ -37,7 +37,7 @@ describe('channelDetails', () => {
3737
});
3838
it('clicking close should close the modal', () => {
3939
wrapper.vm.dialog = false;
40-
expect(wrapper.vm.$route.name).toBe(RouterNames.CHANNELS);
40+
expect(wrapper.vm.$route.name).toBe(RouteNames.CHANNELS);
4141
});
4242
describe('load', () => {
4343
it('should automatically close if loadChannel does not find a channel', () => {
@@ -46,7 +46,7 @@ describe('channelDetails', () => {
4646
loadChannelDetails: jest.fn().mockReturnValue(Promise.resolve()),
4747
});
4848
return wrapper.vm.load().then(() => {
49-
expect(wrapper.vm.$route.name).toBe(RouterNames.CHANNELS);
49+
expect(wrapper.vm.$route.name).toBe(RouteNames.CHANNELS);
5050
});
5151
});
5252
it('load should call loadChannel and loadChannelDetails', () => {

contentcuration/contentcuration/frontend/administration/pages/Channels/__tests__/channelItem.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { mount } from '@vue/test-utils';
22
import router from '../../../router';
33
import { factory } from '../../../store';
4-
import { RouterNames } from '../../../constants';
4+
import { RouteNames } from '../../../constants';
55
import ChannelItem from '../ChannelItem';
66

77
const store = factory();
@@ -21,7 +21,7 @@ const channel = {
2121
};
2222

2323
function makeWrapper() {
24-
router.replace({ name: RouterNames.CHANNELS });
24+
router.replace({ name: RouteNames.CHANNELS });
2525
return mount(ChannelItem, {
2626
router,
2727
store,

contentcuration/contentcuration/frontend/administration/pages/Channels/__tests__/channelTable.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { mount } from '@vue/test-utils';
22
import router from '../../../router';
33
import { factory } from '../../../store';
4-
import { RouterNames } from '../../../constants';
4+
import { RouteNames } from '../../../constants';
55
import ChannelTable from '../ChannelTable';
66

77
const store = factory();
88

99
const loadChannels = jest.fn().mockReturnValue(Promise.resolve());
1010
const channelList = ['test', 'channel', 'table'];
1111
function makeWrapper() {
12-
router.replace({ name: RouterNames.CHANNELS });
12+
router.replace({ name: RouteNames.CHANNELS });
1313
return mount(ChannelTable, {
1414
router,
1515
store,

0 commit comments

Comments
 (0)