Commit 68cdc30c authored by Rajat Jain's avatar Rajat Jain

Display Recent Boards in Board switcher

Add a new Recent section in the board switcher along with a
All section which like old times display all the available boards.
Recent section lists the recent 5 boards you have visited for a quick
switch.
parent 615c14b2
...@@ -58,6 +58,7 @@ export default () => { ...@@ -58,6 +58,7 @@ export default () => {
state: boardsStore.state, state: boardsStore.state,
loading: true, loading: true,
boardsEndpoint: $boardApp.dataset.boardsEndpoint, boardsEndpoint: $boardApp.dataset.boardsEndpoint,
recentBoardsEndpoint: $boardApp.dataset.recentBoardsEndpoint,
listsEndpoint: $boardApp.dataset.listsEndpoint, listsEndpoint: $boardApp.dataset.listsEndpoint,
boardId: $boardApp.dataset.boardId, boardId: $boardApp.dataset.boardId,
disabled: parseBoolean($boardApp.dataset.disabled), disabled: parseBoolean($boardApp.dataset.disabled),
...@@ -75,6 +76,7 @@ export default () => { ...@@ -75,6 +76,7 @@ export default () => {
created() { created() {
gl.boardService = new BoardService({ gl.boardService = new BoardService({
boardsEndpoint: this.boardsEndpoint, boardsEndpoint: this.boardsEndpoint,
recentBoardsEndpoint: this.recentBoardsEndpoint,
listsEndpoint: this.listsEndpoint, listsEndpoint: this.listsEndpoint,
bulkUpdatePath: this.bulkUpdatePath, bulkUpdatePath: this.bulkUpdatePath,
boardId: this.boardId, boardId: this.boardId,
......
...@@ -2,12 +2,13 @@ import axios from '../../lib/utils/axios_utils'; ...@@ -2,12 +2,13 @@ import axios from '../../lib/utils/axios_utils';
import { mergeUrlParams } from '../../lib/utils/url_utility'; import { mergeUrlParams } from '../../lib/utils/url_utility';
export default class BoardService { export default class BoardService {
constructor({ boardsEndpoint, listsEndpoint, bulkUpdatePath, boardId }) { constructor({ boardsEndpoint, listsEndpoint, bulkUpdatePath, boardId, recentBoardsEndpoint }) {
this.boardsEndpoint = boardsEndpoint; this.boardsEndpoint = boardsEndpoint;
this.boardId = boardId; this.boardId = boardId;
this.listsEndpoint = listsEndpoint; this.listsEndpoint = listsEndpoint;
this.listsEndpointGenerate = `${listsEndpoint}/generate.json`; this.listsEndpointGenerate = `${listsEndpoint}/generate.json`;
this.bulkUpdatePath = bulkUpdatePath; this.bulkUpdatePath = bulkUpdatePath;
this.recentBoardsEndpoint = `${recentBoardsEndpoint}.json`;
} }
generateBoardsPath(id) { generateBoardsPath(id) {
......
...@@ -16,6 +16,7 @@ const httpStatusCodes = { ...@@ -16,6 +16,7 @@ const httpStatusCodes = {
IM_USED: 226, IM_USED: 226,
MULTIPLE_CHOICES: 300, MULTIPLE_CHOICES: 300,
BAD_REQUEST: 400, BAD_REQUEST: 400,
UNAUTHORIZED: 401,
FORBIDDEN: 403, FORBIDDEN: 403,
NOT_FOUND: 404, NOT_FOUND: 404,
UNPROCESSABLE_ENTITY: 422, UNPROCESSABLE_ENTITY: 422,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment