1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-31 13:47:02 +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, toggleFeature,
archive, archive,
loading, loading,
flags,
}) => { }) => {
const { hasAccess } = useContext(AccessContext); const { hasAccess } = useContext(AccessContext);
const styles = useStyles(); const styles = useStyles();
@ -72,6 +73,8 @@ const FeatureToggleList = ({
revive={revive} revive={revive}
hasAccess={hasAccess} hasAccess={hasAccess}
className={'skeleton'} className={'skeleton'}
flags={flags}
archive={archive}
/> />
)); ));
} }
@ -91,6 +94,7 @@ const FeatureToggleList = ({
toggleFeature={toggleFeature} toggleFeature={toggleFeature}
revive={revive} revive={revive}
hasAccess={hasAccess} hasAccess={hasAccess}
flags={flags}
/> />
))} ))}
elseShow={ elseShow={
@ -223,6 +227,7 @@ FeatureToggleList.propTypes = {
history: PropTypes.object.isRequired, history: PropTypes.object.isRequired,
loading: PropTypes.bool, loading: PropTypes.bool,
currentProjectId: PropTypes.string.isRequired, currentProjectId: PropTypes.string.isRequired,
flags: PropTypes.object,
}; };
export default FeatureToggleList; export default FeatureToggleList;

View File

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

View File

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