Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Create ADR
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Dec 13, 2023
1 parent 1bf5636 commit 821c035
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
69 changes: 69 additions & 0 deletions docs/decisions/2023-12-13_version_page_logic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 2023-12-13 How the version page reasons about what to load

- status: accepted
- date: 2023-12-13
- authors: Mohamed Khelif

## Context and Problem Statement

The version page can have multiple states and every time it is loaded there are
a series of checks that need to be done to determine what to load or if we
should redirect to another page. This document aims to describe the logic behind
the version page.

<!-- This is an optional element. Feel free to remove. -->

## Considered Options

## Decision Outcome

Please reference the below flowchart for the logic behind the version page.

```mermaid
flowchart
2["hasVersion(id)"] --- 565589("Error")
style 2 fill:#acc6ff
480632["getPatch(id)"] --- 565589
style 480632 fill:#acc6ff
273918["getVersion(id)"] --- 565589
style 273918 fill:#acc6ff
480632 ---|"activated == true\n"| 273918
2 ---|"hasVersion == false\n"| 480632
2 ---|"hasVersion == true\n"| 273918
965472(["setIsLoadingData(false)"]) --- 616311["redirect to patch configure page"]
style 965472 fill:#a097ff
style 616311 fill:#00ff33
1{"User Visits /version/{id}"} --- 273769(["setIsLoadingData(true)"])
style 1 fill:#00ff33
style 273769 fill:#a097ff
273769 --- 2
565589 --- 229436(["setIsLoadingData(false)"])
style 229436 fill:#a097ff
229436 --- 835273["show error"]
style 835273 fill:#00ff33
860357(["setIsLoadingData(false)"]) --- 273918
style 860357 fill:#a097ff
860357 --- 750648["show version page"]
style 750648 fill:#00ff33
764900(["setIsLoadingData(false)"]) --- 164931["redirect to commit queue"]
style 764900 fill:#a097ff
style 164931 fill:#00ff33
965472 ---|"alias !== commit_queue && activated == false"| 480632
480632 ---|"alias == commit_queue && activated == false"| 764900
142529["GraphQL request"]
style 142529 fill:#acc6ff
497431["User visible feedback"]
style 497431 fill:#00ff33
539322(["State Transition"])
style 539322 fill:#a097ff
891333{"User Interaction"}
style 891333 fill:#00ff33
%% Mermaid Flow Diagram Link
%% Keep this link to make future edits to your diagram
%% https://www.mermaidflow.app/flowchart#N4IgZgNg9g7iBcoB2UAmBTAzgg2qGAlqgC4AWCAjAJxUA0Ip6BA5qcQgEwAMH9RCICiHoAHKJgLECUJAlAAPShwDMAFgB0HAKz0AnpS5cAvvVQBDYmbkgAxhDOZMWXAF16mYrojP4OcAQgIeABiQzAwZWUQNxB7ACN0CAEAVScAJwACADUCCWJMDIB6ADd0NIkZQuAiI2EQVAI09BspGQEAFQAhOrSzJABrTAARXphZRBMQETMmpGIAJT7+hC5TUYBlT28EMDMIJ0nPEXQBNNIoAFs4gFdMADk0E-ctk4n3RObidFQdvadRcSSaRIACCcUwUAg1y+1kU8AoKg02j0BmMJnwRDIlFUqnojBYbAQAA5ViB+PAQBw6mI8sDYUoAGwUdQAdh0IH08FUFFUk3MlmsdgcTmwvhiHi8Pj8YACQWCZhsNgZ4Wi9HiiQEpAcWTKFSQAAoiABKOoNJotOkUro9JbDUbjYCTaazBZLFZrMwwTaS377dCHXTHU6fPrMbwPDB1CXbN4gJzeFrfX3-KaA1qg8GQ6GvBSM5lslFcnlGdEgQgkcjwhns-GsdjwEl8H4UnnaDhUalpy25+GqLTKTTszkUJl8ixWRC2eyOKXil6i6WykIKpUqmLqpIUgDivREpAAigAZDJNACO1yw7FMjU+lpA1vovQGds9DqdM3Qc0WA3d9Q2L2Tf16COV4QHNSwkDDdAIyeOMANjeNPiTeBdj9AFaRkMEIShGFJzhHl+0HQsRwoEtaAxCtOG4PEmDrYlSXJQQGVUKhlCEdCgTaPCEC0FkOFZIdKARBkxwFSchRnBc50lBd-ECEIwgiKJ1zMBJNzA74bxaDJiCgDIbEuC5JAyc90AvU0tPTDpukfW0RlfOR3xdb9lngUlUH-H0UL+ICQBA4MWlDcNHijeDHXeBMvmbVCUxpTiM2w7N6XgXj+ILDkhI4ETS3LLF4G4XEGFowl4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tDvDojpADiAzrKHaFIAIGjtNscFU0hCtrJGGAcEYHZKMCAA
```

<!-- This is an optional element. Feel free to remove. -->

## More Information
2 changes: 2 additions & 0 deletions src/pages/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import BuildVariantCard from "./version/BuildVariantCard";
import { ActionButtons, Metadata, VersionTabs } from "./version/index";
import { NameChangeModal } from "./version/NameChangeModal";

// IMPORTANT: If you make any changes to the state logic in this file, please make sure to update the ADR:
// docs/adrs/2023-12-13_version_page_logic.md
export const VersionPage: React.FC = () => {
const spruceConfig = useSpruceConfig();
const { id } = useParams<{ id: string }>();
Expand Down

0 comments on commit 821c035

Please sign in to comment.