mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 13:48:58 +02:00
fix: preserve saved auto-update settings and clarify file tree icons
This commit is contained in:
+16
-3
@@ -1006,6 +1006,7 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
state._originalBranch = res.data.source.branch;
|
||||
state.options = Object.assign({}, state.options, res.data.options);
|
||||
state.conference = res.data.conference;
|
||||
state._originalConference = res.data.conference;
|
||||
state.repositoryID = res.data.source.repositoryID;
|
||||
state._originalRepositoryID = res.data.source.repositoryID;
|
||||
if (res.data.options.expirationDate) {
|
||||
@@ -1030,6 +1031,7 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
state.source = res.data.source;
|
||||
state.options = Object.assign({}, state.options, res.data.options);
|
||||
state.conference = res.data.conference;
|
||||
state._originalConference = res.data.conference;
|
||||
if (res.data.options.expirationDate) {
|
||||
state.options.expirationDate = new Date(res.data.options.expirationDate);
|
||||
}
|
||||
@@ -1062,6 +1064,7 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
state.source = res.data.source;
|
||||
state.options = Object.assign({}, state.options, res.data.options);
|
||||
state.conference = res.data.conference;
|
||||
state._originalConference = res.data.conference;
|
||||
if (res.data.options.expirationDate) {
|
||||
state.options.expirationDate = new Date(res.data.options.expirationDate);
|
||||
}
|
||||
@@ -1486,12 +1489,20 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
|
||||
// ========== SHARED LOGIC ==========
|
||||
function getConference() {
|
||||
if (!state.conference) return;
|
||||
http.get("/api/conferences/" + state.conference).then(
|
||||
const conference = state.conference;
|
||||
state.conference_data = null;
|
||||
if (!conference) return;
|
||||
const preserveSavedOptions =
|
||||
state.isUpdate && conference === state._originalConference;
|
||||
http.get("/api/conferences/" + conference).then(
|
||||
(res) => {
|
||||
if (state.conference !== conference) return;
|
||||
state.conference_data = res.data;
|
||||
state.conference_data.startDate = new Date(state.conference_data.startDate);
|
||||
state.conference_data.endDate = new Date(state.conference_data.endDate);
|
||||
// Conference defaults must not overwrite an existing submission's
|
||||
// saved settings when its edit form loads (#791).
|
||||
if (preserveSavedOptions) return;
|
||||
state.options.expirationDate = new Date(state.conference_data.endDate);
|
||||
state.options.expirationMode = "remove";
|
||||
state.options.update = state.conference_data.options.update;
|
||||
@@ -1500,7 +1511,9 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
state.options.notebook = state.conference_data.options.notebook;
|
||||
state.options.link = state.conference_data.options.link;
|
||||
},
|
||||
() => { state.conference_data = null; }
|
||||
() => {
|
||||
if (state.conference === conference) state.conference_data = null;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,8 @@ export default {
|
||||
const open = matching.value ? opens[path] !== false : !!opens[path];
|
||||
const truncated = folder && props.page?.options?.truncatedFolders?.includes(path.slice(1));
|
||||
const count = props.page?.fileCounts?.[path.slice(1)] || 0;
|
||||
const icon = h("span", { class: folder ? "tree-icon-folder" : "tree-icon-file" });
|
||||
const icon = h("span", { class: folder ? "tree-icon-folder" : "far fa-file tree-icon-file", "aria-hidden": "true" },
|
||||
folder ? h("svg", { viewBox: "0 0 14 12", focusable: "false" }, h("path", { d: "M1.5 10.5v-9h4l1.5 2h5.5v7z" })) : null);
|
||||
const label = h("span", { class: "tree-name" }, name);
|
||||
const onClick = event => {
|
||||
focus(event.currentTarget);
|
||||
|
||||
Vendored
+18
-18
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user