Skip to content

Commit

Permalink
♻️ Fix widget for SSW People Staging (#59)
Browse files Browse the repository at this point in the history
* fixed widget for staging people site

* 2.0.8
  • Loading branch information
babakamyljanovssw authored Nov 22, 2024
1 parent 860cab4 commit 32d6029
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"widget",
"standards"
],
"version": "2.0.7",
"version": "2.0.8",
"license": "MIT",
"main": "dist/ssw.rules.widget.cjs.js",
"module": "dist/ssw.rules.widget.es.js",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/widget/widget-constants.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export enum WidgetConstants {
ProdLatestRulesUrl = "https://www.ssw.com.au/rules/latest-rules/?size=50",
StagingLatestRulesUrl = "https://sarulesstagbbfslamgwndh2.z8.web.core.windows.net/rules/latest-rules/?size=50",
UserRulesUrl = "https://www.ssw.com.au/rules/user/?author=",
ProdPeopleUrl = "https://www.ssw.com.au/people",
StagingPeopleUrl = "https://sapeoplestagjthgmptzb46i.z8.web.core.windows.net/people",
}
11 changes: 5 additions & 6 deletions src/lib/widget/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const Widget = ({
let historyJsonUrl = import.meta.env.VITE_PROD_HISTORY_JSON_URL;
let commitsJsonUrl = import.meta.env.VITE_PROD_COMMITS_JSON_URL;

if (location === WidgetConstants.StagingRulesUrl) {
if (
location === WidgetConstants.StagingRulesUrl ||
location === WidgetConstants.StagingPeopleUrl
) {
rulesUrl = WidgetConstants.StagingRulesUrl;
latestRulesUrl = WidgetConstants.StagingLatestRulesUrl;
historyJsonUrl = import.meta.env.VITE_STAGING_HISTORY_JSON_URL;
Expand Down Expand Up @@ -214,11 +217,7 @@ const Widget = ({
location === WidgetConstants.StagingRulesUrl ? (
"Latest Rules"
) : (
<a
rel="noreferrer"
target="_blank"
href={`${WidgetConstants.ProdLatestRulesUrl}`}
>
<a rel="noreferrer" target="_blank" href={`${latestRulesUrl}`}>
Latest Rules
</a>
)}
Expand Down

0 comments on commit 32d6029

Please sign in to comment.