Skip to content

Commit

Permalink
Merge branch 'dev' into fix/SRS-540-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspalsingh-aot committed Oct 18, 2024
2 parents 29c55fc + 7e670f9 commit 5a8cfd6
Show file tree
Hide file tree
Showing 18 changed files with 1,699 additions and 508 deletions.
2 changes: 1 addition & 1 deletion backend/sites/src/app/entities/siteHistoryLog.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export class HistoryLog extends BaseAuditEntity {

@Field(() => GraphQLJSON)
@Column('jsonb', { name: 'data' })
content: Record<string, any>
content: Record<string, any>;
}
4 changes: 1 addition & 3 deletions backend/sites/src/app/resolvers/site/site.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ export class SiteResolver {
* @returns sites where id or address matches the search param along with pagination params
*/
@Roles({
roles: [
CustomRoles.SiteRegistrar,
],
roles: [CustomRoles.SiteRegistrar],
mode: RoleMatchingMode.ANY,
})
@Query(() => QueryResultForPendingSitesResponse, {
Expand Down
6 changes: 3 additions & 3 deletions backend/sites/src/app/services/site/site.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1720,19 +1720,19 @@ export class SiteService {

const historyLog: HistoryLog = {
userId: userInfo ? userInfo.sub : '',
content: {...site, 'isApproved': isApproved},
content: { ...site, isApproved: isApproved },
id: null,
whoCreated: userInfo ? userInfo.givenName : '',
whenCreated: new Date(),
whenUpdated: new Date(),
whoUpdated: userInfo ? userInfo.givenName : '',
siteId: site.siteId,
};

await transactionalEntityManager.save(HistoryLog, historyLog);

this.sitesLogger.log('SiteService.processSRBulkUpdates() end');

return true;
} catch (error) {
this.sitesLogger.log(
Expand Down
12 changes: 7 additions & 5 deletions backend/sites/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ async function main() {
});
await app.listen(process.env.PORT || 4007);
}
main().then(()=>{
logger.log(`Process start up took ${process.uptime()} seconds`);
}).catch(err=>{
logger.error(err.message, err.stack);
});
main()
.then(() => {
logger.log(`Process start up took ${process.uptime()} seconds`);
})
.catch((err) => {
logger.error(err.message, err.stack);
});
4 changes: 2 additions & 2 deletions backend/sites/src/migrations/1729106451871-master-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BEGIN
END $$;`,
);
await queryRunner.query(
`DO $$
`DO $$
BEGIN
IF EXISTS (
SELECT 1
Expand All @@ -32,7 +32,7 @@ END $$;`,
ALTER TABLE "sites"."site_profile_land_uses"
DROP CONSTRAINT "FK_84d86cc243b265a436e3ab616c3";
END IF;
END $$;`
END $$;`,
);
await queryRunner.query(
`ALTER TABLE "sites"."site_profile_owners" DROP CONSTRAINT "FK_4d14bbf4faba151de1fd6c6f4d0"`,
Expand Down
21 changes: 12 additions & 9 deletions backend/sites/src/migrations/1729183789534-master-script.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { MigrationInterface, QueryRunner } from 'typeorm';

export class MasterScript1729183789534 implements MigrationInterface {
name = 'MasterScript1729183789534'
name = 'MasterScript1729183789534';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "sites"."historylog" RENAME COLUMN "snapshot_data" TO "data"`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "sites"."historylog" RENAME COLUMN "data" TO "snapshot_data"`);
}
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "sites"."historylog" RENAME COLUMN "snapshot_data" TO "data"`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "sites"."historylog" RENAME COLUMN "data" TO "snapshot_data"`,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const TextInput: React.FC<InputProps> = ({
htmlFor={inputTxtId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down Expand Up @@ -319,7 +319,7 @@ export const DropdownInput: React.FC<InputProps> = ({
htmlFor={drdownId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
aria-labelledby={label}
Expand Down Expand Up @@ -482,7 +482,7 @@ export const GroupInput: React.FC<InputProps> = ({
htmlFor={groupId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand All @@ -498,7 +498,7 @@ export const GroupInput: React.FC<InputProps> = ({
{isChildLabel && (
<label
htmlFor={grpId}
className={`${!isEditing ? (customLabelCss ?? '') : `form-label ${customEditLabelCss ?? 'custom-label'}`}`}
className={`${!isEditing ? customLabelCss ?? '' : `form-label ${customEditLabelCss ?? 'custom-label'}`}`}
>
{child.label}
</label>
Expand Down Expand Up @@ -584,7 +584,7 @@ export const DateRangeInput: React.FC<InputProps> = ({
htmlFor={dateRangeId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down Expand Up @@ -666,7 +666,7 @@ export const DateInput: React.FC<InputProps> = ({
htmlFor={dateRangeId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down Expand Up @@ -755,7 +755,7 @@ export const CheckBoxInput: React.FC<InputProps> = ({
htmlFor={inputTxtId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `px-1 form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down Expand Up @@ -812,7 +812,7 @@ export const TextAreaInput: React.FC<InputProps> = ({
htmlFor={textAreaId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down Expand Up @@ -938,7 +938,7 @@ export const DropdownSearchInput: React.FC<InputProps> = ({
htmlFor={drdownId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down Expand Up @@ -1166,7 +1166,7 @@ export const SearchCustomInput: React.FC<InputProps> = ({
htmlFor={inputTxtId}
className={`${
!isEditing
? (customLabelCss ?? '')
? customLabelCss ?? ''
: `form-label ${customEditLabelCss ?? 'custom-label'}`
}`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,30 @@ describe('Dashboard Component', () => {

beforeEach(() => {
store = mockStore({
dashboard: {},
dashboard: {
recentView: {
data: [
{
address: '4123 HILLY ROAD Demo',
city: 'NORTH VANCOUVER',
generalDescription:
'LAT/LON DERIVED BY BC ENVIRONMENT REFERENCING RECTIFIED NAD 83 ORTHOPHOTOGRAPHY - JAN. 27,1997',
siteId: '9',
userId: 'xxx-ffff-oooo',
whenUpdated: '2016-11-22T08:00:00.000Z',
},
],
},
},
});
});

test('renders Recently Viewed table', () => {
it('renders Recently Viewed table', () => {
const { getByText } = render(
<Provider store={store}>
<Dashboard />
</Provider>,
);
expect(getByText('Recently Viewed')).toBeInTheDocument();
});

test('renders Recently Modified Folios table', () => {
const { getByText } = render(
<Provider store={store}>
<Dashboard />
</Provider>,
);
expect(getByText('Recently Modified Folios')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ export const getSiteDetailsToBeSaved = (state: any) => {
UserActionEnum.deleted,
]),
documents:
state.siteDetails.siteAssociationsData &&
state.siteDetails.siteAssociationsData.length > 0 &&
state.siteDetails.documentsData &&
state.siteDetails.documentsData.length > 0 &&
deepFilterByUserAction(state.siteDetails.documentsData, [
UserActionEnum.added,
UserActionEnum.updated,
Expand Down
Loading

0 comments on commit 5a8cfd6

Please sign in to comment.