Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set default classification for new sources (dev)
  • Loading branch information
cccs-rs authored Mar 8, 2025
2 parents 6b57472 + 77d476e commit 0c80efd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/routes/admin/service_detail/updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
useTheme
} from '@mui/material';
import FormControl from '@mui/material/FormControl';
import useALContext from 'components/hooks/useALContext';
import { DEFAULT_SOURCE, Service, UpdateSource } from 'components/models/base/service';
import { SourceCard } from 'components/routes/manage/signature_sources';
import { useEffect, useState } from 'react';
Expand Down Expand Up @@ -57,6 +58,7 @@ const marks = [

const ServiceUpdater = ({ service, defaults, setService, setModified }: ServiceUpdaterProps) => {
const { t } = useTranslation(['adminServices']);
const { c12nDef } = useALContext();
const [dialog, setDialog] = useState<boolean>(false);
const [editDialog, setEditDialog] = useState<boolean>(false);
const [editedSourceID, setEditedSourceID] = useState(-1);
Expand Down Expand Up @@ -367,7 +369,11 @@ const ServiceUpdater = ({ service, defaults, setService, setModified }: ServiceU
<Grid item xs={12}>
<SourceDialog
open={dialog}
source={{ ...DEFAULT_SOURCE, update_interval: service.update_config.update_interval_seconds }}
source={{
...DEFAULT_SOURCE,
update_interval: service.update_config.update_interval_seconds,
default_classification: c12nDef.UNRESTRICTED
}}
setOpen={setDialog}
onSave={handleSaveSource}
/>
Expand Down
9 changes: 8 additions & 1 deletion src/components/routes/manage/signature_sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ const ServiceDetail = ({ service, sources, generatesSignatures, updateIntervalSe
const { t } = useTranslation(['manageSignatureSources']);
const theme = useTheme();
const classes = useStyles();
const { c12nDef } = useALContext();
const { apiCall } = useMyAPI();
const { closeGlobalDrawer, setGlobalDrawer } = useDrawer();
const { showSuccessMessage } = useMySnackbar();
Expand Down Expand Up @@ -566,7 +567,13 @@ const ServiceDetail = ({ service, sources, generatesSignatures, updateIntervalSe
color: theme.palette.mode === 'dark' ? theme.palette.success.light : theme.palette.success.dark,
margin: '-4px 0'
}}
onClick={() => openDrawer(service, { ...DEFAULT_SOURCE, update_interval: updateIntervalSeconds })}
onClick={() =>
openDrawer(service, {
...DEFAULT_SOURCE,
update_interval: updateIntervalSeconds,
default_classification: c12nDef.UNRESTRICTED
})
}
size="large"
>
<AddCircleOutlineOutlinedIcon />
Expand Down

0 comments on commit 0c80efd

Please sign in to comment.