Skip to content

Commit 7d51f5c

Browse files
committed
Merge pull request #84 in CCKEY/frontend from feature/CCKEY-204-tag-administration-ui to master
* commit 'd0d4161e883d9be8b235aa47eeb96221e7fad24c': CCKEY-204 Fixed comments CCKEY-204 Updated package lock, fixed tests CCKEY-204 Added tests for new modal, admin menu CCKEY-204 Added colorpicker to tag modal CCKEY-204 Added tags
2 parents afc2033 + d0d4161 commit 7d51f5c

33 files changed

+5483
-741
lines changed

package-lock.json

Lines changed: 1572 additions & 729 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"prop-type": "latest",
4343
"rc-queue-anim": "1.0.4",
4444
"react": "15.4.2",
45+
"react-color": "2.13.8",
4546
"react-copy-to-clipboard": "5.0.0",
4647
"react-dom": "15.4.2",
4748
"react-file-download": "0.3.4",

src/BaseLayout.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ import {
1414
KEY_STORE,
1515
USER_STORE,
1616
USER_GROUP_STORE,
17-
ENCRYPTION_JOB_STORE, INVOCATION_HELPER
17+
ENCRYPTION_JOB_STORE,
18+
INVOCATION_HELPER,
19+
TAG_STORE
1820
} from "./stores/storeConstants";
1921
import {ADMINISTRATION, ROOT} from "./routes/routeConstants";
2022
import {
2123
ROUTE_SIGNOUT,
2224
ROUTE_DASHBOARD,
2325
ROUTE_ADMINISTRATION_USER_GROUPS,
2426
ROUTE_ADMINISTRATION_USERS,
25-
ROUTE_KEYS
27+
ROUTE_KEYS,
28+
ROUTE_ADMINISTRATION_TAGS
2629
} from "./routes/routeMappings";
2730
import {
2831
VERSION,
@@ -42,7 +45,7 @@ import "antd/lib/icon/style/css";
4245
import "antd/lib/row/style/css";
4346
import "./BaseLayout.less";
4447

45-
@inject(AUTHORITY_STORE, AUTH_STORE, CATEGORY_STORE, KEY_STORE, USER_STORE, USER_GROUP_STORE, ENCRYPTION_JOB_STORE, INVOCATION_HELPER) @observer
48+
@inject(AUTHORITY_STORE, AUTH_STORE, CATEGORY_STORE, KEY_STORE, USER_STORE, USER_GROUP_STORE, ENCRYPTION_JOB_STORE, INVOCATION_HELPER, TAG_STORE) @observer
4649
class BaseLayout extends React.Component {
4750
constructor(props) {
4851
super(props);
@@ -105,14 +108,16 @@ class BaseLayout extends React.Component {
105108
this.props.categoryStore.fetchAll(),
106109
this.props.keyStore.fetchAll(),
107110
this.props.userStore.fetchAll(),
108-
this.props.userGroupStore.fetchAll()
111+
this.props.userGroupStore.fetchAll(),
112+
this.props.tagStore.fetchAll()
109113
]);
110114
};
111115

112116
initializeUserStores = () => {
113117
return apiService.all([
114118
this.props.categoryStore.fetchAll(),
115-
this.props.keyStore.fetchAll()
119+
this.props.keyStore.fetchAll(),
120+
this.props.tagStore.fetchAll()
116121
]);
117122
};
118123

@@ -250,6 +255,12 @@ class BaseLayout extends React.Component {
250255
isActive={() => this.isActiveSidebarNavLink(ROUTE_ADMINISTRATION_USER_GROUPS)}>User Groups
251256
</NavLink>
252257
</Menu.Item>
258+
<Menu.Item key={ROUTE_ADMINISTRATION_TAGS}>
259+
<NavLink
260+
to={ROUTE_ADMINISTRATION_TAGS}
261+
isActive={() => this.isActiveSidebarNavLink(ROUTE_ADMINISTRATION_TAGS)}>Tags
262+
</NavLink>
263+
</Menu.Item>
253264
</Menu.SubMenu>
254265
}
255266
</Menu>
@@ -427,6 +438,11 @@ BaseLayout.propTypes = {
427438
*/
428439
encryptionJobStore: MobXPropTypes.objectOrObservableObject,
429440

441+
/**
442+
* @type {ObservableArray} tagStore - The injected tag store
443+
*/
444+
tagStore: MobXPropTypes.observableArray,
445+
430446
/**
431447
* @type {object} passphraseNeeded - The state object that invokes a passphrase modal
432448
*/

src/Communikey.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import SignIn from "./routes/SignIn";
2121
import SignOut from "./routes/SignOut";
2222
import UserAdministration from "./routes/administration/UserAdministration";
2323
import UserGroupAdministration from "./routes/administration/UserGroupAdministration";
24+
import TagAdministration from "./routes/administration/TagAdministration";
2425
import Dashboard from "./routes/Dashboard";
2526
import Keys from "./routes/Keys";
2627
import AuthorityStore from "./stores/AuthorityStore";
@@ -29,6 +30,7 @@ import CategoryStore from "./stores/CategoryStore";
2930
import KeyStore from "./stores/KeyStore";
3031
import UserGroupStore from "./stores/UserGroupStore";
3132
import UserStore from "./stores/UserStore";
33+
import TagStore from "./stores/TagStore";
3234
import EncryptionJobStore from "./stores/EncryptionJobStore";
3335
import EventStore from "./stores/EventStore";
3436
import InvocationHelper from "./stores/InvocationHelper";
@@ -37,6 +39,7 @@ import motionConfig from "./config/motion";
3739
import {
3840
ROUTE_ADMINISTRATION_USERS,
3941
ROUTE_ADMINISTRATION_USER_GROUPS,
42+
ROUTE_ADMINISTRATION_TAGS,
4043
ROUTE_DASHBOARD,
4144
ROUTE_KEYS,
4245
ROUTE_LINKED_KEY,
@@ -124,14 +127,21 @@ export const eventStore = new EventStore();
124127
*/
125128
export const invocationHelper = new InvocationHelper();
126129

130+
/**
131+
* The tag store instance.
132+
*
133+
* @type {TagStore}
134+
* @since 0.18.0
135+
*/
136+
export const tagStore = new TagStore();
127137

128138
/**
129139
* The wrapper for all store instances to be injected via a MobX {@linkplain Provider} components.
130140
*
131141
* @type {Object.<{AuthorityStore}, {AuthStore}, {CategoryStore}, {KeyStore},
132142
* {UserGroupStore}, {UserStore}, {EncryptionJobStore}, {EventStore}, {InvocationHelper}>}
133143
*/
134-
const stores = {authorityStore, authStore, categoryStore, keyStore, userGroupStore, userStore, encryptionJobStore, eventStore, invocationHelper};
144+
const stores = {authorityStore, authStore, categoryStore, keyStore, userGroupStore, userStore, encryptionJobStore, eventStore, invocationHelper, tagStore};
135145

136146
/**
137147
* The notification service instance.
@@ -273,6 +283,12 @@ class Communikey extends React.Component {
273283
authorized={stores.authStore.isAuthorized}
274284
privileged={stores.authStore.privileged}
275285
/>
286+
<AuthenticatedPrivilegedRoute
287+
path={ROUTE_ADMINISTRATION_TAGS}
288+
component={TagAdministration}
289+
authorized={stores.authStore.isAuthorized}
290+
privileged={stores.authStore.privileged}
291+
/>
276292
<KeyDeepLinkAuthenticatedRoute path={ROUTE_LINKED_KEY} component={Keys} authorized={stores.authStore.isAuthorized}/>
277293
<CategoryDeepLinkAuthenticatedRoute path={ROUTE_LINKED_CATEGORY} component={Keys} authorized={stores.authStore.isAuthorized}/>
278294
<AuthenticatedRoute path={ROUTE_KEYS} component={Keys} authorized={stores.authStore.isAuthorized}/>

0 commit comments

Comments
 (0)