Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(front): allow filtering from ui by project #218

Merged
merged 1 commit into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions web/src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,53 @@ export const ARTIFACT_KINDS = Object.values(ARTIFACT_KIND_VALUE).map((kind) =>
kind.toString()
);

export const PROJECT = {
chat: 'chat',
'gomobile-ipfs-demo': 'gomobile-ipfs-demo',
};

export const PROJECTS = Object.values(PROJECT);

export const BUILD_DRIVER_VALUE = {
UnknownDriver: '0',
Buildkite: '1',
CircleCI: '2',
Bintray: '3',
GitHub: '4',
};

export const BUILD_DRIVER_TO_NAME = {
'0': 'UnknownDriver',
'1': 'Buildkite',
'2': 'CircleCI',
'3': 'Bintray',
'4': 'GitHub',
};

export const BUILD_DRIVERS = Object.values(BUILD_DRIVER_VALUE);

export const PROJECT_BUILD_DRIVER = {
chat: BUILD_DRIVER_VALUE.Buildkite,
'gomobile-ipfs-demo': BUILD_DRIVER_VALUE.Bintray,
};

export const PROJECT_ARTIFACT_KINDS = {
chat: [ARTIFACT_KIND_VALUE.IPA],
'gomobile-ipfs-demo': [ARTIFACT_KIND_VALUE.APK, ARTIFACT_KIND_VALUE.IPA],
};

export const BRANCH = {
MASTER: 'MASTER',
};

export const BRANCH_TO_DISPLAY_NAME = {
MASTER: 'Master',
DEVELOP: 'Development',
ALL: 'All',
};

export const IMPLEMENTED_BRANCHES = ['ALL'];

export const MR_STATE = {
UnknownState: 'UnknownState',
Opened: 'Opened',
Expand Down
22 changes: 9 additions & 13 deletions web/src/store/ResultStore.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import React, {useReducer} from 'react';
import {cloneDeep} from 'lodash';
import {retrieveAuthCookie} from '../api/auth';
import {actions, ARTIFACT_KIND_VALUE} from '../constants';
import {groupBuildsByMr} from '../api/dataTransforms';
import {
actions,
ARTIFACT_KIND_VALUE,
PROJECT,
PROJECT_BUILD_DRIVER,
} from '../constants';

// TODO: Yes, this file needs a new name, and should maybe be split
export const ResultContext = React.createContext();
Expand All @@ -19,19 +24,10 @@ export const INITIAL_STATE = {
needsRefresh: false,
uiFilters: {
artifact_kinds: [ARTIFACT_KIND_VALUE.IPA],
build_driver: [PROJECT_BUILD_DRIVER[PROJECT.chat]],
},
filtersBranch: {
master: false,
develop: false,
all: true,
},
filtersApp: {
chat: true,
mini: false,
},
filtersImplemented: {
apps: ['chat'],
branch: ['all'],
calculatedFilters: {
projects: [PROJECT.chat],
},
};

Expand Down
Loading