-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded to latest React MVVM [release]
- Loading branch information
1 parent
759fe7b
commit 303a758
Showing
74 changed files
with
6,612 additions
and
7,858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,17 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 6.0.x | ||
dotnet-version: 8 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Restore dependencies | ||
run: | | ||
|
@@ -27,7 +32,7 @@ jobs: | |
- name: Build | ||
run: | | ||
npm run build -- --mode=production | ||
npm run build -- -- --mode=production | ||
dotnet build --configuration Release --no-restore | ||
- name: Test | ||
|
@@ -45,16 +50,11 @@ jobs: | |
rm appsettings.Development.json | ||
zip -r ../HintKeep.zip . | ||
- name: Azure Authentication | ||
if: github.event_name == 'push' && contains(toJSON(github.event.commits.*.message), '[release]') | ||
uses: azure/login@v1 | ||
- uses: Azure/[email protected] | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Deploy Application | ||
if: github.event_name == 'push' && contains(toJSON(github.event.commits.*.message), '[release]') | ||
shell: pwsh | ||
run: | | ||
az webapp stop --resource-group HintKeep --name HintKeep | ||
az webapp deployment source config-zip --resource-group HintKeep --name HintKeep --src ./Publish/HintKeep.zip | ||
az webapp start --resource-group HintKeep --name HintKeep | ||
app-name: '' | ||
publish-profile: ${{ secrets.PUBLISH_PROFILE }} | ||
package: ./Publish/HintKeep.zip | ||
type: zip | ||
clean: true | ||
restart: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import type { AlertViewModel } from '../../view-models/alerts-view-model'; | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import { watchViewModel } from 'react-model-view-viewmodel'; | ||
import { Message } from '../i18n'; | ||
import { useViewModel } from 'react-model-view-viewmodel'; | ||
|
||
import Style from './../style.scss'; | ||
|
||
export interface IAlertProps { | ||
readonly $vm: AlertViewModel; | ||
readonly alertViewModel: AlertViewModel; | ||
}; | ||
|
||
export function Alert({ $vm }: IAlertProps): JSX.Element { | ||
watchViewModel($vm); | ||
export function Alert({ alertViewModel }: IAlertProps): JSX.Element { | ||
useViewModel(alertViewModel); | ||
|
||
return ( | ||
<div className={classnames(Style.m2, Style.alert, Style.alertDanger, Style.alertDismissible)} role="alert"> | ||
<Message id={$vm.message} /> | ||
<button type="button" className={Style.btnClose} onClick={() => $vm.dismiss()} /> | ||
<Message id={alertViewModel.message} /> | ||
<button type="button" className={Style.btnClose} onClick={() => alertViewModel.dismiss()} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import React from 'react'; | ||
import { Alert } from './alert'; | ||
import { requireViewModel } from '../use-view-model'; | ||
import { watchCollection } from 'react-model-view-viewmodel'; | ||
import { useObservableCollection, useViewModelDependency } from 'react-model-view-viewmodel'; | ||
import { AlertsViewModel } from '../../view-models/alerts-view-model'; | ||
|
||
export function Alerts(): JSX.Element { | ||
const $vm = requireViewModel(({ alertsViewModel }) => alertsViewModel); | ||
watchCollection($vm.alerts); | ||
const alertsViewModel = useViewModelDependency(AlertsViewModel); | ||
useObservableCollection(alertsViewModel.alerts); | ||
|
||
return ( | ||
<> | ||
{$vm.alerts.map((alert, index) => <Alert key={index} $vm={alert} />)} | ||
{alertsViewModel.alerts.map((alert, index) => <Alert key={index} alertViewModel={alert} />)} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import { I18nConsumer } from './i18n-consumer'; | ||
|
||
export interface IMessageProps { | ||
|
Oops, something went wrong.