Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
* Added update command.
* Added (Client) online-check to public.
* Updated developer documentation.
* Removed admin/access-config.json fetch

### NB! Prior to 3.x the project was split into separate repositories

Expand Down
51 changes: 20 additions & 31 deletions assets/admin/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ function App() {
const [authenticated, setAuthenticated] = useState();
const [config, setConfig] = useState();
const [selectedTenant, setSelectedTenant] = useState();
const [accessConfig, setAccessConfig] = useState();
const [tenants, setTenants] = useState();
const [userName, setUserName] = useState("");
const [userType, setUserType] = useState("");
Expand All @@ -66,6 +65,26 @@ function App() {
const [isPublished, setIsPublished] = useState("all");
const [exists, setExists] = useState(null);
const [screenUserLatestRequest, setScreenUserLatestRequest] = useState(null);
const [accessConfig, setAccessConfig] = useState({
campaign: {
roles: ["ROLE_ADMIN"],
},
screen: {
roles: ["ROLE_ADMIN"],
},
settings: {
roles: ["ROLE_ADMIN"],
},
groups: {
roles: ["ROLE_ADMIN"],
},
shared: {
roles: ["ROLE_ADMIN"],
},
users: {
roles: ["ROLE_ADMIN", "ROLE_EXTERNAL_USER_ADMIN"],
},
});

const userStore = {
authenticated: { get: authenticated, set: setAuthenticated },
Expand Down Expand Up @@ -150,36 +169,6 @@ function App() {
};
}, []);

useEffect(() => {
fetch("/admin/access-config.json")
.then((response) => response.json())
.then((jsonData) => {
setAccessConfig(jsonData);
})
.catch(() => {
setAccessConfig({
campaign: {
roles: ["ROLE_ADMIN"],
},
screen: {
roles: ["ROLE_ADMIN"],
},
settings: {
roles: ["ROLE_ADMIN"],
},
groups: {
roles: ["ROLE_ADMIN"],
},
shared: {
roles: ["ROLE_ADMIN"],
},
users: {
roles: ["ROLE_ADMIN", "ROLE_EXTERNAL_USER_ADMIN"],
},
});
});
}, []);

useEffect(() => {
i18next.init({
interpolation: { escapeValue: false }, // React already does escaping
Expand Down