1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

fix: link to toggle view

This commit is contained in:
Ivar Conradi Østhus 2021-10-14 11:01:22 +02:00
parent 3575838a77
commit 9ad2c8f7ff
3 changed files with 10 additions and 1 deletions

View File

@ -35,6 +35,7 @@ const FeatureToggleList = ({
toggleFeature,
archive,
loading,
flags,
}) => {
const { hasAccess } = useContext(AccessContext);
const styles = useStyles();
@ -72,6 +73,8 @@ const FeatureToggleList = ({
revive={revive}
hasAccess={hasAccess}
className={'skeleton'}
flags={flags}
archive={archive}
/>
));
}
@ -91,6 +94,7 @@ const FeatureToggleList = ({
toggleFeature={toggleFeature}
revive={revive}
hasAccess={hasAccess}
flags={flags}
/>
))}
elseShow={
@ -223,6 +227,7 @@ FeatureToggleList.propTypes = {
history: PropTypes.object.isRequired,
loading: PropTypes.bool,
currentProjectId: PropTypes.string.isRequired,
flags: PropTypes.object,
};
export default FeatureToggleList;

View File

@ -28,6 +28,7 @@ const FeatureToggleListItem = ({
metricsLastMinute = { yes: 0, no: 0, isFallback: true },
revive,
hasAccess,
flags = {},
...rest
}) => {
const styles = useStyles();
@ -51,7 +52,7 @@ const FeatureToggleListItem = ({
<span className={classnames(styles.listItemLink)}>
<ConditionallyRender condition={!isArchive} show={
<Link
to={getTogglePath(feature.project, name)}
to={getTogglePath(feature.project, name, flags.E)}
className={classnames(
commonStyles.listLink,
commonStyles.truncate
@ -127,6 +128,7 @@ FeatureToggleListItem.propTypes = {
metricsLastMinute: PropTypes.object,
revive: PropTypes.func,
hasAccess: PropTypes.func.isRequired,
flags: PropTypes.object,
};
export default memo(FeatureToggleListItem);

View File

@ -22,6 +22,7 @@ function resolveCurrentProjectId(settings) {
export const mapStateToPropsConfigurable = isFeature => state => {
const featureMetrics = state.featureMetrics.toJS();
const flags = state.uiConfig.toJS().flags;
const settings = state.settings.toJS().feature || {};
let features = isFeature
? state.features.toJS()
@ -131,6 +132,7 @@ export const mapStateToPropsConfigurable = isFeature => state => {
featureMetrics,
archive: !isFeature,
settings,
flags,
loading: state.apiCalls.fetchTogglesState.loading,
};
};