Skip to content

[MDS-6194] Major project duplication #3269

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

Merged
merged 1 commit into from
Oct 17, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ import {
AMS_STATUS_CODES_SUCCESS,
AMS_STATUS_CODE_FAIL,
AMS_ENVIRONMENTAL_MANAGEMENT_ACT_TYPES,
SystemFlagEnum,
} from "@mds/common";
import { useFeatureFlag } from "@mds/common/providers/featureFlags/useFeatureFlag";
import { fetchRegions } from "@mds/common/redux/slices/regionsSlice";
import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelectors";

interface IParams {
mineGuid?: string;
Expand All @@ -51,6 +53,8 @@ export const ProjectSummaryPage = () => {
const dispatch = useDispatch();
const history = useHistory();
const location = useLocation();
const systemFlag = useSelector(getSystemFlag);
const isCore = systemFlag === SystemFlagEnum.core;

const { mineGuid, projectGuid, projectSummaryGuid, tab } = useParams<IParams>();
const anyTouched = useSelector(
Expand All @@ -71,7 +75,11 @@ export const ProjectSummaryPage = () => {
: mine?.mine_guid === mineGuid;
const [isLoaded, setIsLoaded] = useState(isDefaultLoaded);
const [isEditMode, setIsEditMode] = useState(isDefaultEditMode);
const projectFormTabs = null;
const projectFormTabs = getProjectFormTabs(
amsFeatureEnabled,
isCore,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Y'know, I even noticed that this function was throwing errors!
Technically this should always be false as this is a MineSpace file, but I'm not bothered by a bit of extra robustness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought might as well add the actual flag for that imaginary case where this component gets used in Core at some point for some weird unknown reason.

isFeatureEnabled(Feature.MAJOR_PROJECT_REFACTOR)
);
const activeTab = tab ?? projectFormTabs[0];

const handleFetchData = async () => {
Expand Down
Loading